summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorahaase2008-02-26 06:00:06 (EST)
committerahaase2008-02-26 06:00:06 (EST)
commit515b96e87cc52e45afa5a85fce747f624ae9b7d9 (patch)
tree5b9ffdc7019b082c478c8542fd7da3ab2e34233f
parent7c32eb654b09b432c6638533b023e12c67a454c9 (diff)
downloadorg.eclipse.xpand-515b96e87cc52e45afa5a85fce747f624ae9b7d9.zip
org.eclipse.xpand-515b96e87cc52e45afa5a85fce747f624ae9b7d9.tar.gz
org.eclipse.xpand-515b96e87cc52e45afa5a85fce747f624ae9b7d9.tar.bz2
bugfix: did not work with properties that only have a setter and no getter
-rw-r--r--plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/java/internal/JavaBeansType.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/java/internal/JavaBeansType.java b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/java/internal/JavaBeansType.java
index 78b43f5..e1dfdb4 100644
--- a/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/java/internal/JavaBeansType.java
+++ b/plugins/org.eclipse.xtend.backend/src/org/eclipse/xtend/backend/types/java/internal/JavaBeansType.java
@@ -72,10 +72,10 @@ public final class JavaBeansType implements BackendType {
}
for (PropertyDescriptor pd: Introspector.getBeanInfo(_javaClass).getPropertyDescriptors()) {
- if (pd.getReadMethod().getDeclaringClass() == Object.class)
+ if (getDeclaringClass (pd) == Object.class)
continue;
- _properties.put (pd.getName(), new JavaBeansProperty (pd, this, ts.getRootTypesystem().findType (pd.getPropertyType())));
+ _properties.put (pd.getName(), new JavaBeansProperty (pd, this, ts.getRootTypesystem().findType (pd.getPropertyType()))); //TODO apply primitive type conversion!
}
// static properties
@@ -100,6 +100,13 @@ public final class JavaBeansType implements BackendType {
}
}
+ private Class<?> getDeclaringClass (PropertyDescriptor pd) {
+ if (pd.getReadMethod() != null)
+ return pd.getReadMethod().getDeclaringClass();
+
+ return pd.getWriteMethod().getDeclaringClass();
+ }
+
public Object create () {
try {
return _javaClass.newInstance();