You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2009/09/11 23:48:30 UTC
svn commit: r814044 - in
/commons/proper/collections/branches/collections_jdk5_branch/src:
java/org/apache/commons/collections/
java/org/apache/commons/collections/comparators/
java/org/apache/commons/collections/iterators/
java/org/apache/commons/coll...
Author: sebb
Date: Fri Sep 11 21:48:16 2009
New Revision: 814044
URL: http://svn.apache.org/viewvc?rev=814044&view=rev
Log:
Tab police
Modified:
commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/CollectionUtils.java
commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/PredicateUtils.java
commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/comparators/NullComparator.java
commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ArrayIterator.java
commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ArrayListIterator.java
commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ObjectArrayListIterator.java
commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ObjectGraphIterator.java
commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/SingletonIterator.java
commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/map/CompositeMap.java
commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/map/LazyMap.java
commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/map/LazySortedMap.java
commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/MockTestCase.java
commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestAllPackages.java
commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestCollectionUtils.java
commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestIteratorUtils.java
commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/comparators/AbstractTestComparator.java
commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/comparators/TestNullComparator.java
commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/iterators/TestSingletonListIterator.java
commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/list/TestTreeList.java
commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/map/TestAll.java
commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/map/TestLazyMap.java
commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/map/TestLazySortedMap.java
commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/splitmap/TestAll.java
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/CollectionUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/CollectionUtils.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/CollectionUtils.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/CollectionUtils.java Fri Sep 11 21:48:16 2009
@@ -128,7 +128,7 @@
* undesirable. This implementation only implements Collection.
*/
@SuppressWarnings("unchecked")
- public static final Collection EMPTY_COLLECTION = UnmodifiableCollection.decorate(new ArrayList<Object>());
+ public static final Collection EMPTY_COLLECTION = UnmodifiableCollection.decorate(new ArrayList<Object>());
/**
* <code>CollectionUtils</code> should not normally be instantiated.
@@ -845,7 +845,7 @@
*/
public static <T> T get(Iterator<T> iterator, int index) {
int i = index;
- checkIndexBounds(i);
+ checkIndexBounds(i);
while (iterator.hasNext()) {
i--;
if (i == -1) {
@@ -919,7 +919,7 @@
*/
public static Object get(Object object, int index) {
int i = index;
- if (i < 0) {
+ if (i < 0) {
throw new IndexOutOfBoundsException("Index cannot be negative: " + i);
}
if (object instanceof Map) {
@@ -935,7 +935,7 @@
if (i == -1) {
return it.next();
}
- it.next();
+ it.next();
}
throw new IndexOutOfBoundsException("Entry does not exist: " + i);
} else if (object instanceof Collection) {
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/PredicateUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/PredicateUtils.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/PredicateUtils.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/PredicateUtils.java Fri Sep 11 21:48:16 2009
@@ -538,7 +538,7 @@
* @param predicate the predicate to call with the result of the transform
* @return the predicate
* @throws IllegalArgumentException if the transformer or the predicate is null
- * @since Commons Collections 3.1
+ * @since Commons Collections 3.1
*/
public static <T> Predicate<T> transformedPredicate(
Transformer<? super T, ? extends T> transformer, Predicate<? super T> predicate) {
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/comparators/NullComparator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/comparators/NullComparator.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/comparators/NullComparator.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/comparators/NullComparator.java Fri Sep 11 21:48:16 2009
@@ -172,7 +172,7 @@
if(!obj.getClass().equals(this.getClass())) { return false; }
NullComparator<?> other = (NullComparator<?>) obj;
-
+
return ((this.nullsAreHigh == other.nullsAreHigh) &&
(this.nonNullComparator.equals(other.nonNullComparator)));
}
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ArrayIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ArrayIterator.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ArrayIterator.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ArrayIterator.java Fri Sep 11 21:48:16 2009
@@ -48,9 +48,9 @@
/** The start index to loop from */
protected int startIndex = 0;
/** The end index to loop to */
- protected int endIndex = 0;
+ protected int endIndex = 0;
/** The current iterator index */
- protected int index = 0;
+ protected int index = 0;
// Constructors
// ----------------------------------------------------------------------
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ArrayListIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ArrayListIterator.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ArrayListIterator.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ArrayListIterator.java Fri Sep 11 21:48:16 2009
@@ -45,7 +45,7 @@
* @author Phil Steitz
*/
public class ArrayListIterator<E> extends ArrayIterator<E>
- implements ListIterator<E>, ResettableListIterator<E> {
+ implements ListIterator<E>, ResettableListIterator<E> {
/**
* Holds the index of the last item returned by a call to <code>next()</code>
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ObjectArrayListIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ObjectArrayListIterator.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ObjectArrayListIterator.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ObjectArrayListIterator.java Fri Sep 11 21:48:16 2009
@@ -42,7 +42,7 @@
* @author Phil Steitz
*/
public class ObjectArrayListIterator<E> extends ObjectArrayIterator<E>
- implements ListIterator<E>, ResettableListIterator<E> {
+ implements ListIterator<E>, ResettableListIterator<E> {
/**
* Holds the index of the last item returned by a call to <code>next()</code>
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ObjectGraphIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ObjectGraphIterator.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ObjectGraphIterator.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/ObjectGraphIterator.java Fri Sep 11 21:48:16 2009
@@ -79,7 +79,7 @@
/** The stack of iterators */
protected final ArrayStack<Iterator<? extends E>> stack = new ArrayStack<Iterator<? extends E>>(8);
- /** The root object in the tree */
+ /** The root object in the tree */
protected E root;
/** The transformer to use */
protected Transformer<? super E, ? extends E> transformer;
@@ -198,7 +198,7 @@
// all iterators exhausted
} else {
// current iterator exhausted, go up a level
- currentIterator = (Iterator<? extends E>) stack.pop();
+ currentIterator = stack.pop();
findNextByIterator(currentIterator);
}
}
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/SingletonIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/SingletonIterator.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/SingletonIterator.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/iterators/SingletonIterator.java Fri Sep 11 21:48:16 2009
@@ -33,7 +33,7 @@
* @author Rodney Waldhoff
*/
public class SingletonIterator<E>
- implements Iterator<E>, ResettableIterator<E> {
+ implements Iterator<E>, ResettableIterator<E> {
/** Whether remove is allowed */
private final boolean removeAllowed;
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/map/CompositeMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/map/CompositeMap.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/map/CompositeMap.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/map/CompositeMap.java Fri Sep 11 21:48:16 2009
@@ -188,7 +188,7 @@
* key.
*
* @throws ClassCastException if the key is of an inappropriate type for
- * this map (optional).
+ * this map (optional).
* @throws NullPointerException if the key is <tt>null</tt> and this map
* does not not permit <tt>null</tt> keys (optional).
*/
@@ -213,7 +213,7 @@
* @return <tt>true</tt> if this map maps one or more keys to the
* specified value.
* @throws ClassCastException if the value is of an inappropriate type for
- * this map (optional).
+ * this map (optional).
* @throws NullPointerException if the value is <tt>null</tt> and this map
* does not not permit <tt>null</tt> values (optional).
*/
@@ -246,7 +246,7 @@
public Set<Map.Entry<K, V>> entrySet() {
CompositeSet<Map.Entry<K, V>> entries = new CompositeSet<Map.Entry<K,V>>();
for (int i = composite.length - 1; i >= 0; --i) {
- entries.addComposited((Collection<Map.Entry<K, V>>) composite[i].entrySet());
+ entries.addComposited(composite[i].entrySet());
}
return entries;
}
@@ -266,12 +266,12 @@
*
* @param key key whose associated value is to be returned.
* @return the value to which this map maps the specified key, or
- * <tt>null</tt> if the map contains no mapping for this key.
+ * <tt>null</tt> if the map contains no mapping for this key.
*
* @throws ClassCastException if the key is of an inappropriate type for
- * this map (optional).
+ * this map (optional).
* @throws NullPointerException key is <tt>null</tt> and this map does not
- * not permit <tt>null</tt> keys (optional).
+ * not permit <tt>null</tt> keys (optional).
*
* @see #containsKey(Object)
*/
@@ -332,16 +332,16 @@
* @param key key with which the specified value is to be associated.
* @param value value to be associated with the specified key.
* @return previous value associated with specified key, or <tt>null</tt>
- * if there was no mapping for key. A <tt>null</tt> return can
- * also indicate that the map previously associated <tt>null</tt>
- * with the specified key, if the implementation supports
- * <tt>null</tt> values.
+ * if there was no mapping for key. A <tt>null</tt> return can
+ * also indicate that the map previously associated <tt>null</tt>
+ * with the specified key, if the implementation supports
+ * <tt>null</tt> values.
*
* @throws UnsupportedOperationException if no MapMutator has been specified
* @throws ClassCastException if the class of the specified key or value
- * prevents it from being stored in this map.
+ * prevents it from being stored in this map.
* @throws IllegalArgumentException if some aspect of this key or value
- * prevents it from being stored in this map.
+ * prevents it from being stored in this map.
* @throws NullPointerException this map does not permit <tt>null</tt>
* keys or values, and the specified key or value is
* <tt>null</tt>.
@@ -364,13 +364,13 @@
* @param map Mappings to be stored in this map.
*
* @throws UnsupportedOperationException if the <tt>putAll</tt> method is
- * not supported by this map.
+ * not supported by this map.
*
* @throws ClassCastException if the class of a key or value in the
- * specified map prevents it from being stored in this map.
+ * specified map prevents it from being stored in this map.
*
* @throws IllegalArgumentException some aspect of a key or value in the
- * specified map prevents it from being stored in this map.
+ * specified map prevents it from being stored in this map.
* @throws NullPointerException the specified map is <tt>null</tt>, or if
* this map does not permit <tt>null</tt> keys or values, and the
* specified map contains <tt>null</tt> keys or values.
@@ -398,10 +398,10 @@
*
* @param key key whose mapping is to be removed from the map.
* @return previous value associated with specified key, or <tt>null</tt>
- * if there was no mapping for key.
+ * if there was no mapping for key.
*
* @throws ClassCastException if the key is of an inappropriate type for
- * the composited map (optional).
+ * the composited map (optional).
* @throws NullPointerException if the key is <tt>null</tt> and the composited map
* does not not permit <tt>null</tt> keys (optional).
* @throws UnsupportedOperationException if the <tt>remove</tt> method is
@@ -447,7 +447,7 @@
public Collection<V> values() {
CompositeCollection<V> values = new CompositeCollection<V>();
for (int i = composite.length - 1; i >= 0; --i) {
- values.addComposited((Collection<V>) composite[i].values());
+ values.addComposited(composite[i].values());
}
return values;
}
@@ -505,16 +505,16 @@
* @param key key with which the specified value is to be associated.
* @param value value to be associated with the specified key.
* @return previous value associated with specified key, or <tt>null</tt>
- * if there was no mapping for key. A <tt>null</tt> return can
- * also indicate that the map previously associated <tt>null</tt>
- * with the specified key, if the implementation supports
- * <tt>null</tt> values.
+ * if there was no mapping for key. A <tt>null</tt> return can
+ * also indicate that the map previously associated <tt>null</tt>
+ * with the specified key, if the implementation supports
+ * <tt>null</tt> values.
*
* @throws UnsupportedOperationException if not defined
* @throws ClassCastException if the class of the specified key or value
- * prevents it from being stored in this map.
+ * prevents it from being stored in this map.
* @throws IllegalArgumentException if some aspect of this key or value
- * prevents it from being stored in this map.
+ * prevents it from being stored in this map.
* @throws NullPointerException this map does not permit <tt>null</tt>
* keys or values, and the specified key or value is
* <tt>null</tt>.
@@ -530,9 +530,9 @@
*
* @throws UnsupportedOperationException if not defined
* @throws ClassCastException if the class of the specified key or value
- * prevents it from being stored in this map.
+ * prevents it from being stored in this map.
* @throws IllegalArgumentException if some aspect of this key or value
- * prevents it from being stored in this map.
+ * prevents it from being stored in this map.
* @throws NullPointerException this map does not permit <tt>null</tt>
* keys or values, and the specified key or value is
* <tt>null</tt>.
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/map/LazyMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/map/LazyMap.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/map/LazyMap.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/map/LazyMap.java Fri Sep 11 21:48:16 2009
@@ -91,8 +91,8 @@
* @throws IllegalArgumentException if map or factory is null
*/
public static <K, V> LazyMap<K, V> getLazyMap(Map<K, V> map, Factory< ? extends V> factory) {
- return new LazyMap<K,V>(map, factory);
- }
+ return new LazyMap<K,V>(map, factory);
+ }
/**
* Factory method to create a lazily instantiated map.
@@ -102,21 +102,21 @@
* @throws IllegalArgumentException if map or factory is null
* @deprecated use {@link #getLazyMap(Map, Transformer)} instead.
*/
- @Deprecated
+ @Deprecated
public static <K,V> Map<K,V> decorate(Map<K,V> map, Transformer<? super K, ? extends V> factory) {
return getLazyMap(map, factory);
}
- /**
+ /**
* Factory method to create a lazily instantiated map.
*
* @param map the map to decorate, must not be null
* @param factory the factory to use, must not be null
* @throws IllegalArgumentException if map or factory is null
*/
- public static <V, K> LazyMap<K, V> getLazyMap(Map<K, V> map, Transformer<? super K, ? extends V> factory) {
- return new LazyMap<K,V>(map, factory);
- }
+ public static <V, K> LazyMap<K, V> getLazyMap(Map<K, V> map, Transformer<? super K, ? extends V> factory) {
+ return new LazyMap<K,V>(map, factory);
+ }
//-----------------------------------------------------------------------
/**
@@ -171,17 +171,17 @@
* @since Commons Collections 3.1
*/
@SuppressWarnings("unchecked")
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
+ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
map = (Map) in.readObject();
}
//-----------------------------------------------------------------------
@Override
- public V get(Object key) {
+ public V get(Object key) {
// create value for key if key is not currently in the map
if (map.containsKey(key) == false) {
- K castKey = cast(key);
+ K castKey = cast(key);
V value = factory.transform(castKey);
map.put(castKey, value);
return value;
@@ -195,10 +195,10 @@
* @param key .
* @return the cast key.
*/
- @SuppressWarnings("unchecked")
- private K cast(Object key) {
- return (K) key;
- }
+ @SuppressWarnings("unchecked")
+ private K cast(Object key) {
+ return (K) key;
+ }
// no need to wrap keySet, entrySet or values as they are views of
// existing map entries - you can't do a map-style get on them.
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/map/LazySortedMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/map/LazySortedMap.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/map/LazySortedMap.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/java/org/apache/commons/collections/map/LazySortedMap.java Fri Sep 11 21:48:16 2009
@@ -85,19 +85,19 @@
* @param factory the factory to use, must not be null
* @throws IllegalArgumentException if map or factory is null
*/
- public static <K, V> SortedMap<K, V> getLazySortedMap(SortedMap<K, V> map, Factory<? extends V> factory) {
- return new LazySortedMap<K,V>(map, factory);
- }
-
- /**
- * Factory method to create a lazily instantiated sorted map.
- *
- * @param map the map to decorate, must not be null
- * @param factory the factory to use, must not be null
- * @throws IllegalArgumentException if map or factory is null
- * @deprecated
- */
- @Deprecated
+ public static <K, V> SortedMap<K, V> getLazySortedMap(SortedMap<K, V> map, Factory<? extends V> factory) {
+ return new LazySortedMap<K,V>(map, factory);
+ }
+
+ /**
+ * Factory method to create a lazily instantiated sorted map.
+ *
+ * @param map the map to decorate, must not be null
+ * @param factory the factory to use, must not be null
+ * @throws IllegalArgumentException if map or factory is null
+ * @deprecated
+ */
+ @Deprecated
public static <K,V> SortedMap<K,V> decorate(SortedMap<K,V> map, Transformer<? super K, ? extends V> factory) {
return getLazySortedMap(map, factory);
}
@@ -109,9 +109,9 @@
* @param factory the factory to use, must not be null
* @throws IllegalArgumentException if map or factory is null
*/
- public static <K, V> SortedMap<K, V> getLazySortedMap(SortedMap<K, V> map, Transformer<? super K, ? extends V> factory) {
- return new LazySortedMap<K,V>(map, factory);
- }
+ public static <K, V> SortedMap<K, V> getLazySortedMap(SortedMap<K, V> map, Transformer<? super K, ? extends V> factory) {
+ return new LazySortedMap<K,V>(map, factory);
+ }
//-----------------------------------------------------------------------
/**
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/MockTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/MockTestCase.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/MockTestCase.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/MockTestCase.java Fri Sep 11 21:48:16 2009
@@ -31,37 +31,37 @@
* @author Stephen Kestle
*/
public abstract class MockTestCase {
- private List<Object> mockObjects = new ArrayList<Object>();
+ private List<Object> mockObjects = new ArrayList<Object>();
- @SuppressWarnings("unchecked")
- protected <T> T createMock(Class name) {
- T mock = (T) EasyMock.createMock(name);
- return registerMock(mock);
- }
+ @SuppressWarnings("unchecked")
+ protected <T> T createMock(Class name) {
+ T mock = (T) EasyMock.createMock(name);
+ return registerMock(mock);
+ }
- private <T> T registerMock(T mock) {
- mockObjects.add(mock);
- return mock;
- }
+ private <T> T registerMock(T mock) {
+ mockObjects.add(mock);
+ return mock;
+ }
- protected <T> IExpectationSetters<T> expect(T t) {
- return EasyMock.expect(t);
- }
+ protected <T> IExpectationSetters<T> expect(T t) {
+ return EasyMock.expect(t);
+ }
- protected final void replay() {
- for (Object o : mockObjects) {
- EasyMock.replay(o);
- }
- }
+ protected final void replay() {
+ for (Object o : mockObjects) {
+ EasyMock.replay(o);
+ }
+ }
- protected final void verify() {
- for (ListIterator<Object> i = mockObjects.listIterator(); i.hasNext();) {
- try {
- EasyMock.verify(i.next());
- } catch (AssertionError e) {
- throw new AssertionError((i.previousIndex() + 1) + ""
- + e.getMessage());
- }
- }
- }
+ protected final void verify() {
+ for (ListIterator<Object> i = mockObjects.listIterator(); i.hasNext();) {
+ try {
+ EasyMock.verify(i.next());
+ } catch (AssertionError e) {
+ throw new AssertionError((i.previousIndex() + 1) + ""
+ + e.getMessage());
+ }
+ }
+ }
}
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestAllPackages.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestAllPackages.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestAllPackages.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestAllPackages.java Fri Sep 11 21:48:16 2009
@@ -30,7 +30,7 @@
*/
@RunWith(Suite.class)
@SuiteClasses({
- org.apache.commons.collections.TestAll.class,
+ org.apache.commons.collections.TestAll.class,
org.apache.commons.collections.bag.TestAll.class,
org.apache.commons.collections.bidimap.TestAll.class,
org.apache.commons.collections.buffer.TestAll.class,
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestCollectionUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestCollectionUtils.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestCollectionUtils.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestCollectionUtils.java Fri Sep 11 21:48:16 2009
@@ -875,7 +875,7 @@
//Up to here
@SuppressWarnings("cast")
- @Test
+ @Test
public void filter() {
List<Integer> ints = new ArrayList<Integer>();
ints.add(1);
@@ -1396,10 +1396,10 @@
}
/**
- * TODO: Should {@link CollectionUtils} be able to be extended? If it is extended, subclasses must 'override' the static methods with
- * call-throughs anyhow, otherwise java compiler warnings will result
- */
- @Test
+ * TODO: Should {@link CollectionUtils} be able to be extended? If it is extended, subclasses must 'override' the static methods with
+ * call-throughs anyhow, otherwise java compiler warnings will result
+ */
+ @Test
public void ensureCollectionUtilsCanBeExtended() {
new CollectionUtils() {};
}
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestIteratorUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestIteratorUtils.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestIteratorUtils.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/TestIteratorUtils.java Fri Sep 11 21:48:16 2009
@@ -566,9 +566,9 @@
}
//-----------------------------------------------------------------------
- /**
- * Test next() and hasNext() for an immutable Iterator.
- */
+ /**
+ * Test next() and hasNext() for an immutable Iterator.
+ */
public void testUnmodifiableIteratorIteration() {
Iterator<String> iterator = getImmutableIterator();
@@ -672,7 +672,7 @@
* Test remove() for an immutable ListIterator.
*/
public void testUnmodifiableListIteratorImmutability() {
- ListIterator<String> listIterator = getImmutableListIterator();
+ ListIterator<String> listIterator = getImmutableListIterator();
try {
listIterator.remove();
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/comparators/AbstractTestComparator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/comparators/AbstractTestComparator.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/comparators/AbstractTestComparator.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/comparators/AbstractTestComparator.java Fri Sep 11 21:48:16 2009
@@ -192,15 +192,15 @@
// test to make sure the canonical form has been preserved
try {
comparator = (Comparator<T>) readExternalFormFromDisk(getCanonicalComparatorName(makeObject()));
- } catch (FileNotFoundException exception) {
+ } catch (FileNotFoundException exception) {
boolean autoCreateSerialized = false;
- if (autoCreateSerialized) {
- comparator = makeObject();
- String fileName = getCanonicalComparatorName(comparator);
- writeExternalFormToDisk((Serializable) comparator, fileName);
- fail("Serialized form could not be found. A serialized version "
+ if (autoCreateSerialized) {
+ comparator = makeObject();
+ String fileName = getCanonicalComparatorName(comparator);
+ writeExternalFormToDisk((Serializable) comparator, fileName);
+ fail("Serialized form could not be found. A serialized version "
+ "has now been written (and should be added to CVS): " + fileName);
} else {
fail("The Serialized form could be located to test serialization "
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/comparators/TestNullComparator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/comparators/TestNullComparator.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/comparators/TestNullComparator.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/comparators/TestNullComparator.java Fri Sep 11 21:48:16 2009
@@ -48,28 +48,28 @@
**/
public static class TestNullComparator1 extends TestNullComparator {
- public TestNullComparator1(String testName) {
- super(testName);
- }
+ public TestNullComparator1(String testName) {
+ super(testName);
+ }
public Comparator<Integer> makeObject() {
- return new NullComparator<Integer>();
- }
+ return new NullComparator<Integer>();
+ }
public List<Integer> getComparableObjectsOrdered() {
List<Integer> list = new LinkedList<Integer>();
- list.add(new Integer(1));
- list.add(new Integer(2));
- list.add(new Integer(3));
- list.add(new Integer(4));
- list.add(new Integer(5));
- list.add(null);
- return list;
- }
-
- public String getCanonicalComparatorName(Object object) {
- return super.getCanonicalComparatorName(object) + "1";
- }
+ list.add(new Integer(1));
+ list.add(new Integer(2));
+ list.add(new Integer(3));
+ list.add(new Integer(4));
+ list.add(new Integer(5));
+ list.add(null);
+ return list;
+ }
+
+ public String getCanonicalComparatorName(Object object) {
+ return super.getCanonicalComparatorName(object) + "1";
+ }
}
/**
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/iterators/TestSingletonListIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/iterators/TestSingletonListIterator.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/iterators/TestSingletonListIterator.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/iterators/TestSingletonListIterator.java Fri Sep 11 21:48:16 2009
@@ -103,12 +103,12 @@
assertEquals( "Iteration next index", 1, iter.nextIndex() );
assertEquals( "Iteration previous index", 0, iter.previousIndex() );
- try {
- iter.next();
- } catch (Exception e) {
- assertTrue("NoSuchElementException must be thrown",
- e.getClass().equals((new NoSuchElementException()).getClass()));
- }
+ try {
+ iter.next();
+ } catch (Exception e) {
+ assertTrue("NoSuchElementException must be thrown",
+ e.getClass().equals((new NoSuchElementException()).getClass()));
+ }
iter.previous();
try {
iter.previous();
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/list/TestTreeList.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/list/TestTreeList.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/list/TestTreeList.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/list/TestTreeList.java Fri Sep 11 21:48:16 2009
@@ -33,9 +33,9 @@
*/
public class TestTreeList<E> extends AbstractTestList<E> {
- public TestTreeList(String name) {
- super(name);
- }
+ public TestTreeList(String name) {
+ super(name);
+ }
public static void main(String[] args) {
junit.textui.TestRunner.run(suite());
@@ -105,29 +105,29 @@
}
//-----------------------------------------------------------------------
- public TreeList<E> makeObject() {
- return new TreeList<E>();
- }
+ public TreeList<E> makeObject() {
+ return new TreeList<E>();
+ }
//-----------------------------------------------------------------------
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("unchecked")
public void testAddMultiple() {
- List<E> l = makeObject();
- l.add((E) "hugo");
- l.add((E) "erna");
- l.add((E) "daniel");
- l.add((E) "andres");
- l.add((E) "harald");
- l.add(0, null);
- assertEquals(null, l.get(0));
- assertEquals("hugo", l.get(1));
- assertEquals("erna", l.get(2));
- assertEquals("daniel", l.get(3));
- assertEquals("andres", l.get(4));
- assertEquals("harald", l.get(5));
- }
+ List<E> l = makeObject();
+ l.add((E) "hugo");
+ l.add((E) "erna");
+ l.add((E) "daniel");
+ l.add((E) "andres");
+ l.add((E) "harald");
+ l.add(0, null);
+ assertEquals(null, l.get(0));
+ assertEquals("hugo", l.get(1));
+ assertEquals("erna", l.get(2));
+ assertEquals("daniel", l.get(3));
+ assertEquals("andres", l.get(4));
+ assertEquals("harald", l.get(5));
+ }
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("unchecked")
public void testRemove() {
List<E> l = makeObject();
l.add((E) "hugo");
@@ -136,44 +136,44 @@
l.add((E) "andres");
l.add((E) "harald");
l.add(0, null);
- int i = 0;
- assertEquals(null, l.get(i++));
- assertEquals("hugo", l.get(i++));
- assertEquals("erna", l.get(i++));
- assertEquals("daniel", l.get(i++));
- assertEquals("andres", l.get(i++));
- assertEquals("harald", l.get(i++));
-
- l.remove(0);
- i = 0;
- assertEquals("hugo", l.get(i++));
- assertEquals("erna", l.get(i++));
- assertEquals("daniel", l.get(i++));
- assertEquals("andres", l.get(i++));
- assertEquals("harald", l.get(i++));
-
- i = 0;
- l.remove(1);
- assertEquals("hugo", l.get(i++));
- assertEquals("daniel", l.get(i++));
- assertEquals("andres", l.get(i++));
- assertEquals("harald", l.get(i++));
-
- i = 0;
- l.remove(2);
- assertEquals("hugo", l.get(i++));
- assertEquals("daniel", l.get(i++));
- assertEquals("harald", l.get(i++));
- }
+ int i = 0;
+ assertEquals(null, l.get(i++));
+ assertEquals("hugo", l.get(i++));
+ assertEquals("erna", l.get(i++));
+ assertEquals("daniel", l.get(i++));
+ assertEquals("andres", l.get(i++));
+ assertEquals("harald", l.get(i++));
+
+ l.remove(0);
+ i = 0;
+ assertEquals("hugo", l.get(i++));
+ assertEquals("erna", l.get(i++));
+ assertEquals("daniel", l.get(i++));
+ assertEquals("andres", l.get(i++));
+ assertEquals("harald", l.get(i++));
+
+ i = 0;
+ l.remove(1);
+ assertEquals("hugo", l.get(i++));
+ assertEquals("daniel", l.get(i++));
+ assertEquals("andres", l.get(i++));
+ assertEquals("harald", l.get(i++));
+
+ i = 0;
+ l.remove(2);
+ assertEquals("hugo", l.get(i++));
+ assertEquals("daniel", l.get(i++));
+ assertEquals("harald", l.get(i++));
+ }
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("unchecked")
public void testInsertBefore() {
List<E> l = makeObject();
l.add((E) "erna");
l.add(0, (E) "hugo");
- assertEquals("hugo", l.get(0));
- assertEquals("erna", l.get(1));
- }
+ assertEquals("hugo", l.get(0));
+ assertEquals("erna", l.get(1));
+ }
@SuppressWarnings("unchecked")
public void testIndexOf() {
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/map/TestAll.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/map/TestAll.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/map/TestAll.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/map/TestAll.java Fri Sep 11 21:48:16 2009
@@ -33,7 +33,7 @@
*/
@RunWith(Suite.class)
@SuiteClasses({
- TestCaseInsensitiveMap.class,
+ TestCaseInsensitiveMap.class,
TestCompositeMap.class,
TestDefaultedMap.class,
TestFlat3Map.class,
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/map/TestLazyMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/map/TestLazyMap.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/map/TestLazyMap.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/map/TestLazyMap.java Fri Sep 11 21:48:16 2009
@@ -37,7 +37,7 @@
*/
public class TestLazyMap<K, V> extends AbstractTestIterableMap<K, V> {
- private static final Factory<Integer> oneFactory = FactoryUtils.constantFactory(1);
+ private static final Factory<Integer> oneFactory = FactoryUtils.constantFactory(1);
public TestLazyMap(String testName) {
super(testName);
@@ -49,14 +49,14 @@
}
@Override
- public LazyMap<K,V> makeObject() {
+ public LazyMap<K,V> makeObject() {
return getLazyMap(new HashMap<K,V>(), FactoryUtils.<V>nullFactory());
}
//-----------------------------------------------------------------------
@Override
public void testMapGet() {
- //TODO eliminate need for this via superclass - see svn history.
+ //TODO eliminate need for this via superclass - see svn history.
}
@Test
@@ -79,21 +79,21 @@
@Test
public void mapGetWithTransformer() {
- Transformer<Number, Integer> intConverter = new Transformer<Number, Integer>(){
- public Integer transform(Number input) {
- return input.intValue();
- }
- };
- Map<Long, Number> map = getLazyMap(new HashMap<Long,Number>(), intConverter );
- assertEquals(0, map.size());
- Number i1 = map.get(123L);
- assertEquals(123, i1);
- assertEquals(1, map.size());
+ Transformer<Number, Integer> intConverter = new Transformer<Number, Integer>(){
+ public Integer transform(Number input) {
+ return input.intValue();
+ }
+ };
+ Map<Long, Number> map = getLazyMap(new HashMap<Long,Number>(), intConverter );
+ assertEquals(0, map.size());
+ Number i1 = map.get(123L);
+ assertEquals(123, i1);
+ assertEquals(1, map.size());
}
@Override
- public String getCompatibilityVersion() {
+ public String getCompatibilityVersion() {
return "3.1";
}
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/map/TestLazySortedMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/map/TestLazySortedMap.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/map/TestLazySortedMap.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/map/TestLazySortedMap.java Fri Sep 11 21:48:16 2009
@@ -40,7 +40,7 @@
*/
public class TestLazySortedMap<K, V> extends AbstractTestSortedMap<K, V> {
- private static final Factory<Integer> oneFactory = FactoryUtils.constantFactory(1);
+ private static final Factory<Integer> oneFactory = FactoryUtils.constantFactory(1);
public TestLazySortedMap(String testName) {
super(testName);
@@ -52,18 +52,18 @@
}
@Override
- public SortedMap<K,V> makeObject() {
+ public SortedMap<K,V> makeObject() {
return getLazySortedMap(new TreeMap<K,V>(), FactoryUtils.<V>nullFactory());
}
@Override
- public boolean isSubMapViewsSerializable() {
+ public boolean isSubMapViewsSerializable() {
// TODO TreeMap sub map views have a bug in deserialization.
return false;
}
@Override
- public boolean isAllowNullKey() {
+ public boolean isAllowNullKey() {
return false;
}
@@ -71,7 +71,7 @@
//-----------------------------------------------------------------------
@Override
public void testMapGet() {
- //TODO eliminate need for this via superclass - see svn history.
+ //TODO eliminate need for this via superclass - see svn history.
}
@Test
@@ -128,7 +128,7 @@
}
@Override
- public String getCompatibilityVersion() {
+ public String getCompatibilityVersion() {
return "3.1";
}
Modified: commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/splitmap/TestAll.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/splitmap/TestAll.java?rev=814044&r1=814043&r2=814044&view=diff
==============================================================================
--- commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/splitmap/TestAll.java (original)
+++ commons/proper/collections/branches/collections_jdk5_branch/src/test/org/apache/commons/collections/splitmap/TestAll.java Fri Sep 11 21:48:16 2009
@@ -36,7 +36,7 @@
@RunWith(Suite.class)
@SuiteClasses({
TestSplitMapUtils.class,
- TestTransformedMap.class
+ TestTransformedMap.class
})
public class TestAll extends TestCase {
}