diff --git a/classpath/java/util/ArrayList.java b/classpath/java/util/ArrayList.java index c069cb116a..21d2b093c3 100644 --- a/classpath/java/util/ArrayList.java +++ b/classpath/java/util/ArrayList.java @@ -100,6 +100,15 @@ public class ArrayList implements List { } } + public T set(int index, T element) { + if (index >= size) { + resize(index+1); + } + Object oldValue = array[index]; + array[index] = element; + return (T) oldValue; + } + public T remove(int index) { T v = get(index);