diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-08-12 13:27:52 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2006-08-12 13:27:52 +0000 |
commit | 32bb0e9c211961fbade190535b8041ece5df772c (patch) | |
tree | 0c38bf4c10cc99e5da5d47c2830efb3c8e81d2a5 /javax/management/MBeanInfo.java | |
parent | d2f33039bd87de27b08ce88a7865d499b9b64c82 (diff) | |
download | classpath-32bb0e9c211961fbade190535b8041ece5df772c.tar.gz |
2006-08-12 Andrew John Hughes <gnu_andrew@member.fsf.org>
* Merge of HEAD --> generics-branch for release
0.92 to 2006/08/12.
Diffstat (limited to 'javax/management/MBeanInfo.java')
-rw-r--r-- | javax/management/MBeanInfo.java | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/javax/management/MBeanInfo.java b/javax/management/MBeanInfo.java index e6f03f065..d30de0499 100644 --- a/javax/management/MBeanInfo.java +++ b/javax/management/MBeanInfo.java @@ -140,7 +140,8 @@ public class MBeanInfo * can be loaded by the MBean server or class loader; it merely * has to be a syntactically correct class name. Any of the * arrays may be <code>null</code>; this will be treated as if - * an empty array was supplied. + * an empty array was supplied. A copy of the arrays is + * taken, so later changes have no effect. * * @param name the name of the class this instance describes. * @param desc a description of the bean. @@ -162,19 +163,31 @@ public class MBeanInfo if (attribs == null) attributes = new MBeanAttributeInfo[0]; else - attributes = attribs; + { + attributes = new MBeanAttributeInfo[attribs.length]; + System.arraycopy(attribs, 0, attributes, 0, attribs.length); + } if (cons == null) constructors = new MBeanConstructorInfo[0]; else - constructors = cons; + { + constructors = new MBeanConstructorInfo[cons.length]; + System.arraycopy(cons, 0, constructors, 0, cons.length); + } if (ops == null) operations = new MBeanOperationInfo[0]; else - operations = ops; + { + operations = new MBeanOperationInfo[ops.length]; + System.arraycopy(ops, 0, operations, 0, ops.length); + } if (notifs == null) notifications = new MBeanNotificationInfo[0]; else - notifications = notifs; + { + notifications = new MBeanNotificationInfo[notifs.length]; + System.arraycopy(notifs, 0, notifications, 0, notifs.length); + } } /** |