From ed7702f83c34ebfccedf91bddb473ce4afe91b46 Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Mon, 4 Dec 2006 01:05:05 +0000 Subject: 2006-12-04 Andrew John Hughes * 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. --- ChangeLog | 11 +++++++++++ gnu/java/lang/management/BeanImpl.java | 7 ++----- java/lang/management/ManagementFactory.java | 4 ++++ javax/management/openmbean/OpenType.java | 6 +++--- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62371c9ad..2c89edc9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-12-04 Andrew John Hughes + + * 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. + 2006-12-04 Mark Wielaard * vm/reference/gnu/java/nio/VMChannel.java (isThreadInterrupted): diff --git a/gnu/java/lang/management/BeanImpl.java b/gnu/java/lang/management/BeanImpl.java index 529ee5896..10ae420b3 100644 --- a/gnu/java/lang/management/BeanImpl.java +++ b/gnu/java/lang/management/BeanImpl.java @@ -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) diff --git a/java/lang/management/ManagementFactory.java b/java/lang/management/ManagementFactory.java index ef3feace7..3a2c81c42 100644 --- a/java/lang/management/ManagementFactory.java +++ b/java/lang/management/ManagementFactory.java @@ -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) { diff --git a/javax/management/openmbean/OpenType.java b/javax/management/openmbean/OpenType.java index b08c40ccc..13c9e8a3e 100644 --- a/javax/management/openmbean/OpenType.java +++ b/javax/management/openmbean/OpenType.java @@ -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; -- cgit v1.2.1