diff options
Diffstat (limited to 'libjava/classpath/javax/management/StandardMBean.java')
-rw-r--r-- | libjava/classpath/javax/management/StandardMBean.java | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/libjava/classpath/javax/management/StandardMBean.java b/libjava/classpath/javax/management/StandardMBean.java index 736192ee2ac..16b6f0b6687 100644 --- a/libjava/classpath/javax/management/StandardMBean.java +++ b/libjava/classpath/javax/management/StandardMBean.java @@ -205,17 +205,13 @@ public class StandardMBean Method getter; try { - getter = iface.getMethod("get" + - name.substring(0, 1).toUpperCase() + - name.substring(1), null); + getter = iface.getMethod("get" + name, null); } catch (NoSuchMethodException e) { try { - getter = iface.getMethod("is" + - name.substring(0, 1).toUpperCase() + - name.substring(1), null); + getter = iface.getMethod("is" + name, null); } catch (NoSuchMethodException ex) { @@ -564,11 +560,9 @@ public class StandardMBean Method[] amethods; String attrib; if (name.startsWith("is")) - attrib = name.substring(2,3).toLowerCase() - + name.substring(3); + attrib = name.substring(2); else - attrib = name.substring(3,4).toLowerCase() - + name.substring(4); + attrib = name.substring(3); if (attributes.containsKey(attrib)) amethods = (Method[]) attributes.get(attrib); else @@ -583,8 +577,7 @@ public class StandardMBean methods[a].getParameterTypes().length == 1) { Method[] amethods; - String attrib = name.substring(3,4).toLowerCase() - + name.substring(4); + String attrib = name.substring(3); if (attributes.containsKey(attrib)) amethods = (Method[]) attributes.get(attrib); else @@ -595,7 +588,8 @@ public class StandardMBean amethods[1] = methods[a]; } else - operations.add(new MBeanOperationInfo("", methods[a])); + operations.add(new MBeanOperationInfo(methods[a].getName(), + methods[a])); } List attribs = new ArrayList(attributes.size()); Iterator it = attributes.entrySet().iterator(); @@ -605,7 +599,8 @@ public class StandardMBean Method[] amethods = (Method[]) entry.getValue(); try { - attribs.add(new MBeanAttributeInfo((String) entry.getKey(), "", + attribs.add(new MBeanAttributeInfo((String) entry.getKey(), + (String) entry.getKey(), amethods[0], amethods[1])); } catch (IntrospectionException e) @@ -632,7 +627,8 @@ public class StandardMBean MBeanConstructorInfo[] cinfo = new MBeanConstructorInfo[cons.length]; for (int a = 0; a < cinfo.length; ++a) { - MBeanConstructorInfo oldInfo = new MBeanConstructorInfo("", cons[a]); + MBeanConstructorInfo oldInfo = new MBeanConstructorInfo(cons[a].getName(), + cons[a]); String desc = getDescription(oldInfo); MBeanParameterInfo[] params = oldInfo.getSignature(); MBeanParameterInfo[] pinfo = new MBeanParameterInfo[params.length]; @@ -665,8 +661,8 @@ public class StandardMBean oinfo[a] = new MBeanOperationInfo(oldInfo.getName(), desc, pinfo, oldInfo.getReturnType(), impact); } - info = new MBeanInfo(impl.getClass().getName(), "", ainfo, cinfo, - oinfo, null); + info = new MBeanInfo(impl.getClass().getName(), impl.getClass().getName(), + ainfo, cinfo, oinfo, null); String cname = getClassName(info); String desc = getDescription(info); info = new MBeanInfo(cname, desc, ainfo, cinfo, oinfo, null); @@ -679,7 +675,7 @@ public class StandardMBean * * @return the management interface. */ - public Class getMBeanInterface() + public final Class getMBeanInterface() { return iface; } |