diff --git a/src/java/org/apache/commons/collections/list/GrowthList.java b/src/java/org/apache/commons/collections/list/GrowthList.java index 9d43ff4f6..dbcc394ee 100644 --- a/src/java/org/apache/commons/collections/list/GrowthList.java +++ b/src/java/org/apache/commons/collections/list/GrowthList.java @@ -55,7 +55,7 @@ import java.util.List; * @author Stephen Colebourne * @author Paul Legato */ -public class GrowthList extends AbstractSerializableListDecorator { +public class GrowthList extends AbstractSerializableListDecorator { /** Serialization version */ private static final long serialVersionUID = -3620001881672L; @@ -66,8 +66,8 @@ public class GrowthList extends AbstractSerializableListDecorator { * @param list the list to decorate, must not be null * @throws IllegalArgumentException if list is null */ - public static List decorate(List list) { - return new GrowthList(list); + public static List decorate(List list) { + return new GrowthList(list); } //----------------------------------------------------------------------- @@ -75,7 +75,7 @@ public class GrowthList extends AbstractSerializableListDecorator { * Constructor that uses an ArrayList internally. */ public GrowthList() { - super(new ArrayList()); + super(new ArrayList()); } /** @@ -85,7 +85,7 @@ public class GrowthList extends AbstractSerializableListDecorator { * @throws IllegalArgumentException if initial size is invalid */ public GrowthList(int initialSize) { - super(new ArrayList(initialSize)); + super(new ArrayList(initialSize)); } /** @@ -94,7 +94,7 @@ public class GrowthList extends AbstractSerializableListDecorator { * @param list the list to decorate, must not be null * @throws IllegalArgumentException if list is null */ - protected GrowthList(List list) { + protected GrowthList(List list) { super(list); } @@ -117,12 +117,12 @@ public class GrowthList extends AbstractSerializableListDecorator { * @throws ClassCastException if the underlying list rejects the element * @throws IllegalArgumentException if the underlying list rejects the element */ - public void add(int index, Object element) { - int size = getList().size(); + public void add(int index, E element) { + int size = decorated().size(); if (index > size) { - getList().addAll(Collections.nCopies(index - size, null)); + decorated().addAll(Collections.nCopies(index - size, null)); } - getList().add(index, element); + decorated().add(index, element); } //----------------------------------------------------------------------- @@ -145,14 +145,14 @@ public class GrowthList extends AbstractSerializableListDecorator { * @throws ClassCastException if the underlying list rejects the element * @throws IllegalArgumentException if the underlying list rejects the element */ - public boolean addAll(int index, Collection coll) { - int size = getList().size(); + public boolean addAll(int index, Collection coll) { + int size = decorated().size(); boolean result = false; if (index > size) { - getList().addAll(Collections.nCopies(index - size, null)); + decorated().addAll(Collections.nCopies(index - size, null)); result = true; } - return (getList().addAll(index, coll) | result); + return (decorated().addAll(index, coll) | result); } //----------------------------------------------------------------------- @@ -175,12 +175,12 @@ public class GrowthList extends AbstractSerializableListDecorator { * @throws ClassCastException if the underlying list rejects the element * @throws IllegalArgumentException if the underlying list rejects the element */ - public Object set(int index, Object element) { - int size = getList().size(); + public E set(int index, E element) { + int size = decorated().size(); if (index >= size) { - getList().addAll(Collections.nCopies((index - size) + 1, null)); + decorated().addAll(Collections.nCopies((index - size) + 1, null)); } - return getList().set(index, element); + return decorated().set(index, element); } }