From 46a55bd024c1c8edd8f7aadaf9630f98e709b123 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 1 Nov 2013 20:33:27 -0500 Subject: [PATCH] Implement ArrayList#ensureCapacity Signed-off-by: Johannes Schindelin --- classpath/java/util/ArrayList.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/classpath/java/util/ArrayList.java b/classpath/java/util/ArrayList.java index bcc3810c82..61cd5edbbf 100644 --- a/classpath/java/util/ArrayList.java +++ b/classpath/java/util/ArrayList.java @@ -65,6 +65,10 @@ public class ArrayList extends AbstractList implements java.io.Serializabl return size; } + public void ensureCapacity(int capacity) { + grow(capacity); + } + public boolean contains(Object element) { for (int i = 0; i < size; ++i) { if (equal(element, array[i])) {