From 7192b0081df21cdbd2da2268053dc24502340b73 Mon Sep 17 00:00:00 2001 From: Mike Jensen Date: Wed, 16 Apr 2014 14:33:32 -0600 Subject: [PATCH] Small change to make these two structures implement RandomAccess (as they should) --- classpath/java/util/ArrayList.java | 2 +- classpath/java/util/RandomAccess.java | 2 ++ classpath/java/util/Vector.java | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/classpath/java/util/ArrayList.java b/classpath/java/util/ArrayList.java index 9b3f3f2169..1ee9548a2b 100644 --- a/classpath/java/util/ArrayList.java +++ b/classpath/java/util/ArrayList.java @@ -14,7 +14,7 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -public class ArrayList extends AbstractList implements java.io.Serializable { +public class ArrayList extends AbstractList implements java.io.Serializable, RandomAccess { private static final int MinimumCapacity = 16; private Object[] array; diff --git a/classpath/java/util/RandomAccess.java b/classpath/java/util/RandomAccess.java index 8ae88656d6..4d352155f0 100644 --- a/classpath/java/util/RandomAccess.java +++ b/classpath/java/util/RandomAccess.java @@ -11,4 +11,6 @@ package java.util; public interface RandomAccess { + /* nothing added here, this interface just indicates a + * structure is efficient to access via index's directly.*/ } diff --git a/classpath/java/util/Vector.java b/classpath/java/util/Vector.java index 94ba9cbbe6..88541043d9 100644 --- a/classpath/java/util/Vector.java +++ b/classpath/java/util/Vector.java @@ -10,7 +10,7 @@ package java.util; -public class Vector extends AbstractList implements java.io.Serializable, Cloneable { +public class Vector extends AbstractList implements java.io.Serializable, Cloneable, RandomAccess { private final ArrayList list; public Vector(int capacity) {