diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-16 19:19:11 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-02-16 19:19:11 +0000 |
commit | aba3c45755760e6466f6e9cf4cdadd48010775c8 (patch) | |
tree | e7ef2ef7632f57e6591696d549ab149a2dd28339 /libjava/classpath/javax | |
parent | 3289a94d47e6c5ba037afe7dcd704f79a0e8c379 (diff) | |
download | ppe42-gcc-aba3c45755760e6466f6e9cf4cdadd48010775c8.tar.gz ppe42-gcc-aba3c45755760e6466f6e9cf4cdadd48010775c8.zip |
2006-10-14 Edwin Steiner <edwin.steiner@gmx.net>
PR classpath/28652:
* javax/management/MBeanInfo.java (MBeanInfo):
Use clone to duplicate the arrays in order to
preserve the array type.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122050 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/javax')
-rw-r--r-- | libjava/classpath/javax/management/MBeanInfo.java | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/libjava/classpath/javax/management/MBeanInfo.java b/libjava/classpath/javax/management/MBeanInfo.java index d30de0499aa..64e627f1b19 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(); } /** |