geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject cvs commit: incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx CGLibMethodInterceptor.java
Date Fri, 27 Aug 2004 12:26:49 GMT
adc         2004/08/27 05:26:49

  Modified:    modules/kernel/src/java/org/apache/geronimo/gbean/jmx
                        CGLibMethodInterceptor.java
  Log:
  Should ignore case when looking for the method index.
  
  Revision  Changes    Path
  1.6       +16 -7     incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/CGLibMethodInterceptor.java
  
  Index: CGLibMethodInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/CGLibMethodInterceptor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CGLibMethodInterceptor.java	27 Jul 2004 02:14:14 -0000	1.5
  +++ CGLibMethodInterceptor.java	27 Aug 2004 12:26:49 -0000	1.6
  @@ -20,6 +20,7 @@
   import java.lang.reflect.Method;
   import java.util.HashMap;
   import java.util.Map;
  +import java.util.Iterator;
   import javax.management.MBeanAttributeInfo;
   import javax.management.MBeanInfo;
   import javax.management.MBeanOperationInfo;
  @@ -164,8 +165,7 @@
               if (methodIndex != null) {
                   return new RawGetAttributeInvoker(rawInvoker, methodIndex.intValue());
               }
  -            attributeName = Introspector.decapitalize(attributeName);
  -            methodIndex = ((Integer) attributes.get(attributeName));
  +            methodIndex = getMethodIndex(attributes, attributeName);
               if (methodIndex != null) {
                   return new RawGetAttributeInvoker(rawInvoker, methodIndex.intValue());
               }
  @@ -177,8 +177,7 @@
               if (methodIndex != null) {
                   return new RawGetAttributeInvoker(rawInvoker, methodIndex.intValue());
               }
  -            attributeName = Introspector.decapitalize(attributeName);
  -            methodIndex = ((Integer) attributes.get(attributeName));
  +            methodIndex = getMethodIndex(attributes, attributeName);
               if (methodIndex != null) {
                   return new RawGetAttributeInvoker(rawInvoker, methodIndex.intValue());
               }
  @@ -190,8 +189,7 @@
               if (methodIndex != null) {
                   return new RawSetAttributeInvoker(rawInvoker, methodIndex.intValue());
               }
  -            attributeName = Introspector.decapitalize(attributeName);
  -            methodIndex = ((Integer) attributes.get(attributeName));
  +            methodIndex = getMethodIndex(attributes, attributeName);
               if (methodIndex != null) {
                   return new RawSetAttributeInvoker(rawInvoker, methodIndex.intValue());
               }
  @@ -282,5 +280,16 @@
               return methodProxy.getSuperIndex();
           }
           return -1;
  +    }
  +
  +    private static Integer getMethodIndex(Map attributes, String attributeName) {
  +        Iterator iter = attributes.keySet().iterator();
  +        while (iter.hasNext()) {
  +            String key = (String) iter.next();
  +            if (key.equalsIgnoreCase(attributeName)) {
  +                return (Integer) attributes.get(key);
  +            }
  +        }
  +        return null;
       }
   }
  
  
  

Mime
View raw message