From d16c4b1a166ea5413487d3935c385ee82f560e81 Mon Sep 17 00:00:00 2001 From: Edwin Steiner Date: Fri, 16 Feb 2007 19:19:11 +0000 Subject: re PR classpath/28652 (JBoss fails to start due class cast exception in the management classes) 2006-10-14 Edwin Steiner PR classpath/28652: * javax/management/MBeanInfo.java (MBeanInfo): Use clone to duplicate the arrays in order to preserve the array type. From-SVN: r122050 --- libjava/classpath/ChangeLog | 7 ++++++ libjava/classpath/javax/management/MBeanInfo.java | 24 +++++++-------------- .../classpath/lib/javax/management/MBeanInfo.class | Bin 4188 -> 4037 bytes 3 files changed, 15 insertions(+), 16 deletions(-) (limited to 'libjava/classpath') diff --git a/libjava/classpath/ChangeLog b/libjava/classpath/ChangeLog index 577fa67..2288788 100644 --- a/libjava/classpath/ChangeLog +++ b/libjava/classpath/ChangeLog @@ -1,3 +1,10 @@ +2006-10-14 Edwin Steiner + + PR classpath/28652: + * javax/management/MBeanInfo.java (MBeanInfo): + Use clone to duplicate the arrays in order to + preserve the array type. + 2007-02-16 Andrew Haley * gnu/java/lang/management/MemoryMXBeanImpl.java, diff --git a/libjava/classpath/javax/management/MBeanInfo.java b/libjava/classpath/javax/management/MBeanInfo.java index d30de04..64e627f 100644 --- a/libjava/classpath/javax/management/MBeanInfo.java +++ b/libjava/classpath/javax/management/MBeanInfo.java @@ -160,34 +160,26 @@ public class MBeanInfo { className = name; description = desc; + if (attribs == null) attributes = new MBeanAttributeInfo[0]; else - { - attributes = new MBeanAttributeInfo[attribs.length]; - System.arraycopy(attribs, 0, attributes, 0, attribs.length); - } + attributes = (MBeanAttributeInfo[]) attribs.clone(); + if (cons == null) constructors = new MBeanConstructorInfo[0]; else - { - constructors = new MBeanConstructorInfo[cons.length]; - System.arraycopy(cons, 0, constructors, 0, cons.length); - } + constructors = (MBeanConstructorInfo[]) cons.clone(); + if (ops == null) operations = new MBeanOperationInfo[0]; else - { - operations = new MBeanOperationInfo[ops.length]; - System.arraycopy(ops, 0, operations, 0, ops.length); - } + operations = (MBeanOperationInfo[]) ops.clone(); + if (notifs == null) notifications = new MBeanNotificationInfo[0]; else - { - notifications = new MBeanNotificationInfo[notifs.length]; - System.arraycopy(notifs, 0, notifications, 0, notifs.length); - } + notifications = (MBeanNotificationInfo[]) notifs.clone(); } /** diff --git a/libjava/classpath/lib/javax/management/MBeanInfo.class b/libjava/classpath/lib/javax/management/MBeanInfo.class index 9af2932..956226e 100644 Binary files a/libjava/classpath/lib/javax/management/MBeanInfo.class and b/libjava/classpath/lib/javax/management/MBeanInfo.class differ -- cgit v1.1