diff -r 32653a09f0db -r 945817561b9a javap/src/main/java/sun/tools/javap/Vector.java --- a/javap/src/main/java/sun/tools/javap/Vector.java Sat Nov 10 19:01:28 2012 +0100 +++ b/javap/src/main/java/sun/tools/javap/Vector.java Sat Nov 10 20:31:39 2012 +0100 @@ -9,37 +9,49 @@ * @author Jaroslav Tulach */ final class Vector { + private Object[] arr; + Vector() { } Vector(int i) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + this(); } void add(Object objectType) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + addElement(objectType); } void addElement(Object obj) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + setSize(size() + 1); + setElementAt(obj, size()); } int size() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + return arr == null ? 0 : arr.length; } - void copyInto(String[] accflags) { + void copyInto(Object[] accflags) { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } Object elementAt(int index) { - throw new UnsupportedOperationException("Not supported yet."); + return arr[index]; } - void setSize(int i) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + void setSize(int len) { + if (arr == null) { + arr = new Object[len]; + } else { + Object[] newArr = new Object[len]; + int min = Math.min(len, arr.length); + for (int i = 0; i < min; i++) { + newArr[i] = arr[i]; + } + arr = newArr; + } } - void setElementAt(String id, int token) { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + void setElementAt(Object val, int index) { + arr[index] = val; } }