jboynes 2004/01/23 08:43:06
Modified: modules/kernel/src/java/org/apache/geronimo/gbean
GBeanInfoFactory.java
Log:
Be stricter about what we consider a getter to be
Revision Changes Path
1.6 +4 -4
incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfoFactory.java
Index: GBeanInfoFactory.java
===================================================================
RCS file:
/home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfoFactory.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- GBeanInfoFactory.java 22 Jan 2004 20:10:33 -0000 1.5
+++ GBeanInfoFactory.java 23 Jan 2004 16:43:06 -0000 1.6
@@ -115,7 +115,8 @@
for (int i = 0; i < methods.length; i++) {
Method method = methods[i];
String name = method.getName();
- if (name.startsWith("get") || name.startsWith("is")) {
+ Class[] parameterTypes = method.getParameterTypes();
+ if ((name.startsWith("get") || name.startsWith("is")) &&
parameterTypes.length == 0) {
String attributeName = (name.startsWith("get")) ?
name.substring(3) : name.substring(2);
GAttributeInfo attribute = (GAttributeInfo)
tempAttributes.get(attributeName);
if (attribute == null) {
@@ -123,7 +124,7 @@
} else {
tempAttributes.put(attributeName, new
GAttributeInfo(attributeName, persistentName.contains(attributeName), name,
attribute.getSetterName()));
}
- } else if (name.startsWith("set")) {
+ } else if (name.startsWith("set") && parameterTypes.length == 1)
{
String attributeName = name.substring(3);
GAttributeInfo attribute = (GAttributeInfo)
tempAttributes.get(attributeName);
if (attribute == null) {
@@ -132,7 +133,6 @@
tempAttributes.put(attributeName, new
GAttributeInfo(attributeName, persistentName.contains(attributeName),
attribute.getSetterName(), name));
}
} else {
- Class[] parameterTypes = method.getParameterTypes();
List parameters = new ArrayList(parameterTypes.length);
for (int j = 0; j < parameterTypes.length; j++) {
parameters.add(parameterTypes[j].getName());