Fix some inner class related bugs: 1) whenever a class is added into the class list...
[IRC.git] / Robust / src / ClassLibrary / MGC / gnu / Arrays.java
index 394d749c9f51787ef8d7d958bdab29e3cc899476..ca5498c5ed5121af241d881b88e05f2021db3e42 100644 (file)
@@ -3249,7 +3249,8 @@ public class Arrays
      */
     public Object/*E*/ set(int index, Object/*E*/ element)
     {
-      E old = a[index];
+      
+      Object/*E*/ old = a[index];
       a[index] = element;
       return old;
     }
@@ -3307,7 +3308,10 @@ public class Arrays
      */
     public Object[] toArray()
     {
-      return (Object[]) a.clone();
+      //return (Object[]) a.clone();
+      Object[] ta = new Object[a.length];
+      System.arraycopy(a, 0, ta, 0, a.length);
+      return ta;
     }
 
     /**