src/share/classes/java/beans/MetaData.java

Print this page

        

@@ -121,17 +121,17 @@
     protected Expression instantiate(Object oldInstance, Encoder out) {
         // System.out.println("instantiate: " + type + " " + oldInstance);
         Class<?> oldClass = oldInstance.getClass();
         return new Expression(oldInstance, Array.class, "newInstance",
                    new Object[]{oldClass.getComponentType(),
-                                new Integer(Array.getLength(oldInstance))});
+                                Array.getLength(oldInstance)});
         }
 
     protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
         int n = Array.getLength(oldInstance);
         for (int i = 0; i < n; i++) {
-            Object index = new Integer(i);
+            Object index = i;
             // Expression oldGetExp = new Expression(Array.class, "get", new Object[]{oldInstance, index});
             // Expression newGetExp = new Expression(Array.class, "get", new Object[]{newInstance, index});
             Expression oldGetExp = new Expression(oldInstance, "get", new Object[]{index});
             Expression newGetExp = new Expression(newInstance, "get", new Object[]{index});
             try {

@@ -633,11 +633,11 @@
         if (oldSize < newSize) {
             invokeStatement(oldInstance, "clear", new Object[]{}, out);
             newSize = 0;
         }
         for (int i = 0; i < newSize; i++) {
-            Object index = new Integer(i);
+            Object index = i;
 
             Expression oldGetExp = new Expression(oldInstance, "get", new Object[]{index});
             Expression newGetExp = new Expression(newInstance, "get", new Object[]{index});
             try {
                 Object oldValue = oldGetExp.getValue();

@@ -890,11 +890,11 @@
     }
 
     protected Expression instantiate(Object oldInstance, Encoder out) {
         java.awt.MenuShortcut m = (java.awt.MenuShortcut)oldInstance;
         return new Expression(oldInstance, m.getClass(), "new",
-                   new Object[]{new Integer(m.getKey()), Boolean.valueOf(m.usesShiftModifier())});
+                   new Object[]{m.getKey(), Boolean.valueOf(m.usesShiftModifier())});
     }
 }
 
 // Component
 static final class java_awt_Component_PersistenceDelegate extends DefaultPersistenceDelegate {