I'm committing Edwin's patch for PR28652. According to Mark, this is minor enough not to warrant an assignment just yet.
Changelog:
2006-10-14 Edwin Steiner <[EMAIL PROTECTED]>
PR classpath/28652:
* javax/management/MBeanInfo.java (MBeanInfo):
Use clone to duplicate the arrays in order to
preserve the array type.
--
Andrew :-)
Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html
public class gcj extends Freedom implements Java { ... }
Index: javax/management/MBeanInfo.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/management/MBeanInfo.java,v
retrieving revision 1.5
diff -u -3 -p -u -r1.5 MBeanInfo.java
--- javax/management/MBeanInfo.java 2 Aug 2006 21:38:08 -0000 1.5
+++ javax/management/MBeanInfo.java 15 Feb 2007 23:33:47 -0000
@@ -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();
}
/**
signature.asc
Description: Digital signature
