This fixes a few bugs I found in testing the management server. Changelog:
2006-12-04 Andrew John Hughes <[EMAIL PROTECTED]> * gnu/java/lang/management/BeanImpl.java: (translate(String)): Don't assume the list uses "E", just use the first and only type variable. * java/lang/management/ManagementFactory.java: (getPlatformMBeanServer()): Register logging bean. * javax/management/openmbean/OpenType.java: (OpenType(String,String,String)): Actually use the string created to handle arrays. -- Andrew :-) Escape the Java Trap with GNU Classpath! http://www.gnu.org/philosophy/java-trap.html public class gcj extends Freedom implements Java { ... }
Index: gnu/java/lang/management/BeanImpl.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/lang/management/BeanImpl.java,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 BeanImpl.java --- gnu/java/lang/management/BeanImpl.java 7 Aug 2006 21:20:43 -0000 1.4 +++ gnu/java/lang/management/BeanImpl.java 4 Dec 2006 00:59:56 -0000 @@ -500,11 +500,8 @@ public class BeanImpl { OpenType e = SimpleType.VOID; TypeVariable[] vars = c.getTypeParameters(); - for (int a = 0; a < vars.length; ++a) - { - if (vars[a].getName().equals("E")) - e = getTypeFromClass((Class) vars[a].getGenericDeclaration()); - } + if (vars.length > 0) + e = getTypeFromClass((Class) vars[0].getGenericDeclaration()); return new OpenMBeanParameterInfoSupport("TransParam", "Translated parameter", new ArrayType(1, e) Index: java/lang/management/ManagementFactory.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/management/ManagementFactory.java,v retrieving revision 1.14 diff -u -3 -p -u -r1.14 ManagementFactory.java --- java/lang/management/ManagementFactory.java 4 Dec 2006 00:10:18 -0000 1.14 +++ java/lang/management/ManagementFactory.java 4 Dec 2006 00:59:58 -0000 @@ -53,6 +53,8 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.logging.LogManager; + import javax.management.InstanceAlreadyExistsException; import javax.management.MBeanRegistrationException; import javax.management.MBeanServer; @@ -513,6 +515,8 @@ public class ManagementFactory ",name=" + bean.getName())); } + platformServer.registerMBean(LogManager.getLoggingMXBean(), + new ObjectName(LogManager.LOGGING_MXBEAN_NAME)); } catch (InstanceAlreadyExistsException e) { Index: javax/management/openmbean/OpenType.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/management/openmbean/OpenType.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 OpenType.java --- javax/management/openmbean/OpenType.java 9 Jul 2006 13:56:22 -0000 1.1 +++ javax/management/openmbean/OpenType.java 4 Dec 2006 01:00:03 -0000 @@ -133,11 +133,11 @@ public abstract class OpenType testString = className; boolean openTypeFound = false; for (int a = 0; a < ALLOWED_CLASSNAMES.length; ++a) - if (ALLOWED_CLASSNAMES[a].equals(className)) + if (ALLOWED_CLASSNAMES[a].equals(testString)) openTypeFound = true; if (!openTypeFound) - throw new OpenDataException("The class name does not specify " + - "a valid open type."); + throw new OpenDataException("The class name, " + testString + + ", does not specify a valid open type."); this.className = className; typeName = name; description = desc;
signature.asc
Description: Digital signature