Author: DartPeng
Date: 2008-10-15 05:04:53 -0400 (Wed, 15 Oct 2008)
New Revision: 10847
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java
Log:
JBIDE-2867
Deal with a problem that is the collection interface type property can't
display/connect correctly
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-15
09:02:47 UTC (rev 10846)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-15
09:04:53 UTC (rev 10847)
@@ -929,7 +929,7 @@
if (list == null)
return null;
if (parentModel.isList() || parentModel.isArray()) {
- if (list.size() >= 1) {
+ if (list.size() >= 1 && parentModel.hasGenericType()) {
JavaBeanModel m = (JavaBeanModel) list.get(0);
return m;
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java 2008-10-15
09:02:47 UTC (rev 10846)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java 2008-10-15
09:04:53 UTC (rev 10847)
@@ -41,6 +41,8 @@
private boolean collection = false;
private boolean isPrimitive = false;
+
+ private boolean hasGenericType = false;
private Class<? extends Object> beanClass = null;
@@ -117,6 +119,7 @@
.getActualTypeArguments()[0];
Class beanType = (Class) gtype;
componentClass = beanType;
+ setGenericType(true);
}
}
}
@@ -358,4 +361,12 @@
return buffer.toString();
}
+ public boolean hasGenericType() {
+ return hasGenericType;
+ }
+
+ public void setGenericType(boolean hasGenericType) {
+ this.hasGenericType = hasGenericType;
+ }
+
}
Show replies by date