Author: tn Date: Sun Mar 17 18:39:57 2013 New Revision: 1457511 URL: http://svn.apache.org/r1457511 Log: [COLLECTIONS-351] Removed Synchronized[List, Set, SortedSet] and replaced with calls to Collections.synchronizedXXX.
Removed: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/SynchronizedList.java commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/set/SynchronizedSet.java commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/set/SynchronizedSortedSet.java commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/list/SynchronizedListTest.java commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/SynchronizedSetTest.java commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/set/SynchronizedSortedSetTest.java commons/proper/collections/trunk/src/test/resources/data/test/SynchronizedList.emptyCollection.version3.1.obj commons/proper/collections/trunk/src/test/resources/data/test/SynchronizedList.fullCollection.version3.1.obj commons/proper/collections/trunk/src/test/resources/data/test/SynchronizedSet.emptyCollection.version3.1.obj commons/proper/collections/trunk/src/test/resources/data/test/SynchronizedSet.fullCollection.version3.1.obj commons/proper/collections/trunk/src/test/resources/data/test/SynchronizedSortedSet.emptyCollection.version3.1.obj commons/proper/collections/trunk/src/test/resources/data/test/SynchronizedSortedSet.fullCollection.version3.1.obj Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/ListUtils.java commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/SetUtils.java commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/package-info.java commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/set/package-info.java commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/SynchronizedTrie.java Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/ListUtils.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/ListUtils.java?rev=1457511&r1=1457510&r2=1457511&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/ListUtils.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/ListUtils.java Sun Mar 17 18:39:57 2013 @@ -28,7 +28,6 @@ import org.apache.commons.collections.ba import org.apache.commons.collections.list.FixedSizeList; import org.apache.commons.collections.list.LazyList; import org.apache.commons.collections.list.PredicatedList; -import org.apache.commons.collections.list.SynchronizedList; import org.apache.commons.collections.list.TransformedList; import org.apache.commons.collections.list.UnmodifiableList; @@ -353,7 +352,7 @@ public class ListUtils { /** * Returns a synchronized list backed by the given list. * <p> - * You must manually synchronize on the returned buffer's iterator to + * You must manually synchronize on the returned list's iterator to * avoid non-deterministic behavior: * * <pre> @@ -366,7 +365,7 @@ public class ListUtils { * } * </pre> * - * This method uses the implementation in the decorators subpackage. + * This method is just a wrapper for {@link Collections#synchronizedList(List)}. * * @param <E> the element type * @param list the list to synchronize, must not be null @@ -374,7 +373,7 @@ public class ListUtils { * @throws IllegalArgumentException if the list is null */ public static <E> List<E> synchronizedList(final List<E> list) { - return SynchronizedList.synchronizedList(list); + return Collections.synchronizedList(list); } /** Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/SetUtils.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/SetUtils.java?rev=1457511&r1=1457510&r2=1457511&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/SetUtils.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/SetUtils.java Sun Mar 17 18:39:57 2013 @@ -25,8 +25,6 @@ import java.util.TreeSet; import org.apache.commons.collections.set.ListOrderedSet; import org.apache.commons.collections.set.PredicatedSet; import org.apache.commons.collections.set.PredicatedSortedSet; -import org.apache.commons.collections.set.SynchronizedSet; -import org.apache.commons.collections.set.SynchronizedSortedSet; import org.apache.commons.collections.set.TransformedSet; import org.apache.commons.collections.set.TransformedSortedSet; import org.apache.commons.collections.set.UnmodifiableSet; @@ -163,7 +161,7 @@ public class SetUtils { /** * Returns a synchronized set backed by the given set. * <p> - * You must manually synchronize on the returned buffer's iterator to + * You must manually synchronize on the returned set's iterator to * avoid non-deterministic behavior: * * <pre> @@ -176,7 +174,7 @@ public class SetUtils { * } * </pre> * - * This method uses the implementation in the decorators subpackage. + * This method is just a wrapper for {@link Collections#synchronizedSet(Set)}. * * @param <E> the element type * @param set the set to synchronize, must not be null @@ -184,7 +182,7 @@ public class SetUtils { * @throws IllegalArgumentException if the set is null */ public static <E> Set<E> synchronizedSet(final Set<E> set) { - return SynchronizedSet.synchronizedSet(set); + return Collections.synchronizedSet(set); } /** @@ -259,7 +257,7 @@ public class SetUtils { /** * Returns a synchronized sorted set backed by the given sorted set. * <p> - * You must manually synchronize on the returned buffer's iterator to + * You must manually synchronize on the returned set's iterator to * avoid non-deterministic behavior: * * <pre> @@ -272,7 +270,7 @@ public class SetUtils { * } * </pre> * - * This method uses the implementation in the decorators subpackage. + * This method is just a wrapper for {@link Collections#synchronizedSortedSet(SortedSet)}. * * @param <E> the element type * @param set the sorted set to synchronize, must not be null @@ -280,7 +278,7 @@ public class SetUtils { * @throws IllegalArgumentException if the set is null */ public static <E> SortedSet<E> synchronizedSortedSet(final SortedSet<E> set) { - return SynchronizedSortedSet.synchronizedSortedSet(set); + return Collections.synchronizedSortedSet(set); } /** Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/package-info.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/package-info.java?rev=1457511&r1=1457510&r2=1457511&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/package-info.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/list/package-info.java Sun Mar 17 18:39:57 2013 @@ -26,7 +26,6 @@ * <p> * The following decorators are provided in the package: * <ul> - * <li>Synchronized - synchronizes method access for multi-threaded environments</li> * <li>Unmodifiable - ensures the collection cannot be altered</li> * <li>Predicated - ensures that only elements that are valid according to a predicate can be added</li> * <li>Transformed - transforms each element added</li> Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/set/package-info.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/set/package-info.java?rev=1457511&r1=1457510&r2=1457511&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/set/package-info.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/set/package-info.java Sun Mar 17 18:39:57 2013 @@ -28,7 +28,6 @@ * </ul> * The following decorators are provided in the package: * <ul> - * <li>Synchronized - synchronizes method access for multi-threaded environments * <li>Unmodifiable - ensures the collection cannot be altered * <li>Predicated - ensures that only elements that are valid according to a predicate can be added * <li>Transformed - transforms each element added Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/SynchronizedTrie.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/SynchronizedTrie.java?rev=1457511&r1=1457510&r2=1457511&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/SynchronizedTrie.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/SynchronizedTrie.java Sun Mar 17 18:39:57 2013 @@ -26,7 +26,6 @@ import java.util.SortedMap; import org.apache.commons.collections.Trie; import org.apache.commons.collections.collection.SynchronizedCollection; -import org.apache.commons.collections.set.SynchronizedSet; /** * A synchronized {@link Trie}. @@ -88,11 +87,11 @@ public class SynchronizedTrie<K, V> impl } public synchronized Set<Entry<K, V>> entrySet() { - return SynchronizedSet.synchronizedSet(delegate.entrySet()); + return Collections.synchronizedSet(delegate.entrySet()); } public synchronized Set<K> keySet() { - return SynchronizedSet.synchronizedSet(delegate.keySet()); + return Collections.synchronizedSet(delegate.keySet()); } public synchronized Collection<V> values() {