User: ejort
Date: 02/03/29 04:14:34
Modified: src/main/org/jboss/mx/metadata StandardMetaData.java
Log:
Merge differences between RelMX_1_0_0_13 and RelMX_1_0_0_14 to head
Revision Changes Path
1.7 +20 -7 jmx/src/main/org/jboss/mx/metadata/StandardMetaData.java
Index: StandardMetaData.java
===================================================================
RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/metadata/StandardMetaData.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- StandardMetaData.java 26 Feb 2002 02:02:59 -0000 1.6
+++ StandardMetaData.java 29 Mar 2002 12:14:34 -0000 1.7
@@ -66,7 +66,7 @@
HashMap getters = new HashMap();
HashMap setters = new HashMap();
- List operInfo = new ArrayList();
+ HashMap operInfo = new HashMap();
List attrInfo = new ArrayList();
for (int i = 0; i < methods.length; ++i)
@@ -78,24 +78,37 @@
if (methodName.startsWith("set") && signature.length == 1 && returnType
== Void.TYPE)
{
String key = methodName.substring(3, methodName.length());
- if (setters.get(key) != null)
+ Method setter = (Method) setters.get(key);
+ if (setter != null &&
setter.getParameterTypes()[0].equals(signature[0]) == false)
{
- throw new IntrospectionException("overloaded type for attribute:
" + key);
+ throw new IntrospectionException("overloaded type for attribute
set: " + key);
}
setters.put(key, methods[i]);
}
else if (methodName.startsWith("get") && signature.length == 0 &&
returnType != Void.TYPE)
{
- getters.put(methodName.substring(3, methodName.length()),
methods[i]);
+ String key = methodName.substring(3, methodName.length());
+ Method getter = (Method) getters.get(key);
+ if (getter != null && getter.getName().startsWith("get") == false)
+ {
+ throw new IntrospectionException("mixed use of get/is for
attribute " + key);
+ }
+ getters.put(key, methods[i]);
}
else if (methodName.startsWith("is") && signature.length == 0 &&
(returnType == Boolean.class || returnType == Boolean.TYPE))
{
- getters.put(methodName.substring(2, methodName.length()),
methods[i]);
+ String key = methodName.substring(2, methodName.length());
+ Method getter = (Method) getters.get(key);
+ if (getter != null && getter.getName().startsWith("is") == false)
+ {
+ throw new IntrospectionException("mixed use of get/is for
attribute " + key);
+ }
+ getters.put(key, methods[i]);
}
else
{
MBeanOperationInfo info = new MBeanOperationInfo("MBean Operation.",
methods[i]);
- operInfo.add(info);
+ operInfo.put(methods[i].toString(), info);
}
}
@@ -120,7 +133,7 @@
// save away the attribute and operation info objects
MBeanAttributeInfo[] attributeInfo = (MBeanAttributeInfo[])
attrInfo.toArray(new MBeanAttributeInfo[0]);
- MBeanOperationInfo[] operationInfo = (MBeanOperationInfo[])
operInfo.toArray(new MBeanOperationInfo[0]);
+ MBeanOperationInfo[] operationInfo = (MBeanOperationInfo[])
operInfo.values().toArray(new MBeanOperationInfo[0]);
MBeanNotificationInfo[] notifications = null;
if (mbeanInstance instanceof NotificationBroadcaster)
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development