Index: Vector.java =================================================================== RCS file: /home/cvspublic/kaffe/libraries/javalib/java/util/Vector.java,v retrieving revision 1.8 diff -u -r1.8 Vector.java --- Vector.java 1998/12/10 00:28:34 1.8 +++ Vector.java 1998/12/17 17:12:14 @@ -88,6 +88,25 @@ System.arraycopy( elementData, 0, anArray, 0, elementCount); } +public synchronized Object[] toArray() { + Object objs[] = new Object[elementCount]; + copyInto(objs); + return objs; +} + +public synchronized Object[] toArray( Object anArray[] ) { + if (anArray.length < elementCount) { + anArray = (Object[])java.lang.reflect.Array.newInstance( + anArray.getClass().getComponentType(), + elementCount); + } + copyInto(anArray); + for (int i = anArray.length; i-- > elementCount; ) { + anArray[i] = null; + } + return anArray; +} + final public synchronized Object elementAt ( int index ) { // required because we might have a large enough, pre-allocated, empty element // array that doesn't give us (physical) access errors