diff --git a/src/java/org/apache/commons/collections/list/SynchronizedList.java b/src/java/org/apache/commons/collections/list/SynchronizedList.java index 8af1d5644..3a234e058 100644 --- a/src/java/org/apache/commons/collections/list/SynchronizedList.java +++ b/src/java/org/apache/commons/collections/list/SynchronizedList.java @@ -35,7 +35,7 @@ import org.apache.commons.collections.collection.SynchronizedCollection; * * @author Stephen Colebourne */ -public class SynchronizedList extends SynchronizedCollection implements List { +public class SynchronizedList extends SynchronizedCollection implements List { /** Serialization version */ private static final long serialVersionUID = -1403835447328619437L; @@ -46,8 +46,8 @@ public class SynchronizedList extends SynchronizedCollection implements List { * @param list the list to decorate, must not be null * @throws IllegalArgumentException if list is null */ - public static List decorate(List list) { - return new SynchronizedList(list); + public static List decorate(List list) { + return new SynchronizedList(list); } //----------------------------------------------------------------------- @@ -57,7 +57,7 @@ public class SynchronizedList extends SynchronizedCollection implements List { * @param list the list to decorate, must not be null * @throws IllegalArgumentException if list is null */ - protected SynchronizedList(List list) { + protected SynchronizedList(List list) { super(list); } @@ -68,7 +68,7 @@ public class SynchronizedList extends SynchronizedCollection implements List { * @param lock the lock to use, must not be null * @throws IllegalArgumentException if list is null */ - protected SynchronizedList(List list, Object lock) { + protected SynchronizedList(List list, Object lock) { super(list, lock); } @@ -77,24 +77,24 @@ public class SynchronizedList extends SynchronizedCollection implements List { * * @return the decorated list */ - protected List getList() { - return (List) collection; + protected List getList() { + return (List) collection; } //----------------------------------------------------------------------- - public void add(int index, Object object) { + public void add(int index, E object) { synchronized (lock) { getList().add(index, object); } } - public boolean addAll(int index, Collection coll) { + public boolean addAll(int index, Collection coll) { synchronized (lock) { return getList().addAll(index, coll); } } - public Object get(int index) { + public E get(int index) { synchronized (lock) { return getList().get(index); } @@ -122,7 +122,7 @@ public class SynchronizedList extends SynchronizedCollection implements List { * * @return an iterator that must be manually synchronized on the collection */ - public ListIterator listIterator() { + public ListIterator listIterator() { return getList().listIterator(); } @@ -136,28 +136,28 @@ public class SynchronizedList extends SynchronizedCollection implements List { * * @return an iterator that must be manually synchronized on the collection */ - public ListIterator listIterator(int index) { + public ListIterator listIterator(int index) { return getList().listIterator(index); } - public Object remove(int index) { + public E remove(int index) { synchronized (lock) { return getList().remove(index); } } - public Object set(int index, Object object) { + public E set(int index, E object) { synchronized (lock) { return getList().set(index, object); } } - public List subList(int fromIndex, int toIndex) { + public List subList(int fromIndex, int toIndex) { synchronized (lock) { - List list = getList().subList(fromIndex, toIndex); + List list = getList().subList(fromIndex, toIndex); // the lock is passed into the constructor here to ensure that the sublist is // synchronized on the same lock as the parent list - return new SynchronizedList(list, lock); + return new SynchronizedList(list, lock); } }