You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2017/10/11 22:37:14 UTC
[1/5] commons-collections git commit: Revert "Use final for locals."
Repository: commons-collections
Updated Branches:
refs/heads/master 712ddb1e1 -> eed8a7adb
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/sequence/SequencesComparatorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/sequence/SequencesComparatorTest.java b/src/test/java/org/apache/commons/collections4/sequence/SequencesComparatorTest.java
index 88bb25a..f2795ec 100644
--- a/src/test/java/org/apache/commons/collections4/sequence/SequencesComparatorTest.java
+++ b/src/test/java/org/apache/commons/collections4/sequence/SequencesComparatorTest.java
@@ -130,7 +130,7 @@ public class SequencesComparatorTest {
final ExecutionVisitor<String> ev = new ExecutionVisitor<>();
for (int i = 0; i < shadokSentences.size(); ++i) {
- for (final List<String> shadokSentence : shadokSentences) {
+ for (List<String> shadokSentence : shadokSentences) {
ev.setList(shadokSentences.get(i));
new SequencesComparator<>(shadokSentences.get(i),
shadokSentence).getScript().visit(ev);
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/set/AbstractSetTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/set/AbstractSetTest.java b/src/test/java/org/apache/commons/collections4/set/AbstractSetTest.java
index 089b919..cea912a 100644
--- a/src/test/java/org/apache/commons/collections4/set/AbstractSetTest.java
+++ b/src/test/java/org/apache/commons/collections4/set/AbstractSetTest.java
@@ -62,7 +62,7 @@ public abstract class AbstractSetTest<E> extends AbstractCollectionTest<E> {
assertEquals("Sets should have equal hashCodes",
getConfirmed().hashCode(), getCollection().hashCode());
final Collection<E> set = makeConfirmedCollection();
- for (final E element : getCollection()) {
+ for (E element : getCollection()) {
assertTrue("Set.iterator should only return unique elements", set.add(element));
}
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/trie/PatriciaTrieTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/trie/PatriciaTrieTest.java b/src/test/java/org/apache/commons/collections4/trie/PatriciaTrieTest.java
index 2660b12..88919a3 100755
--- a/src/test/java/org/apache/commons/collections4/trie/PatriciaTrieTest.java
+++ b/src/test/java/org/apache/commons/collections4/trie/PatriciaTrieTest.java
@@ -331,7 +331,7 @@ public class PatriciaTrieTest<V> extends AbstractSortedMapTest<String, V> {
public void testPrefixMapSizes() {
// COLLECTIONS-525
- final PatriciaTrie<String> aTree = new PatriciaTrie<>();
+ PatriciaTrie<String> aTree = new PatriciaTrie<>();
aTree.put("点评", "测试");
aTree.put("书评", "测试");
assertTrue(aTree.prefixMap("点").containsKey("点评"));
@@ -370,7 +370,7 @@ public class PatriciaTrieTest<V> extends AbstractSortedMapTest<String, V> {
}
public void testPrefixMapClear() {
- final Trie<String, Integer> trie = new PatriciaTrie<>();
+ Trie<String, Integer> trie = new PatriciaTrie<>();
trie.put("Anna", 1);
trie.put("Anael", 2);
trie.put("Analu", 3);
@@ -378,7 +378,7 @@ public class PatriciaTrieTest<V> extends AbstractSortedMapTest<String, V> {
trie.put("Andrea", 5);
trie.put("Andres", 6);
trie.put("Anatole", 7);
- final SortedMap<String, Integer> prefixMap = trie.prefixMap("And");
+ SortedMap<String, Integer> prefixMap = trie.prefixMap("And");
assertEquals(new HashSet<>(Arrays.asList("Andrea", "Andreas", "Andres")), prefixMap.keySet());
assertEquals(Arrays.asList(5, 4, 6), new ArrayList<>(prefixMap.values()));
@@ -391,8 +391,8 @@ public class PatriciaTrieTest<V> extends AbstractSortedMapTest<String, V> {
}
public void testPrefixMapClearNothing() {
- final Trie<String, Integer> trie = new PatriciaTrie<>();
- final SortedMap<String, Integer> prefixMap = trie.prefixMap("And");
+ Trie<String, Integer> trie = new PatriciaTrie<>();
+ SortedMap<String, Integer> prefixMap = trie.prefixMap("And");
assertEquals(new HashSet<String>(), prefixMap.keySet());
assertEquals(new ArrayList<Integer>(0), new ArrayList<>(prefixMap.values()));
@@ -405,7 +405,7 @@ public class PatriciaTrieTest<V> extends AbstractSortedMapTest<String, V> {
}
public void testPrefixMapClearUsingRemove() {
- final Trie<String, Integer> trie = new PatriciaTrie<>();
+ Trie<String, Integer> trie = new PatriciaTrie<>();
trie.put("Anna", 1);
trie.put("Anael", 2);
trie.put("Analu", 3);
@@ -413,11 +413,11 @@ public class PatriciaTrieTest<V> extends AbstractSortedMapTest<String, V> {
trie.put("Andrea", 5);
trie.put("Andres", 6);
trie.put("Anatole", 7);
- final SortedMap<String, Integer> prefixMap = trie.prefixMap("And");
+ SortedMap<String, Integer> prefixMap = trie.prefixMap("And");
assertEquals(new HashSet<>(Arrays.asList("Andrea", "Andreas", "Andres")), prefixMap.keySet());
assertEquals(Arrays.asList(5, 4, 6), new ArrayList<>(prefixMap.values()));
- final Set<String> keys = new HashSet<>(prefixMap.keySet());
+ Set<String> keys = new HashSet<>(prefixMap.keySet());
for (final String key : keys) {
prefixMap.remove(key);
}
[4/5] commons-collections git commit: Revert "Use final for params."
Posted by gg...@apache.org.
Revert "Use final for params."
This reverts commit cefe846e3e4a239dd568623346160ad41d7256ab.
Project: http://git-wip-us.apache.org/repos/asf/commons-collections/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-collections/commit/b5eb4fcc
Tree: http://git-wip-us.apache.org/repos/asf/commons-collections/tree/b5eb4fcc
Diff: http://git-wip-us.apache.org/repos/asf/commons-collections/diff/b5eb4fcc
Branch: refs/heads/master
Commit: b5eb4fcc8d325810297f10c595961d4eee528ae0
Parents: 992ab3c
Author: Gary Gregory <gg...@apache.org>
Authored: Wed Oct 11 16:34:10 2017 -0600
Committer: Gary Gregory <gg...@apache.org>
Committed: Wed Oct 11 16:34:10 2017 -0600
----------------------------------------------------------------------
.../commons/collections4/CollectionUtils.java | 10 ++--
.../commons/collections4/IterableUtils.java | 4 +-
.../commons/collections4/IteratorUtils.java | 6 +--
.../apache/commons/collections4/ListUtils.java | 2 +-
.../apache/commons/collections4/MapUtils.java | 2 +-
.../apache/commons/collections4/SetUtils.java | 12 ++---
.../collections4/keyvalue/AbstractKeyValue.java | 4 +-
.../collections4/map/AbstractReferenceMap.java | 2 +-
.../commons/collections4/map/MultiValueMap.java | 6 +--
.../multimap/AbstractListValuedMap.java | 28 +++++------
.../multimap/AbstractMultiValuedMap.java | 52 ++++++++++----------
.../AbstractMultiValuedMapDecorator.java | 8 +--
.../multimap/AbstractSetValuedMap.java | 6 +--
.../multimap/ArrayListValuedHashMap.java | 8 +--
.../multimap/HashSetValuedHashMap.java | 8 +--
.../multimap/UnmodifiableMultiValuedMap.java | 2 +-
.../multiset/AbstractMapMultiSet.java | 2 +-
.../collections4/multiset/AbstractMultiSet.java | 4 +-
.../multiset/AbstractMultiSetDecorator.java | 2 +-
.../multiset/PredicatedMultiSet.java | 2 +-
.../multiset/SynchronizedMultiSet.java | 2 +-
.../multiset/UnmodifiableMultiSet.java | 2 +-
.../collections4/queue/CircularFifoQueue.java | 2 +-
.../set/AbstractNavigableSetDecorator.java | 14 +++---
.../set/PredicatedNavigableSet.java | 14 +++---
.../set/TransformedNavigableSet.java | 14 +++---
.../set/UnmodifiableNavigableSet.java | 6 +--
.../collections4/trie/UnmodifiableTrie.java | 4 +-
.../collections4/CollectionUtilsTest.java | 16 +++---
.../collections4/FluentIterableTest.java | 6 +--
.../commons/collections4/IterableUtilsTest.java | 24 ++++-----
.../commons/collections4/MapUtilsTest.java | 6 +--
.../collections4/TransformerUtilsTest.java | 2 +-
.../commons/collections4/bag/TreeBagTest.java | 2 +-
.../PredicatedCollectionBuilderTest.java | 2 +-
.../iterators/PeekingIteratorTest.java | 2 +-
.../iterators/PushbackIteratorTest.java | 2 +-
.../collections4/keyvalue/MultiKeyTest.java | 2 +-
.../collections4/map/MultiValueMapTest.java | 4 +-
.../map/PassiveExpiringMapTest.java | 2 +-
.../multimap/AbstractMultiValuedMapTest.java | 6 +--
.../multimap/ArrayListValuedHashMapTest.java | 2 +-
.../multimap/HashSetValuedHashMapTest.java | 2 +-
.../multimap/TransformedMultiValuedMapTest.java | 2 +-
.../UnmodifiableMultiValuedMapTest.java | 2 +-
45 files changed, 156 insertions(+), 156 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/CollectionUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/CollectionUtils.java b/src/main/java/org/apache/commons/collections4/CollectionUtils.java
index 1b54be5..5b974cb 100644
--- a/src/main/java/org/apache/commons/collections4/CollectionUtils.java
+++ b/src/main/java/org/apache/commons/collections4/CollectionUtils.java
@@ -923,7 +923,7 @@ public class CollectionUtils {
* @since 4.1
*/
public static <O, R extends Collection<? super O>> R select(final Iterable<? extends O> inputCollection,
- final Predicate<? super O> predicate, final R outputCollection, final R rejectedCollection) {
+ final Predicate<? super O> predicate, R outputCollection, R rejectedCollection) {
if (inputCollection != null && predicate != null) {
for (final O element : inputCollection) {
@@ -1506,8 +1506,8 @@ public class CollectionUtils {
* @throws NullPointerException if either collection is null
* @since 4.0
*/
- public static <O extends Comparable<? super O>> List<O> collate(final Iterable<? extends O> a,
- final Iterable<? extends O> b) {
+ public static <O extends Comparable<? super O>> List<O> collate(Iterable<? extends O> a,
+ Iterable<? extends O> b) {
return collate(a, b, ComparatorUtils.<O>naturalComparator(), true);
}
@@ -1688,7 +1688,7 @@ public class CollectionUtils {
final Transformer<E, EquatorWrapper<E>> transformer = new Transformer<E, EquatorWrapper<E>>() {
@Override
- public EquatorWrapper<E> transform(final E input) {
+ public EquatorWrapper<E> transform(E input) {
return new EquatorWrapper<>(equator, input);
}
};
@@ -1764,7 +1764,7 @@ public class CollectionUtils {
final Transformer<E, EquatorWrapper<E>> transformer = new Transformer<E, EquatorWrapper<E>>() {
@Override
- public EquatorWrapper<E> transform(final E input) {
+ public EquatorWrapper<E> transform(E input) {
return new EquatorWrapper<>(equator, input);
}
};
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/IterableUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/IterableUtils.java b/src/main/java/org/apache/commons/collections4/IterableUtils.java
index 15e50c2..ad24eeb 100644
--- a/src/main/java/org/apache/commons/collections4/IterableUtils.java
+++ b/src/main/java/org/apache/commons/collections4/IterableUtils.java
@@ -172,7 +172,7 @@ public class IterableUtils {
public Iterator<E> iterator() {
return new LazyIteratorChain<E>() {
@Override
- protected Iterator<? extends E> nextIterator(final int count) {
+ protected Iterator<? extends E> nextIterator(int count) {
if (count > iterables.length) {
return null;
} else {
@@ -325,7 +325,7 @@ public class IterableUtils {
public Iterator<E> iterator() {
return new LazyIteratorChain<E>() {
@Override
- protected Iterator<? extends E> nextIterator(final int count) {
+ protected Iterator<? extends E> nextIterator(int count) {
if (IterableUtils.isEmpty(iterable)) {
return null;
} else {
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/IteratorUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/IteratorUtils.java b/src/main/java/org/apache/commons/collections4/IteratorUtils.java
index e4b30d3..cfce5b3 100644
--- a/src/main/java/org/apache/commons/collections4/IteratorUtils.java
+++ b/src/main/java/org/apache/commons/collections4/IteratorUtils.java
@@ -433,7 +433,7 @@ public class IteratorUtils {
* @throws IllegalArgumentException if max is negative
* @since 4.1
*/
- public static <E> BoundedIterator<E> boundedIterator(final Iterator<? extends E> iterator, final long max) {
+ public static <E> BoundedIterator<E> boundedIterator(final Iterator<? extends E> iterator, long max) {
return boundedIterator(iterator, 0, max);
}
@@ -455,7 +455,7 @@ public class IteratorUtils {
* @since 4.1
*/
public static <E> BoundedIterator<E> boundedIterator(final Iterator<? extends E> iterator,
- final long offset, final long max) {
+ long offset, long max) {
return new BoundedIterator<>(iterator, offset, max);
}
@@ -890,7 +890,7 @@ public class IteratorUtils {
* @throws IllegalArgumentException if offset is negative
* @since 4.1
*/
- public static <E> SkippingIterator<E> skippingIterator(final Iterator<E> iterator, final long offset) {
+ public static <E> SkippingIterator<E> skippingIterator(final Iterator<E> iterator, long offset) {
return new SkippingIterator<>(iterator, offset);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/ListUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/ListUtils.java b/src/main/java/org/apache/commons/collections4/ListUtils.java
index c5fe813..38e2e8b 100644
--- a/src/main/java/org/apache/commons/collections4/ListUtils.java
+++ b/src/main/java/org/apache/commons/collections4/ListUtils.java
@@ -613,7 +613,7 @@ public class ListUtils {
}
@Override
- public Character get( final int index ) {
+ public Character get( int index ) {
return Character.valueOf(sequence.charAt( index ));
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/MapUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/MapUtils.java b/src/main/java/org/apache/commons/collections4/MapUtils.java
index 30a084e..15dfe82 100644
--- a/src/main/java/org/apache/commons/collections4/MapUtils.java
+++ b/src/main/java/org/apache/commons/collections4/MapUtils.java
@@ -1798,7 +1798,7 @@ public class MapUtils {
* @param map a Map or null
* @return the given map size or 0 if the map is null
*/
- public static int size(final Map<?, ?> map) {
+ public static int size(Map<?, ?> map) {
return map == null ? 0 : map.size();
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/SetUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/SetUtils.java b/src/main/java/org/apache/commons/collections4/SetUtils.java
index 3d24cb2..e97b9c6 100644
--- a/src/main/java/org/apache/commons/collections4/SetUtils.java
+++ b/src/main/java/org/apache/commons/collections4/SetUtils.java
@@ -446,7 +446,7 @@ public class SetUtils {
return new SetView<E>() {
@Override
- public boolean contains(final Object o) {
+ public boolean contains(Object o) {
return a.contains(o) || b.contains(o);
}
@@ -488,14 +488,14 @@ public class SetUtils {
final Predicate<E> notContainedInB = new Predicate<E>() {
@Override
- public boolean evaluate(final E object) {
+ public boolean evaluate(E object) {
return !b.contains(object);
}
};
return new SetView<E>() {
@Override
- public boolean contains(final Object o) {
+ public boolean contains(Object o) {
return a.contains(o) && !b.contains(o);
}
@@ -526,14 +526,14 @@ public class SetUtils {
final Predicate<E> containedInB = new Predicate<E>() {
@Override
- public boolean evaluate(final E object) {
+ public boolean evaluate(E object) {
return b.contains(object);
}
};
return new SetView<E>() {
@Override
- public boolean contains(final Object o) {
+ public boolean contains(Object o) {
return a.contains(o) && b.contains(o);
}
@@ -570,7 +570,7 @@ public class SetUtils {
return new SetView<E>() {
@Override
- public boolean contains(final Object o) {
+ public boolean contains(Object o) {
return a.contains(o) ^ b.contains(o);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java
index 6f7a5e1..f816561 100644
--- a/src/main/java/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java
+++ b/src/main/java/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java
@@ -53,7 +53,7 @@ public abstract class AbstractKeyValue<K, V> implements KeyValue<K, V> {
return key;
}
- protected K setKey(final K key) {
+ protected K setKey(K key) {
final K old = this.key;
this.key = key;
return old;
@@ -69,7 +69,7 @@ public abstract class AbstractKeyValue<K, V> implements KeyValue<K, V> {
return value;
}
- protected V setValue(final V value) {
+ protected V setValue(V value) {
final V old = this.value;
this.value = value;
return old;
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
index 17fd4cb..82ac7e3 100644
--- a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
+++ b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
@@ -1059,7 +1059,7 @@ public abstract class AbstractReferenceMap<K, V> extends AbstractHashedMap<K, V>
* @param type the type to check against.
* @return true if keyType has the specified type
*/
- protected boolean isKeyType(final ReferenceStrength type) {
+ protected boolean isKeyType(ReferenceStrength type) {
return this.keyType == type;
}
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java b/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java
index 98e45da..a929006 100644
--- a/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java
+++ b/src/main/java/org/apache/commons/collections4/map/MultiValueMap.java
@@ -427,7 +427,7 @@ public class MultiValueMap<K, V> extends AbstractMapDecorator<K, Object> impleme
return new LazyIteratorChain<Entry<K, V>>() {
@Override
- protected Iterator<? extends Entry<K, V>> nextIterator(final int count) {
+ protected Iterator<? extends Entry<K, V>> nextIterator(int count) {
if ( ! keyIterator.hasNext() ) {
return null;
}
@@ -445,7 +445,7 @@ public class MultiValueMap<K, V> extends AbstractMapDecorator<K, Object> impleme
return input;
}
@Override
- public V setValue(final V value) {
+ public V setValue(V value) {
throw new UnsupportedOperationException();
}
};
@@ -564,7 +564,7 @@ public class MultiValueMap<K, V> extends AbstractMapDecorator<K, Object> impleme
}
}
- private void readObject(final ObjectInputStream is) throws IOException, ClassNotFoundException {
+ private void readObject(ObjectInputStream is) throws IOException, ClassNotFoundException {
is.defaultReadObject();
// ensure that the de-serialized class is a Collection, COLLECTIONS-580
if (clazz != null && !Collection.class.isAssignableFrom(clazz)) {
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java
index ffe6978..8904f6c 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java
@@ -96,7 +96,7 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
* unmodifiable list for no mapping found.
*/
@Override
- public List<V> remove(final Object key) {
+ public List<V> remove(Object key) {
return ListUtils.emptyIfNull(getMap().remove(key));
}
@@ -116,7 +116,7 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
}
@Override
- public void add(final int index, final V value) {
+ public void add(int index, V value) {
List<V> list = getMapping();
if (list == null) {
list = createCollection();
@@ -126,7 +126,7 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
}
@Override
- public boolean addAll(final int index, final Collection<? extends V> c) {
+ public boolean addAll(int index, Collection<? extends V> c) {
List<V> list = getMapping();
if (list == null) {
list = createCollection();
@@ -140,19 +140,19 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
}
@Override
- public V get(final int index) {
+ public V get(int index) {
final List<V> list = ListUtils.emptyIfNull(getMapping());
return list.get(index);
}
@Override
- public int indexOf(final Object o) {
+ public int indexOf(Object o) {
final List<V> list = ListUtils.emptyIfNull(getMapping());
return list.indexOf(o);
}
@Override
- public int lastIndexOf(final Object o) {
+ public int lastIndexOf(Object o) {
final List<V> list = ListUtils.emptyIfNull(getMapping());
return list.lastIndexOf(o);
}
@@ -163,12 +163,12 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
}
@Override
- public ListIterator<V> listIterator(final int index) {
+ public ListIterator<V> listIterator(int index) {
return new ValuesListIterator(key, index);
}
@Override
- public V remove(final int index) {
+ public V remove(int index) {
final List<V> list = ListUtils.emptyIfNull(getMapping());
V value = list.remove(index);
if (list.isEmpty()) {
@@ -178,19 +178,19 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
}
@Override
- public V set(final int index, final V value) {
+ public V set(int index, V value) {
final List<V> list = ListUtils.emptyIfNull(getMapping());
return list.set(index, value);
}
@Override
- public List<V> subList(final int fromIndex, final int toIndex) {
+ public List<V> subList(int fromIndex, int toIndex) {
final List<V> list = ListUtils.emptyIfNull(getMapping());
return list.subList(fromIndex, toIndex);
}
@Override
- public boolean equals(final Object other) {
+ public boolean equals(Object other) {
final List<V> list = getMapping();
if (list == null) {
return Collections.emptyList().equals(other);
@@ -223,14 +223,14 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
this.iterator = values.listIterator();
}
- public ValuesListIterator(final K key, final int index) {
+ public ValuesListIterator(final K key, int index) {
this.key = key;
this.values = ListUtils.emptyIfNull(getMap().get(key));
this.iterator = values.listIterator(index);
}
@Override
- public void add(final V value) {
+ public void add(V value) {
if (getMap().get(key) == null) {
List<V> list = createCollection();
getMap().put(key, list);
@@ -279,7 +279,7 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
}
@Override
- public void set(final V value) {
+ public void set(V value) {
iterator.set(value);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java
index 8927185..620667b 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java
@@ -109,7 +109,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
* @param map the map to wrap
*/
@SuppressWarnings("unchecked")
- protected void setMap(final Map<K, ? extends Collection<V>> map) {
+ protected void setMap(Map<K, ? extends Collection<V>> map) {
this.map = (Map<K, Collection<V>>) map;
}
@@ -117,7 +117,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
// -----------------------------------------------------------------------
@Override
- public boolean containsKey(final Object key) {
+ public boolean containsKey(Object key) {
return getMap().containsKey(key);
}
@@ -127,7 +127,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
}
@Override
- public boolean containsMapping(final Object key, final Object value) {
+ public boolean containsMapping(Object key, Object value) {
Collection<V> coll = getMap().get(key);
return coll != null && coll.contains(value);
}
@@ -163,7 +163,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
* empty, unmodifiable collection for no mapping found
*/
@Override
- public Collection<V> remove(final Object key) {
+ public Collection<V> remove(Object key) {
return CollectionUtils.emptyIfNull(getMap().remove(key));
}
@@ -370,7 +370,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
}
@Override
- public boolean equals(final Object obj) {
+ public boolean equals(Object obj) {
if (this == obj) {
return true;
}
@@ -415,7 +415,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
}
@Override
- public boolean add(final V value) {
+ public boolean add(V value) {
Collection<V> coll = getMapping();
if (coll == null) {
coll = createCollection();
@@ -425,7 +425,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
}
@Override
- public boolean addAll(final Collection<? extends V> other) {
+ public boolean addAll(Collection<? extends V> other) {
Collection<V> coll = getMapping();
if (coll == null) {
coll = createCollection();
@@ -460,13 +460,13 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
}
@Override
- public boolean contains(final Object obj) {
+ public boolean contains(Object obj) {
final Collection<V> coll = getMapping();
return coll == null ? false : coll.contains(obj);
}
@Override
- public boolean containsAll(final Collection<?> other) {
+ public boolean containsAll(Collection<?> other) {
final Collection<V> coll = getMapping();
return coll == null ? false : coll.containsAll(other);
}
@@ -478,7 +478,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
}
@Override
- public boolean remove(final Object item) {
+ public boolean remove(Object item) {
final Collection<V> coll = getMapping();
if (coll == null) {
return false;
@@ -492,7 +492,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
}
@Override
- public boolean removeAll(final Collection<?> c) {
+ public boolean removeAll(Collection<?> c) {
final Collection<V> coll = getMapping();
if (coll == null) {
return false;
@@ -506,7 +506,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
}
@Override
- public boolean retainAll(final Collection<?> c) {
+ public boolean retainAll(Collection<?> c) {
final Collection<V> coll = getMapping();
if (coll == null) {
return false;
@@ -530,7 +530,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
@Override
@SuppressWarnings("unchecked")
- public <T> T[] toArray(final T[] a) {
+ public <T> T[] toArray(T[] a) {
final Collection<V> coll = getMapping();
if (coll == null) {
return (T[]) CollectionUtils.EMPTY_COLLECTION.toArray(a);
@@ -555,7 +555,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
private class KeysMultiSet extends AbstractMultiSet<K> {
@Override
- public boolean contains(final Object o) {
+ public boolean contains(Object o) {
return getMap().containsKey(o);
}
@@ -575,7 +575,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
}
@Override
- public int getCount(final Object object) {
+ public int getCount(Object object) {
int count = 0;
Collection<V> col = AbstractMultiValuedMap.this.getMap().get(object);
if (col != null) {
@@ -622,7 +622,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
final Iterator<K> keyIterator = keysCol.iterator();
@Override
- protected Iterator<? extends Entry<K, V>> nextIterator(final int count) {
+ protected Iterator<? extends Entry<K, V>> nextIterator(int count) {
if (!keyIterator.hasNext()) {
return null;
}
@@ -652,12 +652,12 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
*/
private class MultiValuedMapEntry extends AbstractMapEntry<K, V> {
- public MultiValuedMapEntry(final K key, final V value) {
+ public MultiValuedMapEntry(K key, V value) {
super(key, value);
}
@Override
- public V setValue(final V value) {
+ public V setValue(V value) {
throw new UnsupportedOperationException();
}
@@ -709,7 +709,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
}
@Override
- public V setValue(final V value) {
+ public V setValue(V value) {
if (current == null) {
throw new IllegalStateException();
}
@@ -791,12 +791,12 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
}
@Override
- public boolean containsKey(final Object key) {
+ public boolean containsKey(Object key) {
return decoratedMap.containsKey(key);
}
@Override
- public Collection<V> get(final Object key) {
+ public Collection<V> get(Object key) {
Collection<V> collection = decoratedMap.get(key);
if (collection == null) {
return null;
@@ -817,7 +817,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
}
@Override
- public Collection<V> remove(final Object key) {
+ public Collection<V> remove(Object key) {
Collection<V> collection = decoratedMap.remove(key);
if (collection == null) {
return null;
@@ -830,7 +830,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
}
@Override
- public boolean equals(final Object object) {
+ public boolean equals(Object object) {
return this == object || decoratedMap.equals(object);
}
@@ -867,12 +867,12 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
}
@Override
- public boolean contains(final Object o) {
+ public boolean contains(Object o) {
return decoratedMap.entrySet().contains(o);
}
@Override
- public boolean remove(final Object o) {
+ public boolean remove(Object o) {
if (!contains(o)) {
return false;
}
@@ -887,7 +887,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
*/
class AsMapEntrySetIterator extends AbstractIteratorDecorator<Map.Entry<K, Collection<V>>> {
- AsMapEntrySetIterator(final Iterator<Map.Entry<K, Collection<V>>> iterator) {
+ AsMapEntrySetIterator(Iterator<Map.Entry<K, Collection<V>>> iterator) {
super(iterator);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapDecorator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapDecorator.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapDecorator.java
index 8a6ff63..d49e7a0 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapDecorator.java
@@ -117,7 +117,7 @@ public abstract class AbstractMultiValuedMapDecorator<K, V>
}
@Override
- public boolean put(final K key, final V value) {
+ public boolean put(K key, V value) {
return decorated().put(key, value);
}
@@ -147,17 +147,17 @@ public abstract class AbstractMultiValuedMapDecorator<K, V>
}
@Override
- public boolean putAll(final K key, final Iterable<? extends V> values) {
+ public boolean putAll(K key, Iterable<? extends V> values) {
return decorated().putAll(key, values);
}
@Override
- public boolean putAll(final Map<? extends K, ? extends V> map) {
+ public boolean putAll(Map<? extends K, ? extends V> map) {
return decorated().putAll(map);
}
@Override
- public boolean putAll(final MultiValuedMap<? extends K, ? extends V> map) {
+ public boolean putAll(MultiValuedMap<? extends K, ? extends V> map) {
return decorated().putAll(map);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java
index 88704f6..96c3140 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java
@@ -48,7 +48,7 @@ public abstract class AbstractSetValuedMap<K, V> extends AbstractMultiValuedMap<
* @param map the map to wrap, must not be null
* @throws NullPointerException if the map is null
*/
- protected AbstractSetValuedMap(final Map<K, ? extends Set<V>> map) {
+ protected AbstractSetValuedMap(Map<K, ? extends Set<V>> map) {
super(map);
}
@@ -95,7 +95,7 @@ public abstract class AbstractSetValuedMap<K, V> extends AbstractMultiValuedMap<
* unmodifiable set for no mapping found.
*/
@Override
- public Set<V> remove(final Object key) {
+ public Set<V> remove(Object key) {
return SetUtils.emptyIfNull(getMap().remove(key));
}
@@ -111,7 +111,7 @@ public abstract class AbstractSetValuedMap<K, V> extends AbstractMultiValuedMap<
}
@Override
- public boolean equals(final Object other) {
+ public boolean equals(Object other) {
final Set<V> set = (Set<V>) getMapping();
if (set == null) {
return Collections.emptySet().equals(other);
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java b/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java
index 74255e3..873dccf 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java
@@ -74,7 +74,7 @@ public class ArrayListValuedHashMap<K, V> extends AbstractListValuedMap<K, V>
*
* @param initialListCapacity the initial capacity used for value collections
*/
- public ArrayListValuedHashMap(final int initialListCapacity) {
+ public ArrayListValuedHashMap(int initialListCapacity) {
this(DEFAULT_INITIAL_MAP_CAPACITY, initialListCapacity);
}
@@ -85,7 +85,7 @@ public class ArrayListValuedHashMap<K, V> extends AbstractListValuedMap<K, V>
* @param initialMapCapacity the initial hashmap capacity
* @param initialListCapacity the initial capacity used for value collections
*/
- public ArrayListValuedHashMap(final int initialMapCapacity, final int initialListCapacity) {
+ public ArrayListValuedHashMap(int initialMapCapacity, int initialListCapacity) {
super(new HashMap<K, ArrayList<V>>(initialMapCapacity));
this.initialListCapacity = initialListCapacity;
}
@@ -128,12 +128,12 @@ public class ArrayListValuedHashMap<K, V> extends AbstractListValuedMap<K, V>
}
// -----------------------------------------------------------------------
- private void writeObject(final ObjectOutputStream oos) throws IOException {
+ private void writeObject(ObjectOutputStream oos) throws IOException {
oos.defaultWriteObject();
doWriteObject(oos);
}
- private void readObject(final ObjectInputStream ois) throws IOException, ClassNotFoundException {
+ private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
ois.defaultReadObject();
setMap(new HashMap<K, ArrayList<V>>());
doReadObject(ois);
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/multimap/HashSetValuedHashMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multimap/HashSetValuedHashMap.java b/src/main/java/org/apache/commons/collections4/multimap/HashSetValuedHashMap.java
index 616287d..b06ada8 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/HashSetValuedHashMap.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/HashSetValuedHashMap.java
@@ -73,7 +73,7 @@ public class HashSetValuedHashMap<K, V> extends AbstractSetValuedMap<K, V>
*
* @param initialSetCapacity the initial capacity used for value collections
*/
- public HashSetValuedHashMap(final int initialSetCapacity) {
+ public HashSetValuedHashMap(int initialSetCapacity) {
this(DEFAULT_INITIAL_MAP_CAPACITY, initialSetCapacity);
}
@@ -84,7 +84,7 @@ public class HashSetValuedHashMap<K, V> extends AbstractSetValuedMap<K, V>
* @param initialMapCapacity the initial hashmap capacity
* @param initialSetCapacity the initial capacity used for value collections
*/
- public HashSetValuedHashMap(final int initialMapCapacity, final int initialSetCapacity) {
+ public HashSetValuedHashMap(int initialMapCapacity, int initialSetCapacity) {
super(new HashMap<K, HashSet<V>>(initialMapCapacity));
this.initialSetCapacity = initialSetCapacity;
}
@@ -116,12 +116,12 @@ public class HashSetValuedHashMap<K, V> extends AbstractSetValuedMap<K, V>
}
// -----------------------------------------------------------------------
- private void writeObject(final ObjectOutputStream oos) throws IOException {
+ private void writeObject(ObjectOutputStream oos) throws IOException {
oos.defaultWriteObject();
doWriteObject(oos);
}
- private void readObject(final ObjectInputStream ois) throws IOException, ClassNotFoundException {
+ private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
ois.defaultReadObject();
setMap(new HashMap<K, HashSet<V>>());
doReadObject(ois);
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMap.java
index d8932bb..1bd629f 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMap.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMap.java
@@ -60,7 +60,7 @@ public final class UnmodifiableMultiValuedMap<K, V>
*/
@SuppressWarnings("unchecked")
public static <K, V> UnmodifiableMultiValuedMap<K, V> unmodifiableMultiValuedMap(
- final MultiValuedMap<? extends K, ? extends V> map) {
+ MultiValuedMap<? extends K, ? extends V> map) {
if (map instanceof Unmodifiable) {
return (UnmodifiableMultiValuedMap<K, V>) map;
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java b/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java
index f6a0cd8..f742854 100644
--- a/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java
+++ b/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java
@@ -81,7 +81,7 @@ public abstract class AbstractMapMultiSet<E> extends AbstractMultiSet<E> {
*
* @param map the map to wrap
*/
- protected void setMap(final Map<E, MutableInteger> map) {
+ protected void setMap(Map<E, MutableInteger> map) {
this.map = map;
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSet.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSet.java b/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSet.java
index 46624cc..261175f 100644
--- a/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSet.java
+++ b/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSet.java
@@ -257,7 +257,7 @@ public abstract class AbstractMultiSet<E> extends AbstractCollection<E> implemen
protected Iterator<E> createUniqueSetIterator() {
final Transformer<Entry<E>, E> transformer = new Transformer<Entry<E>, E>() {
@Override
- public E transform(final Entry<E> entry) {
+ public E transform(Entry<E> entry) {
return entry.getElement();
}
};
@@ -411,7 +411,7 @@ public abstract class AbstractMultiSet<E> extends AbstractCollection<E> implemen
protected static abstract class AbstractEntry<E> implements Entry<E> {
@Override
- public boolean equals(final Object object) {
+ public boolean equals(Object object) {
if (object instanceof Entry) {
final Entry<?> other = (Entry<?>) object;
final E element = this.getElement();
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSetDecorator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSetDecorator.java b/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSetDecorator.java
index 3e2c724..4c80eb5 100644
--- a/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSetDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSetDecorator.java
@@ -79,7 +79,7 @@ public abstract class AbstractMultiSetDecorator<E>
}
@Override
- public int setCount(final E object, final int count) {
+ public int setCount(E object, int count) {
return decorated().setCount(object, count);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/multiset/PredicatedMultiSet.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multiset/PredicatedMultiSet.java b/src/main/java/org/apache/commons/collections4/multiset/PredicatedMultiSet.java
index ff9065c..b5d1b7e 100644
--- a/src/main/java/org/apache/commons/collections4/multiset/PredicatedMultiSet.java
+++ b/src/main/java/org/apache/commons/collections4/multiset/PredicatedMultiSet.java
@@ -118,7 +118,7 @@ public class PredicatedMultiSet<E> extends PredicatedCollection<E> implements Mu
}
@Override
- public int setCount(final E object, final int count) {
+ public int setCount(E object, int count) {
validate(object);
return decorated().setCount(object, count);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/multiset/SynchronizedMultiSet.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multiset/SynchronizedMultiSet.java b/src/main/java/org/apache/commons/collections4/multiset/SynchronizedMultiSet.java
index 8dc48c9..f069720 100644
--- a/src/main/java/org/apache/commons/collections4/multiset/SynchronizedMultiSet.java
+++ b/src/main/java/org/apache/commons/collections4/multiset/SynchronizedMultiSet.java
@@ -120,7 +120,7 @@ public class SynchronizedMultiSet<E> extends SynchronizedCollection<E> implement
}
@Override
- public int setCount(final E object, final int count) {
+ public int setCount(E object, int count) {
synchronized (lock) {
return decorated().setCount(object, count);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/multiset/UnmodifiableMultiSet.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multiset/UnmodifiableMultiSet.java b/src/main/java/org/apache/commons/collections4/multiset/UnmodifiableMultiSet.java
index 3653716..ddfadc0 100644
--- a/src/main/java/org/apache/commons/collections4/multiset/UnmodifiableMultiSet.java
+++ b/src/main/java/org/apache/commons/collections4/multiset/UnmodifiableMultiSet.java
@@ -136,7 +136,7 @@ public final class UnmodifiableMultiSet<E>
//-----------------------------------------------------------------------
@Override
- public int setCount(final E object, final int count) {
+ public int setCount(E object, int count) {
throw new UnsupportedOperationException();
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/queue/CircularFifoQueue.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/queue/CircularFifoQueue.java b/src/main/java/org/apache/commons/collections4/queue/CircularFifoQueue.java
index 6aada49..8beb531 100644
--- a/src/main/java/org/apache/commons/collections4/queue/CircularFifoQueue.java
+++ b/src/main/java/org/apache/commons/collections4/queue/CircularFifoQueue.java
@@ -282,7 +282,7 @@ public class CircularFifoQueue<E> extends AbstractCollection<E>
* @throws NullPointerException if the given element is null
*/
@Override
- public boolean offer(final E element) {
+ public boolean offer(E element) {
return add(element);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/set/AbstractNavigableSetDecorator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/set/AbstractNavigableSetDecorator.java b/src/main/java/org/apache/commons/collections4/set/AbstractNavigableSetDecorator.java
index 42fa406..01ff705 100644
--- a/src/main/java/org/apache/commons/collections4/set/AbstractNavigableSetDecorator.java
+++ b/src/main/java/org/apache/commons/collections4/set/AbstractNavigableSetDecorator.java
@@ -64,22 +64,22 @@ public abstract class AbstractNavigableSetDecorator<E>
//-----------------------------------------------------------------------
@Override
- public E lower(final E e) {
+ public E lower(E e) {
return decorated().lower(e);
}
@Override
- public E floor(final E e) {
+ public E floor(E e) {
return decorated().floor(e);
}
@Override
- public E ceiling(final E e) {
+ public E ceiling(E e) {
return decorated().ceiling(e);
}
@Override
- public E higher(final E e) {
+ public E higher(E e) {
return decorated().higher(e);
}
@@ -104,17 +104,17 @@ public abstract class AbstractNavigableSetDecorator<E>
}
@Override
- public NavigableSet<E> subSet(final E fromElement, final boolean fromInclusive, final E toElement, final boolean toInclusive) {
+ public NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive) {
return decorated().subSet(fromElement, fromInclusive, toElement, toInclusive);
}
@Override
- public NavigableSet<E> headSet(final E toElement, final boolean inclusive) {
+ public NavigableSet<E> headSet(E toElement, boolean inclusive) {
return decorated().headSet(toElement, inclusive);
}
@Override
- public NavigableSet<E> tailSet(final E fromElement, final boolean inclusive) {
+ public NavigableSet<E> tailSet(E fromElement, boolean inclusive) {
return decorated().tailSet(fromElement, inclusive);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/set/PredicatedNavigableSet.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/set/PredicatedNavigableSet.java b/src/main/java/org/apache/commons/collections4/set/PredicatedNavigableSet.java
index 5aea154..3411ceb 100644
--- a/src/main/java/org/apache/commons/collections4/set/PredicatedNavigableSet.java
+++ b/src/main/java/org/apache/commons/collections4/set/PredicatedNavigableSet.java
@@ -91,22 +91,22 @@ public class PredicatedNavigableSet<E> extends PredicatedSortedSet<E> implements
//-----------------------------------------------------------------------
@Override
- public E lower(final E e) {
+ public E lower(E e) {
return decorated().lower(e);
}
@Override
- public E floor(final E e) {
+ public E floor(E e) {
return decorated().floor(e);
}
@Override
- public E ceiling(final E e) {
+ public E ceiling(E e) {
return decorated().ceiling(e);
}
@Override
- public E higher(final E e) {
+ public E higher(E e) {
return decorated().higher(e);
}
@@ -131,19 +131,19 @@ public class PredicatedNavigableSet<E> extends PredicatedSortedSet<E> implements
}
@Override
- public NavigableSet<E> subSet(final E fromElement, final boolean fromInclusive, final E toElement, final boolean toInclusive) {
+ public NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive) {
final NavigableSet<E> sub = decorated().subSet(fromElement, fromInclusive, toElement, toInclusive);
return predicatedNavigableSet(sub, predicate);
}
@Override
- public NavigableSet<E> headSet(final E toElement, final boolean inclusive) {
+ public NavigableSet<E> headSet(E toElement, boolean inclusive) {
final NavigableSet<E> head = decorated().headSet(toElement, inclusive);
return predicatedNavigableSet(head, predicate);
}
@Override
- public NavigableSet<E> tailSet(final E fromElement, final boolean inclusive) {
+ public NavigableSet<E> tailSet(E fromElement, boolean inclusive) {
final NavigableSet<E> tail = decorated().tailSet(fromElement, inclusive);
return predicatedNavigableSet(tail, predicate);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/set/TransformedNavigableSet.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/set/TransformedNavigableSet.java b/src/main/java/org/apache/commons/collections4/set/TransformedNavigableSet.java
index c7608b1..eea49d7 100644
--- a/src/main/java/org/apache/commons/collections4/set/TransformedNavigableSet.java
+++ b/src/main/java/org/apache/commons/collections4/set/TransformedNavigableSet.java
@@ -112,22 +112,22 @@ public class TransformedNavigableSet<E> extends TransformedSortedSet<E> implemen
//-----------------------------------------------------------------------
@Override
- public E lower(final E e) {
+ public E lower(E e) {
return decorated().lower(e);
}
@Override
- public E floor(final E e) {
+ public E floor(E e) {
return decorated().floor(e);
}
@Override
- public E ceiling(final E e) {
+ public E ceiling(E e) {
return decorated().ceiling(e);
}
@Override
- public E higher(final E e) {
+ public E higher(E e) {
return decorated().higher(e);
}
@@ -152,19 +152,19 @@ public class TransformedNavigableSet<E> extends TransformedSortedSet<E> implemen
}
@Override
- public NavigableSet<E> subSet(final E fromElement, final boolean fromInclusive, final E toElement, final boolean toInclusive) {
+ public NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive) {
final NavigableSet<E> sub = decorated().subSet(fromElement, fromInclusive, toElement, toInclusive);
return transformingNavigableSet(sub, transformer);
}
@Override
- public NavigableSet<E> headSet(final E toElement, final boolean inclusive) {
+ public NavigableSet<E> headSet(E toElement, boolean inclusive) {
final NavigableSet<E> head = decorated().headSet(toElement, inclusive);
return transformingNavigableSet(head, transformer);
}
@Override
- public NavigableSet<E> tailSet(final E fromElement, final boolean inclusive) {
+ public NavigableSet<E> tailSet(E fromElement, boolean inclusive) {
final NavigableSet<E> tail = decorated().tailSet(fromElement, inclusive);
return transformingNavigableSet(tail, transformer);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/set/UnmodifiableNavigableSet.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/set/UnmodifiableNavigableSet.java b/src/main/java/org/apache/commons/collections4/set/UnmodifiableNavigableSet.java
index 6767b99..40b4dc4 100644
--- a/src/main/java/org/apache/commons/collections4/set/UnmodifiableNavigableSet.java
+++ b/src/main/java/org/apache/commons/collections4/set/UnmodifiableNavigableSet.java
@@ -136,19 +136,19 @@ public final class UnmodifiableNavigableSet<E>
}
@Override
- public NavigableSet<E> subSet(final E fromElement, final boolean fromInclusive, final E toElement, final boolean toInclusive) {
+ public NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive) {
final NavigableSet<E> sub = decorated().subSet(fromElement, fromInclusive, toElement, toInclusive);
return unmodifiableNavigableSet(sub);
}
@Override
- public NavigableSet<E> headSet(final E toElement, final boolean inclusive) {
+ public NavigableSet<E> headSet(E toElement, boolean inclusive) {
final NavigableSet<E> head = decorated().headSet(toElement, inclusive);
return unmodifiableNavigableSet(head);
}
@Override
- public NavigableSet<E> tailSet(final E fromElement, final boolean inclusive) {
+ public NavigableSet<E> tailSet(E fromElement, boolean inclusive) {
final NavigableSet<E> tail = decorated().tailSet(fromElement, inclusive);
return unmodifiableNavigableSet(tail);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/main/java/org/apache/commons/collections4/trie/UnmodifiableTrie.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/trie/UnmodifiableTrie.java b/src/main/java/org/apache/commons/collections4/trie/UnmodifiableTrie.java
index 424adfa..a18f7ef 100644
--- a/src/main/java/org/apache/commons/collections4/trie/UnmodifiableTrie.java
+++ b/src/main/java/org/apache/commons/collections4/trie/UnmodifiableTrie.java
@@ -180,12 +180,12 @@ public class UnmodifiableTrie<K, V> implements Trie<K, V>, Serializable, Unmodif
}
@Override
- public K nextKey(final K key) {
+ public K nextKey(K key) {
return delegate.nextKey(key);
}
@Override
- public K previousKey(final K key) {
+ public K previousKey(K key) {
return delegate.previousKey(key);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java b/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
index 60fc30c..9553610 100644
--- a/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
@@ -702,7 +702,7 @@ public class CollectionUtilsTest extends MockTestCase {
final StringBuffer result = new StringBuffer();
result.append(CollectionUtils.forAllButLastDo(strings, new Closure<String>() {
@Override
- public void execute(final String input) {
+ public void execute(String input) {
result.append(input+";");
}
}));
@@ -712,7 +712,7 @@ public class CollectionUtilsTest extends MockTestCase {
final StringBuffer resultOne = new StringBuffer();
resultOne.append(CollectionUtils.forAllButLastDo(oneString, new Closure<String>() {
@Override
- public void execute(final String input) {
+ public void execute(String input) {
resultOne.append(input+";");
}
}));
@@ -1800,7 +1800,7 @@ public class CollectionUtilsTest extends MockTestCase {
Predicate<Integer> lessThanFive = new Predicate<Integer>() {
@Override
- public boolean evaluate(final Integer object) {
+ public boolean evaluate(Integer object) {
return object < 5;
}
};
@@ -1808,7 +1808,7 @@ public class CollectionUtilsTest extends MockTestCase {
Predicate<Integer> lessThanFour = new Predicate<Integer>() {
@Override
- public boolean evaluate(final Integer object) {
+ public boolean evaluate(Integer object) {
return object < 4;
}
};
@@ -1834,12 +1834,12 @@ public class CollectionUtilsTest extends MockTestCase {
final Collection<String> result = CollectionUtils.removeAll(base, remove, new Equator<String>() {
@Override
- public boolean equate(final String o1, final String o2) {
+ public boolean equate(String o1, String o2) {
return o1.charAt(1) == o2.charAt(1);
}
@Override
- public int hash(final String o) {
+ public int hash(String o) {
return o.charAt(1);
}
});
@@ -1886,12 +1886,12 @@ public class CollectionUtilsTest extends MockTestCase {
final Collection<String> result = CollectionUtils.retainAll(base, retain, new Equator<String>() {
@Override
- public boolean equate(final String o1, final String o2) {
+ public boolean equate(String o1, String o2) {
return o1.charAt(1) == o2.charAt(1);
}
@Override
- public int hash(final String o) {
+ public int hash(String o) {
return o.charAt(1);
}
});
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/test/java/org/apache/commons/collections4/FluentIterableTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/FluentIterableTest.java b/src/test/java/org/apache/commons/collections4/FluentIterableTest.java
index 8c8addc..5b1851f 100644
--- a/src/test/java/org/apache/commons/collections4/FluentIterableTest.java
+++ b/src/test/java/org/apache/commons/collections4/FluentIterableTest.java
@@ -200,7 +200,7 @@ public class FluentIterableTest {
public void filter() {
Predicate<Integer> smallerThan3 = new Predicate<Integer>() {
@Override
- public boolean evaluate(final Integer object) {
+ public boolean evaluate(Integer object) {
return object.intValue() < 3;
}
};
@@ -225,7 +225,7 @@ public class FluentIterableTest {
final AtomicInteger sum = new AtomicInteger(0);
Closure<Integer> closure = new Closure<Integer>() {
@Override
- public void execute(final Integer input) {
+ public void execute(Integer input) {
sum.addAndGet(input);
}
};
@@ -317,7 +317,7 @@ public class FluentIterableTest {
public void transform() {
Transformer<Integer, Integer> squared = new Transformer<Integer, Integer>() {
@Override
- public Integer transform(final Integer object) {
+ public Integer transform(Integer object) {
return object * object;
}
};
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java b/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java
index 33f18fb..7fd4873 100644
--- a/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java
@@ -184,12 +184,12 @@ public class IterableUtilsTest {
final Equator<String> secondLetterEquator = new Equator<String>() {
@Override
- public boolean equate(final String o1, final String o2) {
+ public boolean equate(String o1, String o2) {
return o1.charAt(1) == o2.charAt(1);
}
@Override
- public int hash(final String o) {
+ public int hash(String o) {
return o.charAt(1);
}
@@ -375,7 +375,7 @@ public class IterableUtilsTest {
Predicate<Integer> lessThanFive = new Predicate<Integer>() {
@Override
- public boolean evaluate(final Integer object) {
+ public boolean evaluate(Integer object) {
return object < 5;
}
};
@@ -383,7 +383,7 @@ public class IterableUtilsTest {
Predicate<Integer> lessThanFour = new Predicate<Integer>() {
@Override
- public boolean evaluate(final Integer object) {
+ public boolean evaluate(Integer object) {
return object < 4;
}
};
@@ -487,7 +487,7 @@ public class IterableUtilsTest {
result = IterableUtils.toString(iterableA, new Transformer<Integer, String>() {
@Override
- public String transform(final Integer input) {
+ public String transform(Integer input) {
return new Integer(input * 2).toString();
}
});
@@ -495,7 +495,7 @@ public class IterableUtilsTest {
result = IterableUtils.toString(new ArrayList<Integer>(), new Transformer<Integer, String>() {
@Override
- public String transform(final Integer input) {
+ public String transform(Integer input) {
fail("not supposed to reach here");
return "";
}
@@ -504,7 +504,7 @@ public class IterableUtilsTest {
result = IterableUtils.toString(null, new Transformer<Integer, String>() {
@Override
- public String transform(final Integer input) {
+ public String transform(Integer input) {
fail("not supposed to reach here");
return "";
}
@@ -517,7 +517,7 @@ public class IterableUtilsTest {
Transformer<Integer, String> transformer = new Transformer<Integer, String>() {
@Override
- public String transform(final Integer input) {
+ public String transform(Integer input) {
return new Integer(input * 2).toString();
}
};
@@ -554,7 +554,7 @@ public class IterableUtilsTest {
public void testToStringWithNullArguments() {
String result = IterableUtils.toString(null, new Transformer<Integer, String>() {
@Override
- public String transform(final Integer input) {
+ public String transform(Integer input) {
fail("not supposed to reach here");
return "";
}
@@ -571,7 +571,7 @@ public class IterableUtilsTest {
try {
IterableUtils.toString(new ArrayList<Integer>(), new Transformer<Integer, String>() {
@Override
- public String transform(final Integer input) {
+ public String transform(Integer input) {
fail("not supposed to reach here");
return "";
}
@@ -584,7 +584,7 @@ public class IterableUtilsTest {
try {
IterableUtils.toString(new ArrayList<Integer>(), new Transformer<Integer, String>() {
@Override
- public String transform(final Integer input) {
+ public String transform(Integer input) {
fail("not supposed to reach here");
return "";
}
@@ -597,7 +597,7 @@ public class IterableUtilsTest {
try {
IterableUtils.toString(new ArrayList<Integer>(), new Transformer<Integer, String>() {
@Override
- public String transform(final Integer input) {
+ public String transform(Integer input) {
fail("not supposed to reach here");
return "";
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/test/java/org/apache/commons/collections4/MapUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/MapUtilsTest.java b/src/test/java/org/apache/commons/collections4/MapUtilsTest.java
index e6b9b84..1a595a5 100644
--- a/src/test/java/org/apache/commons/collections4/MapUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/MapUtilsTest.java
@@ -824,13 +824,13 @@ public class MapUtilsTest {
int key;
String name;
- public X(final int key, final String name) {
+ public X(int key, String name) {
this.key = key;
this.name = name;
}
@Override
- public int compareTo(final X o) {
+ public int compareTo(X o) {
return key - o.key | name.compareTo(o.name);
}
@@ -850,7 +850,7 @@ public class MapUtilsTest {
final MultiValueMap<Integer, X> map = MultiValueMap.multiValueMap(new TreeMap<Integer, Collection<X>>());
MapUtils.populateMap(map, list, new Transformer<X, Integer>() {
@Override
- public Integer transform(final X input) {
+ public Integer transform(X input) {
return input.key;
}
}, TransformerUtils.<X> nopTransformer());
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/test/java/org/apache/commons/collections4/TransformerUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/TransformerUtilsTest.java b/src/test/java/org/apache/commons/collections4/TransformerUtilsTest.java
index 13d881b..2979d90 100644
--- a/src/test/java/org/apache/commons/collections4/TransformerUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/TransformerUtilsTest.java
@@ -249,7 +249,7 @@ public class TransformerUtilsTest {
Predicate<Integer> lessThanFivePredicate = new Predicate<Integer>() {
@Override
- public boolean evaluate(final Integer value) {
+ public boolean evaluate(Integer value) {
return value < 5;
}
};
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/test/java/org/apache/commons/collections4/bag/TreeBagTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/bag/TreeBagTest.java b/src/test/java/org/apache/commons/collections4/bag/TreeBagTest.java
index 5dc8b3d..ad99c44 100644
--- a/src/test/java/org/apache/commons/collections4/bag/TreeBagTest.java
+++ b/src/test/java/org/apache/commons/collections4/bag/TreeBagTest.java
@@ -77,7 +77,7 @@ public class TreeBagTest<T> extends AbstractSortedBagTest<T> {
final Bag<String> bag2 = new TreeBag<>(new Comparator<String>() {
@Override
- public int compare(final String o1, final String o2) {
+ public int compare(String o1, String o2) {
return o1.compareTo(o2);
}
});
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionBuilderTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionBuilderTest.java b/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionBuilderTest.java
index 0c8c5a8..ab2f338 100644
--- a/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionBuilderTest.java
+++ b/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionBuilderTest.java
@@ -137,7 +137,7 @@ public class PredicatedCollectionBuilderTest {
private static class OddPredicate implements Predicate<Integer> {
@Override
- public boolean evaluate(final Integer value) {
+ public boolean evaluate(Integer value) {
return value % 2 == 1;
}
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/test/java/org/apache/commons/collections4/iterators/PeekingIteratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/iterators/PeekingIteratorTest.java b/src/test/java/org/apache/commons/collections4/iterators/PeekingIteratorTest.java
index 3876861..c3191b3 100644
--- a/src/test/java/org/apache/commons/collections4/iterators/PeekingIteratorTest.java
+++ b/src/test/java/org/apache/commons/collections4/iterators/PeekingIteratorTest.java
@@ -134,7 +134,7 @@ public class PeekingIteratorTest<E> extends AbstractIteratorTest<E> {
}
}
- private void validate(final Iterator<E> iter, final E... items) {
+ private void validate(Iterator<E> iter, E... items) {
for (E x : items) {
assertTrue(iter.hasNext());
assertEquals(x, iter.next());
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java b/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java
index 3b7a9c0..6561704 100644
--- a/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java
+++ b/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java
@@ -109,7 +109,7 @@ public class PushbackIteratorTest<E> extends AbstractIteratorTest<E> {
validate(iter, "c");
}
- private void validate(final Iterator<E> iter, final Object... items) {
+ private void validate(Iterator<E> iter, Object... items) {
for (final Object x : items) {
assertTrue(iter.hasNext());
assertEquals(x, iter.next());
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java b/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java
index b3dc8b9..500b837 100644
--- a/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java
+++ b/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java
@@ -258,7 +258,7 @@ public class MultiKeyTest extends TestCase {
private static final long serialVersionUID = 1928896152249821416L;
- public DerivedMultiKey(final T key1, final T key2) {
+ public DerivedMultiKey(T key1, T key2) {
super(key1, key2);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java b/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java
index 64310d3..097ec2a 100644
--- a/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java
@@ -407,7 +407,7 @@ public class MultiValueMapTest<K, V> extends AbstractObjectTest {
}
}
- private byte[] serialize(final Object object) throws IOException {
+ private byte[] serialize(Object object) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
@@ -417,7 +417,7 @@ public class MultiValueMapTest<K, V> extends AbstractObjectTest {
return baos.toByteArray();
}
- private Object deserialize(final byte[] data) throws IOException, ClassNotFoundException {
+ private Object deserialize(byte[] data) throws IOException, ClassNotFoundException {
ByteArrayInputStream bais = new ByteArrayInputStream(data);
ObjectInputStream iis = new ObjectInputStream(bais);
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java b/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java
index 8da6831..c633cec 100644
--- a/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java
@@ -234,7 +234,7 @@ public class PassiveExpiringMapTest<K, V> extends AbstractMapTest<K, V> {
new PassiveExpiringMap.ConstantTimeToLiveExpirationPolicy<String, String>(1, TimeUnit.SECONDS)), 1000);
}
- private void validateExpiration(final Map<String, String> map, final long timeout) {
+ private void validateExpiration(final Map<String, String> map, long timeout) {
map.put("a", "b");
assertNotNull(map.get("a"));
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
index 41d92f7..1faaaa7 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
@@ -57,7 +57,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
/** MultiValuedHashMap created by reset(). */
protected MultiValuedMap<K, V> confirmed;
- public AbstractMultiValuedMapTest(final String testName) {
+ public AbstractMultiValuedMapTest(String testName) {
super(testName);
}
@@ -146,7 +146,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
return map;
}
- protected void addSampleMappings(final MultiValuedMap<? super K, ? super V> map) {
+ protected void addSampleMappings(MultiValuedMap<? super K, ? super V> map) {
final K[] keys = getSampleKeys();
final V[] values = getSampleValues();
for (int i = 0; i < keys.length; i++) {
@@ -168,7 +168,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
return this.confirmed;
}
- public void setConfirmed(final MultiValuedMap<K, V> map) {
+ public void setConfirmed(MultiValuedMap<K, V> map) {
this.confirmed = map;
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java
index 57b38f6..286c0b3 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java
@@ -32,7 +32,7 @@ import org.apache.commons.collections4.MultiValuedMap;
*/
public class ArrayListValuedHashMapTest<K, V> extends AbstractMultiValuedMapTest<K, V> {
- public ArrayListValuedHashMapTest(final String testName) {
+ public ArrayListValuedHashMapTest(String testName) {
super(testName);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java
index 7455831..61d5538 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java
@@ -32,7 +32,7 @@ import org.apache.commons.collections4.SetValuedMap;
*/
public class HashSetValuedHashMapTest<K, V> extends AbstractMultiValuedMapTest<K, V> {
- public HashSetValuedHashMapTest(final String testName) {
+ public HashSetValuedHashMapTest(String testName) {
super(testName);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/test/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMapTest.java
index 0133ee0..5f16087 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMapTest.java
@@ -33,7 +33,7 @@ import org.apache.commons.collections4.collection.TransformedCollectionTest;
*/
public class TransformedMultiValuedMapTest<K, V> extends AbstractMultiValuedMapTest<K, V> {
- public TransformedMultiValuedMapTest(final String testName) {
+ public TransformedMultiValuedMapTest(String testName) {
super(testName);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/b5eb4fcc/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java
index ad2d776..5851ce0 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java
@@ -38,7 +38,7 @@ import org.apache.commons.collections4.Unmodifiable;
*/
public class UnmodifiableMultiValuedMapTest<K, V> extends AbstractMultiValuedMapTest<K, V> {
- public UnmodifiableMultiValuedMapTest(final String testName) {
+ public UnmodifiableMultiValuedMapTest(String testName) {
super(testName);
}
[3/5] commons-collections git commit: Revert "Use final for locals."
Posted by gg...@apache.org.
Revert "Use final for locals."
This reverts commit 712ddb1e193967c27f5624485938e7de5d732c6b.
Project: http://git-wip-us.apache.org/repos/asf/commons-collections/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-collections/commit/992ab3c9
Tree: http://git-wip-us.apache.org/repos/asf/commons-collections/tree/992ab3c9
Diff: http://git-wip-us.apache.org/repos/asf/commons-collections/diff/992ab3c9
Branch: refs/heads/master
Commit: 992ab3c9f2855034f24ee3f7638f57126bc1cb93
Parents: 712ddb1
Author: Gary Gregory <gg...@apache.org>
Authored: Wed Oct 11 16:33:54 2017 -0600
Committer: Gary Gregory <gg...@apache.org>
Committed: Wed Oct 11 16:33:54 2017 -0600
----------------------------------------------------------------------
.../commons/collections4/CollectionUtils.java | 2 +-
.../commons/collections4/IterableUtils.java | 3 +-
.../apache/commons/collections4/ListUtils.java | 2 +-
.../commons/collections4/MultiMapUtils.java | 6 +-
.../collections4/bidimap/TreeBidiMap.java | 6 +-
.../collection/PredicatedCollection.java | 2 +-
.../iterators/PermutationIterator.java | 6 +-
.../collections4/list/SetUniqueList.java | 2 +-
.../multimap/AbstractListValuedMap.java | 8 +-
.../multimap/AbstractMultiValuedMap.java | 28 ++++---
.../multimap/AbstractSetValuedMap.java | 2 +-
.../multimap/ArrayListValuedHashMap.java | 2 +-
.../multimap/TransformedMultiValuedMap.java | 4 +-
.../multiset/AbstractMapMultiSet.java | 4 +-
.../collections4/multiset/AbstractMultiSet.java | 8 +-
.../commons/collections4/set/CompositeSet.java | 2 +-
.../collections4/set/ListOrderedSet.java | 4 +-
.../collections4/trie/AbstractPatriciaTrie.java | 10 +--
.../commons/collections4/BagUtilsTest.java | 16 ++--
.../collections4/CollectionUtilsTest.java | 42 +++++-----
.../collections4/ComparatorUtilsTest.java | 18 ++---
.../commons/collections4/FactoryUtilsTest.java | 2 +-
.../collections4/FluentIterableTest.java | 82 ++++++++++----------
.../commons/collections4/IterableUtilsTest.java | 46 +++++------
.../commons/collections4/IteratorUtilsTest.java | 10 +--
.../commons/collections4/ListUtilsTest.java | 18 ++---
.../commons/collections4/MapUtilsTest.java | 4 +-
.../commons/collections4/MultiMapUtilsTest.java | 36 ++++-----
.../commons/collections4/QueueUtilsTest.java | 8 +-
.../commons/collections4/SetUtilsTest.java | 24 +++---
.../collections4/TransformerUtilsTest.java | 4 +-
.../commons/collections4/TrieUtilsTest.java | 2 +-
.../bidimap/DualTreeBidiMap2Test.java | 2 +-
.../collection/AbstractCollectionTest.java | 10 +--
.../PredicatedCollectionBuilderTest.java | 32 ++++----
.../comparators/TransformingComparatorTest.java | 6 +-
.../iterators/BoundedIteratorTest.java | 62 +++++++--------
.../iterators/IteratorEnumerationTest.java | 6 +-
.../iterators/PeekingIteratorTest.java | 16 ++--
.../iterators/PermutationIteratorTest.java | 44 +++++------
.../iterators/PushbackIteratorTest.java | 8 +-
.../iterators/SkippingIteratorTest.java | 52 ++++++-------
.../iterators/ZippingIteratorTest.java | 2 +-
.../collections4/list/AbstractListTest.java | 2 +-
.../collections4/list/SetUniqueListTest.java | 4 +-
.../commons/collections4/list/TreeListTest.java | 22 +++---
.../collections4/map/AbstractMapTest.java | 4 +-
.../collections4/map/AbstractSortedMapTest.java | 2 +-
.../commons/collections4/map/LRUMapTest.java | 14 ++--
.../collections4/map/ListOrderedMapTest.java | 16 ++--
.../collections4/map/MultiValueMapTest.java | 19 +++--
.../map/PassiveExpiringMapTest.java | 2 +-
.../multimap/AbstractMultiValuedMapTest.java | 70 ++++++++---------
.../multimap/ArrayListValuedHashMapTest.java | 14 ++--
.../multimap/HashSetValuedHashMapTest.java | 12 +--
.../multimap/TransformedMultiValuedMapTest.java | 6 +-
.../UnmodifiableMultiValuedMapTest.java | 70 ++++++++---------
.../collections4/queue/AbstractQueueTest.java | 2 +-
.../queue/CircularFifoQueueTest.java | 2 +-
.../sequence/SequencesComparatorTest.java | 2 +-
.../collections4/set/AbstractSetTest.java | 2 +-
.../collections4/trie/PatriciaTrieTest.java | 16 ++--
62 files changed, 464 insertions(+), 470 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/CollectionUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/CollectionUtils.java b/src/main/java/org/apache/commons/collections4/CollectionUtils.java
index 7a92bf1..1b54be5 100644
--- a/src/main/java/org/apache/commons/collections4/CollectionUtils.java
+++ b/src/main/java/org/apache/commons/collections4/CollectionUtils.java
@@ -1245,7 +1245,7 @@ public class CollectionUtils {
* @throws IllegalArgumentException if the object type is invalid
*/
public static Object get(final Object object, final int index) {
- final int i = index;
+ int i = index;
if (i < 0) {
throw new IndexOutOfBoundsException("Index cannot be negative: " + i);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/IterableUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/IterableUtils.java b/src/main/java/org/apache/commons/collections4/IterableUtils.java
index 9a9dae8..15e50c2 100644
--- a/src/main/java/org/apache/commons/collections4/IterableUtils.java
+++ b/src/main/java/org/apache/commons/collections4/IterableUtils.java
@@ -548,7 +548,6 @@ public class IterableUtils {
@Override
public Iterator<E> iterator() {
@SuppressWarnings("unchecked") // safe
- final
Iterator<? extends E>[] iterators = new Iterator[others.length + 1];
iterators[0] = first.iterator();
for (int i = 0; i < others.length; i++) {
@@ -921,7 +920,7 @@ public class IterableUtils {
throw new NullPointerException("Predicates must not be null.");
}
- for (final Predicate<?> p : predicates) {
+ for (Predicate<?> p : predicates) {
if (p == null) {
throw new NullPointerException("Predicate must not be null.");
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/ListUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/ListUtils.java b/src/main/java/org/apache/commons/collections4/ListUtils.java
index d615094..c5fe813 100644
--- a/src/main/java/org/apache/commons/collections4/ListUtils.java
+++ b/src/main/java/org/apache/commons/collections4/ListUtils.java
@@ -569,7 +569,7 @@ public class ListUtils {
}
final List<Character> lcs = longestCommonSubsequence(new CharSequenceAsList( a ), new CharSequenceAsList( b ));
final StringBuilder sb = new StringBuilder();
- for ( final Character ch : lcs ) {
+ for ( Character ch : lcs ) {
sb.append(ch);
}
return sb.toString();
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/MultiMapUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/MultiMapUtils.java b/src/main/java/org/apache/commons/collections4/MultiMapUtils.java
index e523e1b..118f7e6 100644
--- a/src/main/java/org/apache/commons/collections4/MultiMapUtils.java
+++ b/src/main/java/org/apache/commons/collections4/MultiMapUtils.java
@@ -127,7 +127,7 @@ public class MultiMapUtils {
*/
public static <K, V> List<V> getValuesAsList(final MultiValuedMap<K, V> map, final K key) {
if (map != null) {
- final Collection<V> col = map.get(key);
+ Collection<V> col = map.get(key);
if (col instanceof List) {
return (List<V>) col;
}
@@ -147,7 +147,7 @@ public class MultiMapUtils {
*/
public static <K, V> Set<V> getValuesAsSet(final MultiValuedMap<K, V> map, final K key) {
if (map != null) {
- final Collection<V> col = map.get(key);
+ Collection<V> col = map.get(key);
if (col instanceof Set) {
return (Set<V>) col;
}
@@ -167,7 +167,7 @@ public class MultiMapUtils {
*/
public static <K, V> Bag<V> getValuesAsBag(final MultiValuedMap<K, V> map, final K key) {
if (map != null) {
- final Collection<V> col = map.get(key);
+ Collection<V> col = map.get(key);
if (col instanceof Bag) {
return (Bag<V>) col;
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java b/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java
index 2a2042f..1f48b9c 100644
--- a/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java
+++ b/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java
@@ -1439,10 +1439,10 @@ public class TreeBidiMap<K extends Comparable<K>, V extends Comparable<V>>
private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException{
stream.defaultReadObject();
rootNode = new Node[2];
- final int size = stream.readInt();
+ int size = stream.readInt();
for(int i = 0; i < size; i++){
- final K k =(K) stream.readObject();
- final V v =(V) stream.readObject();
+ K k =(K) stream.readObject();
+ V v =(V) stream.readObject();
put(k, v);
}
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/collection/PredicatedCollection.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/collection/PredicatedCollection.java b/src/main/java/org/apache/commons/collections4/collection/PredicatedCollection.java
index 2753964..3f14664 100644
--- a/src/main/java/org/apache/commons/collections4/collection/PredicatedCollection.java
+++ b/src/main/java/org/apache/commons/collections4/collection/PredicatedCollection.java
@@ -256,7 +256,7 @@ public class PredicatedCollection<E> extends AbstractCollectionDecorator<E> {
*/
public Builder<E> addAll(final Collection<? extends E> items) {
if (items != null) {
- for (final E item : items) {
+ for (E item : items) {
add(item);
}
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java b/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java
index 1b7caa6..c0c5fe8 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java
@@ -82,7 +82,7 @@ public class PermutationIterator<E> implements Iterator<List<E>> {
Arrays.fill(direction, false);
int value = 1;
objectMap = new HashMap<>();
- for (final E e : coll) {
+ for (E e : coll) {
objectMap.put(Integer.valueOf(value), e);
keys[value - 1] = value;
value++;
@@ -123,7 +123,7 @@ public class PermutationIterator<E> implements Iterator<List<E>> {
}
}
if (largestKey == -1) {
- final List<E> toReturn = nextPermutation;
+ List<E> toReturn = nextPermutation;
nextPermutation = null;
return toReturn;
}
@@ -133,7 +133,7 @@ public class PermutationIterator<E> implements Iterator<List<E>> {
final int tmpKey = keys[indexOfLargestMobileInteger];
keys[indexOfLargestMobileInteger] = keys[indexOfLargestMobileInteger + offset];
keys[indexOfLargestMobileInteger + offset] = tmpKey;
- final boolean tmpDirection = direction[indexOfLargestMobileInteger];
+ boolean tmpDirection = direction[indexOfLargestMobileInteger];
direction[indexOfLargestMobileInteger] = direction[indexOfLargestMobileInteger + offset];
direction[indexOfLargestMobileInteger + offset] = tmpDirection;
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/list/SetUniqueList.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/list/SetUniqueList.java b/src/main/java/org/apache/commons/collections4/list/SetUniqueList.java
index 8aa0815..3291145 100644
--- a/src/main/java/org/apache/commons/collections4/list/SetUniqueList.java
+++ b/src/main/java/org/apache/commons/collections4/list/SetUniqueList.java
@@ -261,7 +261,7 @@ public class SetUniqueList<E> extends AbstractSerializableListDecorator<E> {
*/
@Override
public boolean retainAll(final Collection<?> coll) {
- final boolean result = set.retainAll(coll);
+ boolean result = set.retainAll(coll);
if (result == false) {
return false;
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java
index a41631f..ffe6978 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractListValuedMap.java
@@ -130,7 +130,7 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
List<V> list = getMapping();
if (list == null) {
list = createCollection();
- final boolean changed = list.addAll(index, c);
+ boolean changed = list.addAll(index, c);
if (changed) {
getMap().put(key, list);
}
@@ -170,7 +170,7 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
@Override
public V remove(final int index) {
final List<V> list = ListUtils.emptyIfNull(getMapping());
- final V value = list.remove(index);
+ V value = list.remove(index);
if (list.isEmpty()) {
AbstractListValuedMap.this.remove(key);
}
@@ -198,7 +198,7 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
if (!(other instanceof List)) {
return false;
}
- final List<?> otherList = (List<?>) other;
+ List<?> otherList = (List<?>) other;
return ListUtils.isEqualList(list, otherList);
}
@@ -232,7 +232,7 @@ public abstract class AbstractListValuedMap<K, V> extends AbstractMultiValuedMap
@Override
public void add(final V value) {
if (getMap().get(key) == null) {
- final List<V> list = createCollection();
+ List<V> list = createCollection();
getMap().put(key, list);
this.values = list;
this.iterator = list.listIterator();
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java
index 2ca6611..8927185 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java
@@ -128,7 +128,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
@Override
public boolean containsMapping(final Object key, final Object value) {
- final Collection<V> coll = getMap().get(key);
+ Collection<V> coll = getMap().get(key);
return coll != null && coll.contains(value);
}
@@ -186,7 +186,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
if (coll == null) {
return false;
}
- final boolean changed = coll.remove(value);
+ boolean changed = coll.remove(value);
if (coll.isEmpty()) {
getMap().remove(key);
}
@@ -285,7 +285,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
throw new NullPointerException("Map must not be null.");
}
boolean changed = false;
- for (final Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
+ for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
changed |= put(entry.getKey(), entry.getValue());
}
return changed;
@@ -309,7 +309,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
throw new NullPointerException("Map must not be null.");
}
boolean changed = false;
- for (final Map.Entry<? extends K, ? extends V> entry : map.entries()) {
+ for (Map.Entry<? extends K, ? extends V> entry : map.entries()) {
changed |= put(entry.getKey(), entry.getValue());
}
return changed;
@@ -353,10 +353,10 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
}
if (values instanceof Collection<?>) {
- final Collection<? extends V> valueCollection = (Collection<? extends V>) values;
+ Collection<? extends V> valueCollection = (Collection<? extends V>) values;
return !valueCollection.isEmpty() && get(key).addAll(valueCollection);
} else {
- final Iterator<? extends V> it = values.iterator();
+ Iterator<? extends V> it = values.iterator();
return it.hasNext() && CollectionUtils.addAll(get(key), it);
}
}
@@ -484,7 +484,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
return false;
}
- final boolean result = coll.remove(item);
+ boolean result = coll.remove(item);
if (coll.isEmpty()) {
AbstractMultiValuedMap.this.remove(key);
}
@@ -498,7 +498,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
return false;
}
- final boolean result = coll.removeAll(c);
+ boolean result = coll.removeAll(c);
if (coll.isEmpty()) {
AbstractMultiValuedMap.this.remove(key);
}
@@ -512,7 +512,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
return false;
}
- final boolean result = coll.retainAll(c);
+ boolean result = coll.retainAll(c);
if (coll.isEmpty()) {
AbstractMultiValuedMap.this.remove(key);
}
@@ -577,7 +577,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
@Override
public int getCount(final Object object) {
int count = 0;
- final Collection<V> col = AbstractMultiValuedMap.this.getMap().get(object);
+ Collection<V> col = AbstractMultiValuedMap.this.getMap().get(object);
if (col != null) {
count = col.size();
}
@@ -797,12 +797,11 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
@Override
public Collection<V> get(final Object key) {
- final Collection<V> collection = decoratedMap.get(key);
+ Collection<V> collection = decoratedMap.get(key);
if (collection == null) {
return null;
}
@SuppressWarnings("unchecked")
- final
K k = (K) key;
return wrappedCollection(k);
}
@@ -819,7 +818,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
@Override
public Collection<V> remove(final Object key) {
- final Collection<V> collection = decoratedMap.remove(key);
+ Collection<V> collection = decoratedMap.remove(key);
if (collection == null) {
return null;
}
@@ -877,7 +876,7 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
if (!contains(o)) {
return false;
}
- final Map.Entry<?, ?> entry = (Map.Entry<?, ?>) o;
+ Map.Entry<?, ?> entry = (Map.Entry<?, ?>) o;
AbstractMultiValuedMap.this.remove(entry.getKey());
return true;
}
@@ -935,7 +934,6 @@ public abstract class AbstractMultiValuedMap<K, V> implements MultiValuedMap<K,
final int valueSize = in.readInt();
for (int j = 0; j < valueSize; j++) {
@SuppressWarnings("unchecked") // see above
- final
V value = (V) in.readObject();
values.add(value);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java
index d202b7d..88704f6 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/AbstractSetValuedMap.java
@@ -119,7 +119,7 @@ public abstract class AbstractSetValuedMap<K, V> extends AbstractMultiValuedMap<
if (!(other instanceof Set)) {
return false;
}
- final Set<?> otherSet = (Set<?>) other;
+ Set<?> otherSet = (Set<?>) other;
return SetUtils.isEqualSet(set, otherSet);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java b/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java
index 1ffa674..74255e3 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMap.java
@@ -121,7 +121,7 @@ public class ArrayListValuedHashMap<K, V> extends AbstractListValuedMap<K, V>
* Trims the capacity of all value collections to their current size.
*/
public void trimToSize() {
- for (final Collection<V> coll : getMap().values()) {
+ for (Collection<V> coll : getMap().values()) {
final ArrayList<V> list = (ArrayList<V>) coll;
list.trimToSize();
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMap.java b/src/main/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMap.java
index 51cc861..ed1e17a 100644
--- a/src/main/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMap.java
+++ b/src/main/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMap.java
@@ -169,7 +169,7 @@ public class TransformedMultiValuedMap<K, V> extends AbstractMultiValuedMapDecor
throw new NullPointerException("Map must not be null.");
}
boolean changed = false;
- for (final Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
+ for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
changed |= put(entry.getKey(), entry.getValue());
}
return changed;
@@ -181,7 +181,7 @@ public class TransformedMultiValuedMap<K, V> extends AbstractMultiValuedMapDecor
throw new NullPointerException("Map must not be null.");
}
boolean changed = false;
- for (final Map.Entry<? extends K, ? extends V> entry : map.entries()) {
+ for (Map.Entry<? extends K, ? extends V> entry : map.entries()) {
changed |= put(entry.getKey(), entry.getValue());
}
return changed;
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java b/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java
index 27560fb..f6a0cd8 100644
--- a/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java
+++ b/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java
@@ -220,7 +220,7 @@ public abstract class AbstractMapMultiSet<E> extends AbstractMultiSet<E> {
}
final MutableInteger mut = map.get(object);
- final int oldCount = mut != null ? mut.value : 0;
+ int oldCount = mut != null ? mut.value : 0;
if (occurrences > 0) {
modCount++;
@@ -255,7 +255,7 @@ public abstract class AbstractMapMultiSet<E> extends AbstractMultiSet<E> {
if (mut == null) {
return 0;
}
- final int oldCount = mut.value;
+ int oldCount = mut.value;
if (occurrences > 0) {
modCount++;
if (occurrences < mut.value) {
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSet.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSet.java b/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSet.java
index d3561cd..46624cc 100644
--- a/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSet.java
+++ b/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSet.java
@@ -58,7 +58,7 @@ public abstract class AbstractMultiSet<E> extends AbstractCollection<E> implemen
@Override
public int size() {
int totalSize = 0;
- for (final Entry<E> entry : entrySet()) {
+ for (Entry<E> entry : entrySet()) {
totalSize += entry.getCount();
}
return totalSize;
@@ -73,7 +73,7 @@ public abstract class AbstractMultiSet<E> extends AbstractCollection<E> implemen
*/
@Override
public int getCount(final Object object) {
- for (final Entry<E> entry : entrySet()) {
+ for (Entry<E> entry : entrySet()) {
final E element = entry.getElement();
if (element == object ||
element != null && element.equals(object)) {
@@ -89,7 +89,7 @@ public abstract class AbstractMultiSet<E> extends AbstractCollection<E> implemen
throw new IllegalArgumentException("Count must not be negative.");
}
- final int oldCount = getCount(object);
+ int oldCount = getCount(object);
if (oldCount < count) {
add(object, count - oldCount);
} else {
@@ -196,7 +196,7 @@ public abstract class AbstractMultiSet<E> extends AbstractCollection<E> implemen
*/
@Override
public void clear() {
- final Iterator<Entry<E>> it = entrySet().iterator();
+ Iterator<Entry<E>> it = entrySet().iterator();
while (it.hasNext()) {
it.next();
it.remove();
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/set/CompositeSet.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/set/CompositeSet.java b/src/main/java/org/apache/commons/collections4/set/CompositeSet.java
index 2aeef90..104a179 100644
--- a/src/main/java/org/apache/commons/collections4/set/CompositeSet.java
+++ b/src/main/java/org/apache/commons/collections4/set/CompositeSet.java
@@ -387,7 +387,7 @@ public class CompositeSet<E> implements Set<E>, Serializable {
* @param sets the Sets to be appended to the composite
*/
public void addComposited(final Set<E>... sets) {
- for (final Set<E> set : sets) {
+ for (Set<E> set : sets) {
addComposited(set);
}
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java b/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java
index 7075880..65f7184 100644
--- a/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java
+++ b/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java
@@ -235,14 +235,14 @@ public class ListOrderedSet<E>
*/
@Override
public boolean retainAll(final Collection<?> coll) {
- final boolean result = decorated().retainAll(coll);
+ boolean result = decorated().retainAll(coll);
if (result == false) {
return false;
}
if (decorated().size() == 0) {
setOrder.clear();
} else {
- for (final Iterator<E> it = setOrder.iterator(); it.hasNext();) {
+ for (Iterator<E> it = setOrder.iterator(); it.hasNext();) {
if (!decorated().contains(it.next())) {
it.remove();
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java b/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java
index 37da91e..8508a91 100644
--- a/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java
+++ b/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java
@@ -2260,8 +2260,8 @@ abstract class AbstractPatriciaTrie<K, V> extends AbstractBitwiseTrie<K, V> {
@Override
public void clear() {
- final Iterator<Map.Entry<K, V>> it = AbstractPatriciaTrie.this.entrySet().iterator();
- final Set<K> currentKeys = keySet();
+ Iterator<Map.Entry<K, V>> it = AbstractPatriciaTrie.this.entrySet().iterator();
+ Set<K> currentKeys = keySet();
while (it.hasNext()) {
if (currentKeys.contains(it.next().getKey())) {
it.remove();
@@ -2427,10 +2427,10 @@ abstract class AbstractPatriciaTrie<K, V> extends AbstractBitwiseTrie<K, V> {
private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException{
stream.defaultReadObject();
root = new TrieEntry<>(null, null, -1);
- final int size = stream.readInt();
+ int size = stream.readInt();
for(int i = 0; i < size; i++){
- final K k = (K) stream.readObject();
- final V v = (V) stream.readObject();
+ K k = (K) stream.readObject();
+ V v = (V) stream.readObject();
put(k, v);
}
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/BagUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/BagUtilsTest.java b/src/test/java/org/apache/commons/collections4/BagUtilsTest.java
index caba278..6d0f856 100644
--- a/src/test/java/org/apache/commons/collections4/BagUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/BagUtilsTest.java
@@ -44,7 +44,7 @@ public class BagUtilsTest {
@Test
public void testSynchronizedBag() {
- final Bag<Object> bag = BagUtils.synchronizedBag(new HashBag<>());
+ Bag<Object> bag = BagUtils.synchronizedBag(new HashBag<>());
assertTrue("Returned object should be a SynchronizedBag.",
bag instanceof SynchronizedBag);
try {
@@ -57,7 +57,7 @@ public class BagUtilsTest {
@Test
public void testUnmodifiableBag() {
- final Bag<Object> bag = BagUtils.unmodifiableBag(new HashBag<>());
+ Bag<Object> bag = BagUtils.unmodifiableBag(new HashBag<>());
assertTrue("Returned object should be an UnmodifiableBag.",
bag instanceof UnmodifiableBag);
try {
@@ -72,7 +72,7 @@ public class BagUtilsTest {
@Test
public void testPredicatedBag() {
- final Bag<Object> bag = BagUtils.predicatedBag(new HashBag<>(), truePredicate);
+ Bag<Object> bag = BagUtils.predicatedBag(new HashBag<>(), truePredicate);
assertTrue("Returned object should be a PredicatedBag.",
bag instanceof PredicatedBag);
try {
@@ -91,7 +91,7 @@ public class BagUtilsTest {
@Test
public void testTransformedBag() {
- final Bag<Object> bag = BagUtils.transformingBag(new HashBag<>(), nopTransformer);
+ Bag<Object> bag = BagUtils.transformingBag(new HashBag<>(), nopTransformer);
assertTrue("Returned object should be an TransformedBag.",
bag instanceof TransformedBag);
try {
@@ -110,7 +110,7 @@ public class BagUtilsTest {
@Test
public void testSynchronizedSortedBag() {
- final Bag<Object> bag = BagUtils.synchronizedSortedBag(new TreeBag<>());
+ Bag<Object> bag = BagUtils.synchronizedSortedBag(new TreeBag<>());
assertTrue("Returned object should be a SynchronizedSortedBag.",
bag instanceof SynchronizedSortedBag);
try {
@@ -123,7 +123,7 @@ public class BagUtilsTest {
@Test
public void testUnmodifiableSortedBag() {
- final SortedBag<Object> bag = BagUtils.unmodifiableSortedBag(new TreeBag<>());
+ SortedBag<Object> bag = BagUtils.unmodifiableSortedBag(new TreeBag<>());
assertTrue("Returned object should be an UnmodifiableSortedBag.",
bag instanceof UnmodifiableSortedBag);
try {
@@ -138,7 +138,7 @@ public class BagUtilsTest {
@Test
public void testPredicatedSortedBag() {
- final Bag<Object> bag = BagUtils.predicatedSortedBag(new TreeBag<>(), truePredicate);
+ Bag<Object> bag = BagUtils.predicatedSortedBag(new TreeBag<>(), truePredicate);
assertTrue("Returned object should be a PredicatedSortedBag.",
bag instanceof PredicatedSortedBag);
try {
@@ -157,7 +157,7 @@ public class BagUtilsTest {
@Test
public void testTransformedSortedBag() {
- final Bag<Object> bag = BagUtils.transformingSortedBag(new TreeBag<>(), nopTransformer);
+ Bag<Object> bag = BagUtils.transformingSortedBag(new TreeBag<>(), nopTransformer);
assertTrue("Returned object should be an TransformedSortedBag",
bag instanceof TransformedSortedBag);
try {
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java b/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
index 866a4fd..60fc30c 100644
--- a/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java
@@ -698,7 +698,7 @@ public class CollectionUtilsTest extends MockTestCase {
lastElement = CollectionUtils.forAllButLastDo(col, testClosure);
assertNull(lastElement);
- final Collection<String> strings = Arrays.asList("a", "b", "c");
+ Collection<String> strings = Arrays.asList("a", "b", "c");
final StringBuffer result = new StringBuffer();
result.append(CollectionUtils.forAllButLastDo(strings, new Closure<String>() {
@Override
@@ -708,7 +708,7 @@ public class CollectionUtilsTest extends MockTestCase {
}));
assertEquals("a;b;c", result.toString());
- final Collection<String> oneString = Arrays.asList("a");
+ Collection<String> oneString = Arrays.asList("a");
final StringBuffer resultOne = new StringBuffer();
resultOne.append(CollectionUtils.forAllButLastDo(oneString, new Closure<String>() {
@Override
@@ -728,7 +728,7 @@ public class CollectionUtilsTest extends MockTestCase {
final Collection<List<? extends Number>> col = new ArrayList<>();
col.add(collectionA);
col.add(collectionB);
- final List<? extends Number> lastElement = CollectionUtils.forAllButLastDo(col.iterator(), testClosure);
+ List<? extends Number> lastElement = CollectionUtils.forAllButLastDo(col.iterator(), testClosure);
assertSame(lastElement, collectionB);
assertTrue(collectionA.isEmpty() && !collectionB.isEmpty());
@@ -1178,14 +1178,14 @@ public class CollectionUtilsTest extends MockTestCase {
@Test
public void selectWithOutputCollections() {
- final List<Integer> input = new ArrayList<>();
+ List<Integer> input = new ArrayList<>();
input.add(1);
input.add(2);
input.add(3);
input.add(4);
- final List<Integer> output = new ArrayList<>();
- final List<Integer> rejected = new ArrayList<>();
+ List<Integer> output = new ArrayList<>();
+ List<Integer> rejected = new ArrayList<>();
CollectionUtils.select(input, EQUALS_TWO, output, rejected);
@@ -1194,7 +1194,7 @@ public class CollectionUtilsTest extends MockTestCase {
assertEquals(2, CollectionUtils.extractSingleton(output).intValue());
// rejected contains 1, 3, and 4
- final Integer[] expected = {1, 3, 4};
+ Integer[] expected = {1, 3, 4};
Assert.assertArrayEquals(expected, rejected.toArray());
output.clear();
@@ -1330,7 +1330,7 @@ public class CollectionUtilsTest extends MockTestCase {
@Test
public void predicatedCollection() {
final Predicate<Object> predicate = PredicateUtils.instanceofPredicate(Integer.class);
- final Collection<Number> collection = CollectionUtils.predicatedCollection(new ArrayList<Number>(), predicate);
+ Collection<Number> collection = CollectionUtils.predicatedCollection(new ArrayList<Number>(), predicate);
assertTrue("returned object should be a PredicatedCollection", collection instanceof PredicatedCollection);
try {
CollectionUtils.predicatedCollection(new ArrayList<Number>(), null);
@@ -1505,7 +1505,7 @@ public class CollectionUtilsTest extends MockTestCase {
@Test
public void testTransformedCollection() {
final Transformer<Object, Object> transformer = TransformerUtils.nopTransformer();
- final Collection<Object> collection = CollectionUtils.transformingCollection(new ArrayList<>(), transformer);
+ Collection<Object> collection = CollectionUtils.transformingCollection(new ArrayList<>(), transformer);
assertTrue("returned object should be a TransformedCollection", collection instanceof TransformedCollection);
try {
CollectionUtils.transformingCollection(new ArrayList<>(), null);
@@ -1536,7 +1536,7 @@ public class CollectionUtilsTest extends MockTestCase {
@Test
@Deprecated
public void testSynchronizedCollection() {
- final Collection<Object> col = CollectionUtils.synchronizedCollection(new ArrayList<>());
+ Collection<Object> col = CollectionUtils.synchronizedCollection(new ArrayList<>());
assertTrue("Returned object should be a SynchronizedCollection.", col instanceof SynchronizedCollection);
try {
CollectionUtils.synchronizedCollection(null);
@@ -1549,7 +1549,7 @@ public class CollectionUtilsTest extends MockTestCase {
@Test
@Deprecated
public void testUnmodifiableCollection() {
- final Collection<Object> col = CollectionUtils.unmodifiableCollection(new ArrayList<>());
+ Collection<Object> col = CollectionUtils.unmodifiableCollection(new ArrayList<>());
assertTrue("Returned object should be a UnmodifiableCollection.", col instanceof UnmodifiableCollection);
try {
CollectionUtils.unmodifiableCollection(null);
@@ -1735,7 +1735,7 @@ public class CollectionUtilsTest extends MockTestCase {
List<Integer> result2 = CollectionUtils.collate(collectionE, collectionD);
assertEquals("Merge two lists 1", result1, result2);
- final List<Integer> combinedList = new ArrayList<>();
+ List<Integer> combinedList = new ArrayList<>();
combinedList.addAll(collectionD);
combinedList.addAll(collectionE);
Collections.sort(combinedList);
@@ -1760,14 +1760,14 @@ public class CollectionUtilsTest extends MockTestCase {
@Test
public void testCollateIgnoreDuplicates() {
- final List<Integer> result1 = CollectionUtils.collate(collectionD, collectionE, false);
- final List<Integer> result2 = CollectionUtils.collate(collectionE, collectionD, false);
+ List<Integer> result1 = CollectionUtils.collate(collectionD, collectionE, false);
+ List<Integer> result2 = CollectionUtils.collate(collectionE, collectionD, false);
assertEquals("Merge two lists 1 - ignore duplicates", result1, result2);
- final Set<Integer> combinedSet = new HashSet<>();
+ Set<Integer> combinedSet = new HashSet<>();
combinedSet.addAll(collectionD);
combinedSet.addAll(collectionE);
- final List<Integer> combinedList = new ArrayList<>(combinedSet);
+ List<Integer> combinedList = new ArrayList<>(combinedSet);
Collections.sort(combinedList);
assertEquals("Merge two lists 2 - ignore duplicates", combinedList, result2);
@@ -1780,11 +1780,11 @@ public class CollectionUtilsTest extends MockTestCase {
@Test
public void testPermutations() {
- final List<Integer> sample = collectionA.subList(0, 5);
- final Collection<List<Integer>> permutations = CollectionUtils.permutations(sample);
+ List<Integer> sample = collectionA.subList(0, 5);
+ Collection<List<Integer>> permutations = CollectionUtils.permutations(sample);
// result size = n!
- final int collSize = sample.size();
+ int collSize = sample.size();
int factorial = 1;
for (int i = 1; i <= collSize; i++) {
factorial *= i;
@@ -1798,7 +1798,7 @@ public class CollectionUtilsTest extends MockTestCase {
assertFalse(CollectionUtils.matchesAll(null, null));
assertFalse(CollectionUtils.matchesAll(collectionA, null));
- final Predicate<Integer> lessThanFive = new Predicate<Integer>() {
+ Predicate<Integer> lessThanFive = new Predicate<Integer>() {
@Override
public boolean evaluate(final Integer object) {
return object < 5;
@@ -1806,7 +1806,7 @@ public class CollectionUtilsTest extends MockTestCase {
};
assertTrue(CollectionUtils.matchesAll(collectionA, lessThanFive));
- final Predicate<Integer> lessThanFour = new Predicate<Integer>() {
+ Predicate<Integer> lessThanFour = new Predicate<Integer>() {
@Override
public boolean evaluate(final Integer object) {
return object < 4;
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/ComparatorUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/ComparatorUtilsTest.java b/src/test/java/org/apache/commons/collections4/ComparatorUtilsTest.java
index a5aa3b7..4c4b1a9 100644
--- a/src/test/java/org/apache/commons/collections4/ComparatorUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/ComparatorUtilsTest.java
@@ -46,7 +46,7 @@ public class ComparatorUtilsTest {
@Test
public void chainedComparator() {
// simple test: chain 2 natural comparators
- final Comparator<Integer> comp = ComparatorUtils.chainedComparator(ComparatorUtils.<Integer>naturalComparator(),
+ Comparator<Integer> comp = ComparatorUtils.chainedComparator(ComparatorUtils.<Integer>naturalComparator(),
ComparatorUtils.<Integer>naturalComparator());
assertTrue(comp.compare(1, 2) < 0);
assertTrue(comp.compare(1, 1) == 0);
@@ -55,7 +55,7 @@ public class ComparatorUtilsTest {
@Test
public void max() {
- final Comparator<Integer> reversed =
+ Comparator<Integer> reversed =
ComparatorUtils.reversedComparator(ComparatorUtils.<Integer>naturalComparator());
assertEquals(Integer.valueOf(10), ComparatorUtils.max(1, 10, null));
@@ -67,21 +67,21 @@ public class ComparatorUtilsTest {
try {
ComparatorUtils.max(1, null, null);
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
try {
ComparatorUtils.max(null, 10, null);
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
}
@Test
public void min() {
- final Comparator<Integer> reversed =
+ Comparator<Integer> reversed =
ComparatorUtils.reversedComparator(ComparatorUtils.<Integer>naturalComparator());
assertEquals(Integer.valueOf(1), ComparatorUtils.min(1, 10, null));
@@ -93,21 +93,21 @@ public class ComparatorUtilsTest {
try {
ComparatorUtils.min(1, null, null);
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
try {
ComparatorUtils.min(null, 10, null);
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
}
@Test
public void nullLowComparator() {
- final Comparator<Integer> comp = ComparatorUtils.nullLowComparator(null);
+ Comparator<Integer> comp = ComparatorUtils.nullLowComparator(null);
assertTrue(comp.compare(null, 10) < 0);
assertTrue(comp.compare(null, null) == 0);
assertTrue(comp.compare(10, null) > 0);
@@ -115,7 +115,7 @@ public class ComparatorUtilsTest {
@Test
public void nullHighComparator() {
- final Comparator<Integer> comp = ComparatorUtils.nullHighComparator(null);
+ Comparator<Integer> comp = ComparatorUtils.nullHighComparator(null);
assertTrue(comp.compare(null, 10) > 0);
assertTrue(comp.compare(null, null) == 0);
assertTrue(comp.compare(10, null) < 0);
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/FactoryUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/FactoryUtilsTest.java b/src/test/java/org/apache/commons/collections4/FactoryUtilsTest.java
index 5dcfcea..697caac 100644
--- a/src/test/java/org/apache/commons/collections4/FactoryUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/FactoryUtilsTest.java
@@ -110,7 +110,7 @@ public class FactoryUtilsTest {
@Test
public void testPrototypeFactoryPublicCopyConstructor() throws Exception {
final Mock1 proto = new Mock1(6);
- final Factory<Object> factory = FactoryUtils.<Object>prototypeFactory(proto);
+ Factory<Object> factory = FactoryUtils.<Object>prototypeFactory(proto);
assertNotNull(factory);
final Object created = factory.create();
assertTrue(proto != created);
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/FluentIterableTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/FluentIterableTest.java b/src/test/java/org/apache/commons/collections4/FluentIterableTest.java
index c1d9de0..8c8addc 100644
--- a/src/test/java/org/apache/commons/collections4/FluentIterableTest.java
+++ b/src/test/java/org/apache/commons/collections4/FluentIterableTest.java
@@ -71,7 +71,7 @@ public class FluentIterableTest {
@Before
public void setUp() {
- final Collection<Integer> collectionA = new ArrayList<>();
+ Collection<Integer> collectionA = new ArrayList<>();
collectionA.add(1);
collectionA.add(2);
collectionA.add(2);
@@ -84,7 +84,7 @@ public class FluentIterableTest {
collectionA.add(4);
iterableA = collectionA;
- final Collection<Long> collectionB = new LinkedList<>();
+ Collection<Long> collectionB = new LinkedList<>();
collectionB.add(5L);
collectionB.add(4L);
collectionB.add(4L);
@@ -129,14 +129,14 @@ public class FluentIterableTest {
try {
FluentIterable.of(it).toList();
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
}
@Test
public void appendElements() {
- final FluentIterable<Integer> it = FluentIterable.of(iterableA).append(10, 20, 30);
+ FluentIterable<Integer> it = FluentIterable.of(iterableA).append(10, 20, 30);
assertEquals(IterableUtils.size(iterableA) + 3, IterableUtils.size(it));
assertTrue(IterableUtils.contains(it, 1));
assertTrue(IterableUtils.contains(it, 10));
@@ -144,14 +144,14 @@ public class FluentIterableTest {
assertTrue(IterableUtils.contains(it, 30));
assertFalse(IterableUtils.contains(it, 40));
- final FluentIterable<Integer> empty = FluentIterable.of(emptyIterable).append();
+ FluentIterable<Integer> empty = FluentIterable.of(emptyIterable).append();
assertTrue(IterableUtils.isEmpty(empty));
}
@Test
public void appendIterable() {
- final List<Integer> listB = Arrays.asList(10, 20, 30);
- final FluentIterable<Integer> it = FluentIterable.of(iterableA).append(listB);
+ List<Integer> listB = Arrays.asList(10, 20, 30);
+ FluentIterable<Integer> it = FluentIterable.of(iterableA).append(listB);
assertEquals(IterableUtils.size(iterableA) + listB.size(), IterableUtils.size(it));
assertTrue(IterableUtils.contains(it, 1));
assertTrue(IterableUtils.contains(it, 10));
@@ -162,8 +162,8 @@ public class FluentIterableTest {
@Test
public void collate() {
- final List<Integer> result = FluentIterable.of(iterableOdd).collate(iterableEven).toList();
- final List<Integer> combinedList = new ArrayList<>();
+ List<Integer> result = FluentIterable.of(iterableOdd).collate(iterableEven).toList();
+ List<Integer> combinedList = new ArrayList<>();
CollectionUtils.addAll(combinedList, iterableOdd);
CollectionUtils.addAll(combinedList, iterableEven);
Collections.sort(combinedList);
@@ -172,7 +172,7 @@ public class FluentIterableTest {
try {
FluentIterable.of(iterableOdd).collate(null).toList();
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
}
@@ -185,7 +185,7 @@ public class FluentIterableTest {
.collate(iterableEven, ComparatorUtils.<Integer>naturalComparator())
.toList();
- final List<Integer> combinedList = new ArrayList<>();
+ List<Integer> combinedList = new ArrayList<>();
CollectionUtils.addAll(combinedList, iterableOdd);
CollectionUtils.addAll(combinedList, iterableEven);
Collections.sort(combinedList);
@@ -198,7 +198,7 @@ public class FluentIterableTest {
@Test
public void filter() {
- final Predicate<Integer> smallerThan3 = new Predicate<Integer>() {
+ Predicate<Integer> smallerThan3 = new Predicate<Integer>() {
@Override
public boolean evaluate(final Integer object) {
return object.intValue() < 3;
@@ -215,7 +215,7 @@ public class FluentIterableTest {
try {
FluentIterable.of(iterableA).filter(null).toList();
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
}
@@ -223,7 +223,7 @@ public class FluentIterableTest {
@Test
public void forEach() {
final AtomicInteger sum = new AtomicInteger(0);
- final Closure<Integer> closure = new Closure<Integer>() {
+ Closure<Integer> closure = new Closure<Integer>() {
@Override
public void execute(final Integer input) {
sum.addAndGet(input);
@@ -232,7 +232,7 @@ public class FluentIterableTest {
FluentIterable.of(iterableA).forEach(closure);
int expectedSum = 0;
- for (final Integer i : iterableA) {
+ for (Integer i : iterableA) {
expectedSum += i;
}
assertEquals(expectedSum, sum.get());
@@ -240,7 +240,7 @@ public class FluentIterableTest {
try {
FluentIterable.of(iterableA).forEach((Closure<Integer>) null);
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
}
@@ -253,7 +253,7 @@ public class FluentIterableTest {
// limit larger than input
result = FluentIterable.of(iterableA).limit(100).toList();
- final List<Integer> expected = IterableUtils.toList(iterableA);
+ List<Integer> expected = IterableUtils.toList(iterableA);
assertEquals(expected.size(), result.size());
assertEquals(expected, result);
@@ -268,7 +268,7 @@ public class FluentIterableTest {
try {
FluentIterable.of(iterableA).limit(-2).toList();
fail("expecting IllegalArgumentException");
- } catch (final IllegalArgumentException iae) {
+ } catch (IllegalArgumentException iae) {
// expected
}
}
@@ -276,7 +276,7 @@ public class FluentIterableTest {
@Test
public void reverse() {
List<Integer> result = FluentIterable.of(iterableA).reverse().toList();
- final List<Integer> expected = IterableUtils.toList(iterableA);
+ List<Integer> expected = IterableUtils.toList(iterableA);
Collections.reverse(expected);
assertEquals(expected, result);
@@ -297,7 +297,7 @@ public class FluentIterableTest {
// skip 0 elements
result = FluentIterable.of(iterableA).skip(0).toList();
- final List<Integer> expected = IterableUtils.toList(iterableA);
+ List<Integer> expected = IterableUtils.toList(iterableA);
assertEquals(expected.size(), result.size());
assertEquals(expected, result);
@@ -308,14 +308,14 @@ public class FluentIterableTest {
try {
FluentIterable.of(iterableA).skip(-4).toList();
fail("expecting IllegalArgumentException");
- } catch (final IllegalArgumentException iae) {
+ } catch (IllegalArgumentException iae) {
// expected
}
}
@Test
public void transform() {
- final Transformer<Integer, Integer> squared = new Transformer<Integer, Integer>() {
+ Transformer<Integer, Integer> squared = new Transformer<Integer, Integer>() {
@Override
public Integer transform(final Integer object) {
return object * object;
@@ -332,7 +332,7 @@ public class FluentIterableTest {
try {
FluentIterable.of(iterableA).transform(null).toList();
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
}
@@ -350,18 +350,18 @@ public class FluentIterableTest {
@Test
public void unmodifiable() {
- final FluentIterable<Integer> iterable1 = FluentIterable.of(iterableA).unmodifiable();
- final Iterator<Integer> it = iterable1.iterator();
+ FluentIterable<Integer> iterable1 = FluentIterable.of(iterableA).unmodifiable();
+ Iterator<Integer> it = iterable1.iterator();
assertEquals(1, it.next().intValue());
try {
it.remove();
fail("expecting UnsupportedOperationException");
- } catch (final UnsupportedOperationException ise) {
+ } catch (UnsupportedOperationException ise) {
// expected
}
// calling unmodifiable on an already unmodifiable iterable shall return the same instance
- final FluentIterable<Integer> iterable2 = iterable1.unmodifiable();
+ FluentIterable<Integer> iterable2 = iterable1.unmodifiable();
assertSame(iterable1, iterable2);
}
@@ -378,7 +378,7 @@ public class FluentIterableTest {
try {
FluentIterable.of(iterableOdd).zip((Iterable<Integer>) null).toList();
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
@@ -393,7 +393,7 @@ public class FluentIterableTest {
@Test
public void asEnumeration() {
Enumeration<Long> enumeration = FluentIterable.of(iterableB).asEnumeration();
- final List<Long> result = EnumerationUtils.toList(enumeration);
+ List<Long> result = EnumerationUtils.toList(enumeration);
assertEquals(iterableB, result);
enumeration = FluentIterable.<Long>empty().asEnumeration();
@@ -409,7 +409,7 @@ public class FluentIterableTest {
try {
FluentIterable.of(iterableEven).allMatch(null);
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
}
@@ -423,7 +423,7 @@ public class FluentIterableTest {
try {
FluentIterable.of(iterableEven).anyMatch(null);
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
}
@@ -439,7 +439,7 @@ public class FluentIterableTest {
try {
FluentIterable.of((Iterable<?>) null).size();
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
assertEquals(0, FluentIterable.of(emptyIterable).size());
@@ -448,10 +448,10 @@ public class FluentIterableTest {
@Test
public void eval() {
- final List<Integer> listNumbers = new ArrayList<>();
+ List<Integer> listNumbers = new ArrayList<>();
listNumbers.addAll(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
- final FluentIterable<Integer> iterable = FluentIterable.of(listNumbers).filter(EVEN);
- final FluentIterable<Integer> materialized = iterable.eval();
+ FluentIterable<Integer> iterable = FluentIterable.of(listNumbers).filter(EVEN);
+ FluentIterable<Integer> materialized = iterable.eval();
listNumbers.addAll(Arrays.asList(11, 12, 13, 14, 15, 16, 17, 18, 19, 20));
assertEquals(5, materialized.size());
@@ -493,7 +493,7 @@ public class FluentIterableTest {
try {
FluentIterable.of(iterableA).copyInto(null);
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
}
@@ -514,14 +514,14 @@ public class FluentIterableTest {
try {
FluentIterable.of(iterableEven).get(-1);
fail("expecting IndexOutOfBoundsException");
- } catch (final IndexOutOfBoundsException ioe) {
+ } catch (IndexOutOfBoundsException ioe) {
// expected
}
try {
FluentIterable.of(iterableEven).get(IterableUtils.size(iterableEven));
fail("expecting IndexOutOfBoundsException");
- } catch (final IndexOutOfBoundsException ioe) {
+ } catch (IndexOutOfBoundsException ioe) {
// expected
}
}
@@ -529,14 +529,14 @@ public class FluentIterableTest {
@SuppressWarnings({ "rawtypes", "unchecked" })
@Test
public void toArray() {
- final Long[] arr = new Long[] {1L, 2L, 3L, 4L, 5L};
- final Long[] result = FluentIterable.of(arr).toArray(Long.class);
+ Long[] arr = new Long[] {1L, 2L, 3L, 4L, 5L};
+ Long[] result = FluentIterable.of(arr).toArray(Long.class);
assertNotNull(result);
assertArrayEquals(arr, result);
try {
FluentIterable.of(arr).toArray((Class) String.class);
- } catch (final ArrayStoreException ase) {
+ } catch (ArrayStoreException ase) {
// expected
}
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java b/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java
index f2538f2..33f18fb 100644
--- a/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java
@@ -62,7 +62,7 @@ public class IterableUtilsTest {
@Before
public void setUp() {
- final Collection<Integer> collectionA = new ArrayList<>();
+ Collection<Integer> collectionA = new ArrayList<>();
collectionA.add(1);
collectionA.add(2);
collectionA.add(2);
@@ -75,7 +75,7 @@ public class IterableUtilsTest {
collectionA.add(4);
iterableA = collectionA;
- final Collection<Long> collectionB = new LinkedList<>();
+ Collection<Long> collectionB = new LinkedList<>();
collectionB.add(5L);
collectionB.add(4L);
collectionB.add(4L);
@@ -123,7 +123,7 @@ public class IterableUtilsTest {
try {
IterableUtils.forEach(col, null);
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
@@ -161,7 +161,7 @@ public class IterableUtilsTest {
try {
IterableUtils.forEachButLast(col, null);
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
@@ -228,8 +228,8 @@ public class IterableUtilsTest {
// Ensure that generic bounds accept valid parameters, but return
// expected results
// e.g. no longs in the "int" Iterable<Number>, and vice versa.
- final Iterable<Number> iterableIntAsNumber = Arrays.<Number>asList(1, 2, 3, 4, 5);
- final Iterable<Number> iterableLongAsNumber = Arrays.<Number>asList(1L, 2L, 3L, 4L, 5L);
+ Iterable<Number> iterableIntAsNumber = Arrays.<Number>asList(1, 2, 3, 4, 5);
+ Iterable<Number> iterableLongAsNumber = Arrays.<Number>asList(1L, 2L, 3L, 4L, 5L);
assertEquals(0, IterableUtils.frequency(iterableIntAsNumber, 2L));
assertEquals(0, IterableUtils.frequency(iterableLongAsNumber, 2));
@@ -316,14 +316,14 @@ public class IterableUtilsTest {
try {
assertEquals(0, IterableUtils.countMatches(iterableA, null));
fail("predicate must not be null");
- } catch (final NullPointerException ex) {
+ } catch (NullPointerException ex) {
// expected
}
try {
assertEquals(0, IterableUtils.countMatches(null, null));
fail("predicate must not be null");
- } catch (final NullPointerException ex) {
+ } catch (NullPointerException ex) {
// expected
}
}
@@ -335,14 +335,14 @@ public class IterableUtilsTest {
try {
assertFalse(IterableUtils.matchesAny(null, null));
fail("predicate must not be null");
- } catch (final NullPointerException ex) {
+ } catch (NullPointerException ex) {
// expected
}
try {
assertFalse(IterableUtils.matchesAny(list, null));
fail("predicate must not be null");
- } catch (final NullPointerException ex) {
+ } catch (NullPointerException ex) {
// expected
}
@@ -362,18 +362,18 @@ public class IterableUtilsTest {
try {
assertFalse(IterableUtils.matchesAll(null, null));
fail("predicate must not be null");
- } catch (final NullPointerException ex) {
+ } catch (NullPointerException ex) {
// expected
}
try {
assertFalse(IterableUtils.matchesAll(iterableA, null));
fail("predicate must not be null");
- } catch (final NullPointerException ex) {
+ } catch (NullPointerException ex) {
// expected
}
- final Predicate<Integer> lessThanFive = new Predicate<Integer>() {
+ Predicate<Integer> lessThanFive = new Predicate<Integer>() {
@Override
public boolean evaluate(final Integer object) {
return object < 5;
@@ -381,7 +381,7 @@ public class IterableUtilsTest {
};
assertTrue(IterableUtils.matchesAll(iterableA, lessThanFive));
- final Predicate<Integer> lessThanFour = new Predicate<Integer>() {
+ Predicate<Integer> lessThanFour = new Predicate<Integer>() {
@Override
public boolean evaluate(final Integer object) {
return object < 4;
@@ -407,7 +407,7 @@ public class IterableUtilsTest {
@SuppressWarnings("unchecked")
@Test
public void partition() {
- final List<Integer> input = new ArrayList<>();
+ List<Integer> input = new ArrayList<>();
input.add(1);
input.add(2);
input.add(3);
@@ -421,7 +421,7 @@ public class IterableUtilsTest {
assertEquals(2, CollectionUtils.extractSingleton(partition).intValue());
// second partition contains 1, 3, and 4
- final Integer[] expected = {1, 3, 4};
+ Integer[] expected = {1, 3, 4};
partition = partitions.get(1);
Assert.assertArrayEquals(expected, partition.toArray());
@@ -437,7 +437,7 @@ public class IterableUtilsTest {
try {
IterableUtils.partition(input, (Predicate<Integer>) null);
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
}
@@ -445,12 +445,12 @@ public class IterableUtilsTest {
@SuppressWarnings("unchecked")
@Test
public void partitionMultiplePredicates() {
- final List<Integer> input = new ArrayList<>();
+ List<Integer> input = new ArrayList<>();
input.add(1);
input.add(2);
input.add(3);
input.add(4);
- final List<List<Integer>> partitions = IterableUtils.partition(input, EQUALS_TWO, EVEN);
+ List<List<Integer>> partitions = IterableUtils.partition(input, EQUALS_TWO, EVEN);
// first partition contains 2
Collection<Integer> partition = partitions.get(0);
@@ -463,13 +463,13 @@ public class IterableUtilsTest {
assertEquals(4, partition.iterator().next().intValue());
// third partition contains 1 and 3
- final Integer[] expected = {1, 3};
+ Integer[] expected = {1, 3};
partition = partitions.get(2);
Assert.assertArrayEquals(expected, partition.toArray());
try {
IterableUtils.partition(input, EQUALS_TWO, null);
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
}
@@ -515,7 +515,7 @@ public class IterableUtilsTest {
@Test
public void testToStringDelimiter() {
- final Transformer<Integer, String> transformer = new Transformer<Integer, String>() {
+ Transformer<Integer, String> transformer = new Transformer<Integer, String>() {
@Override
public String transform(final Integer input) {
return new Integer(input * 2).toString();
@@ -552,7 +552,7 @@ public class IterableUtilsTest {
@Test
public void testToStringWithNullArguments() {
- final String result = IterableUtils.toString(null, new Transformer<Integer, String>() {
+ String result = IterableUtils.toString(null, new Transformer<Integer, String>() {
@Override
public String transform(final Integer input) {
fail("not supposed to reach here");
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/IteratorUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/IteratorUtilsTest.java b/src/test/java/org/apache/commons/collections4/IteratorUtilsTest.java
index acf44dc..d31ea02 100644
--- a/src/test/java/org/apache/commons/collections4/IteratorUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/IteratorUtilsTest.java
@@ -960,14 +960,14 @@ public class IteratorUtilsTest {
try {
IteratorUtils.collatedIterator(null, collectionOdd.iterator(), null);
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
try {
IteratorUtils.collatedIterator(null, null, collectionEven.iterator());
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
@@ -978,7 +978,7 @@ public class IteratorUtilsTest {
List<Integer> result = IteratorUtils.toList(it);
assertEquals(12, result.size());
- final List<Integer> combinedList = new ArrayList<>();
+ List<Integer> combinedList = new ArrayList<>();
combinedList.addAll(collectionOdd);
combinedList.addAll(collectionEven);
Collections.sort(combinedList);
@@ -1021,7 +1021,7 @@ public class IteratorUtilsTest {
try {
IteratorUtils.forEach(col.iterator(), null);
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
@@ -1051,7 +1051,7 @@ public class IteratorUtilsTest {
try {
IteratorUtils.forEachButLast(col.iterator(), null);
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/ListUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/ListUtilsTest.java b/src/test/java/org/apache/commons/collections4/ListUtilsTest.java
index 69747b7..fee6460 100644
--- a/src/test/java/org/apache/commons/collections4/ListUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/ListUtilsTest.java
@@ -128,7 +128,7 @@ public class ListUtilsTest {
return o instanceof String;
}
};
- final List<Object> list = ListUtils.predicatedList(new ArrayList<>(), predicate);
+ List<Object> list = ListUtils.predicatedList(new ArrayList<>(), predicate);
assertTrue("returned object should be a PredicatedList", list instanceof PredicatedList);
try {
ListUtils.predicatedList(new ArrayList<>(), null);
@@ -339,20 +339,20 @@ public class ListUtilsTest {
List<Character> lcs = ListUtils.longestCommonSubsequence(Collections.EMPTY_LIST, Collections.EMPTY_LIST);
assertEquals(0, lcs.size());
- final List<Character> list1 = Arrays.asList('B', 'A', 'N', 'A', 'N', 'A');
- final List<Character> list2 = Arrays.asList('A', 'N', 'A', 'N', 'A', 'S');
+ List<Character> list1 = Arrays.asList('B', 'A', 'N', 'A', 'N', 'A');
+ List<Character> list2 = Arrays.asList('A', 'N', 'A', 'N', 'A', 'S');
lcs = ListUtils.longestCommonSubsequence(list1, list2);
List<Character> expected = Arrays.asList('A', 'N', 'A', 'N', 'A');
assertEquals(expected, lcs);
- final List<Character> list3 = Arrays.asList('A', 'T', 'A', 'N', 'A');
+ List<Character> list3 = Arrays.asList('A', 'T', 'A', 'N', 'A');
lcs = ListUtils.longestCommonSubsequence(list1, list3);
expected = Arrays.asList('A', 'A', 'N', 'A');
assertEquals(expected, lcs);
- final List<Character> listZorro = Arrays.asList('Z', 'O', 'R', 'R', 'O');
+ List<Character> listZorro = Arrays.asList('Z', 'O', 'R', 'R', 'O');
lcs = ListUtils.longestCommonSubsequence(list1, listZorro);
assertTrue(lcs.isEmpty());
@@ -379,18 +379,18 @@ public class ListUtilsTest {
String lcs = ListUtils.longestCommonSubsequence("", "");
assertEquals(0, lcs.length());
- final String banana = "BANANA";
- final String ananas = "ANANAS";
+ String banana = "BANANA";
+ String ananas = "ANANAS";
lcs = ListUtils.longestCommonSubsequence(banana, ananas);
assertEquals("ANANA", lcs);
- final String atana = "ATANA";
+ String atana = "ATANA";
lcs = ListUtils.longestCommonSubsequence(banana, atana);
assertEquals("AANA", lcs);
- final String zorro = "ZORRO";
+ String zorro = "ZORRO";
lcs = ListUtils.longestCommonSubsequence(banana, zorro);
assertEquals(0, lcs.length());
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/MapUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/MapUtilsTest.java b/src/test/java/org/apache/commons/collections4/MapUtilsTest.java
index f0e24fc..e6b9b84 100644
--- a/src/test/java/org/apache/commons/collections4/MapUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/MapUtilsTest.java
@@ -65,7 +65,7 @@ public class MapUtilsTest {
@Test
public void testPredicatedMap() {
final Predicate<Object> p = getPredicate();
- final Map<Object, Object> map = MapUtils.predicatedMap(new HashMap<>(), p, p);
+ Map<Object, Object> map = MapUtils.predicatedMap(new HashMap<>(), p, p);
assertTrue("returned object should be a PredicatedMap", map instanceof PredicatedMap);
try {
MapUtils.predicatedMap(null, p, p);
@@ -1142,7 +1142,7 @@ public class MapUtilsTest {
final Map<String, String> inMap = new HashMap<String, String>();
inMap.put("key1", "value1");
inMap.put("key2", "value2");
- final Map<String, String> map = MapUtils.orderedMap(inMap);
+ Map<String, String> map = MapUtils.orderedMap(inMap);
assertTrue("returned object should be a OrderedMap", map instanceof OrderedMap);
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/MultiMapUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/MultiMapUtilsTest.java b/src/test/java/org/apache/commons/collections4/MultiMapUtilsTest.java
index 4806ba0..4e14559 100644
--- a/src/test/java/org/apache/commons/collections4/MultiMapUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/MultiMapUtilsTest.java
@@ -44,7 +44,7 @@ public class MultiMapUtilsTest {
try {
map.put("key", "value");
fail("Should throw UnsupportedOperationException");
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
}
@@ -55,7 +55,7 @@ public class MultiMapUtilsTest {
try {
map.put("key", "value");
fail("Should throw UnsupportedOperationException");
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
}
@@ -91,14 +91,14 @@ public class MultiMapUtilsTest {
public void testGetCollection() {
assertNull(MultiMapUtils.getCollection(null, "key1"));
- final String values[] = { "v1", "v2", "v3" };
+ String values[] = { "v1", "v2", "v3" };
final MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
- for (final String val : values) {
+ for (String val : values) {
map.put("key1", val);
}
- final Collection<String> col = MultiMapUtils.getCollection(map, "key1");
- for (final String val : values) {
+ Collection<String> col = MultiMapUtils.getCollection(map, "key1");
+ for (String val : values) {
assertTrue(col.contains(val));
}
}
@@ -107,15 +107,15 @@ public class MultiMapUtilsTest {
public void testGetValuesAsList() {
assertNull(MultiMapUtils.getValuesAsList(null, "key1"));
- final String values[] = { "v1", "v2", "v3" };
+ String values[] = { "v1", "v2", "v3" };
final MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
- for (final String val : values) {
+ for (String val : values) {
map.put("key1", val);
}
- final List<String> list = MultiMapUtils.getValuesAsList(map, "key1");
+ List<String> list = MultiMapUtils.getValuesAsList(map, "key1");
int i = 0;
- for (final String val : list) {
+ for (String val : list) {
assertTrue(val.equals(values[i++]));
}
}
@@ -124,16 +124,16 @@ public class MultiMapUtilsTest {
public void testGetValuesAsSet() {
assertNull(MultiMapUtils.getValuesAsList(null, "key1"));
- final String values[] = { "v1", "v2", "v3" };
+ String values[] = { "v1", "v2", "v3" };
final MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
- for (final String val : values) {
+ for (String val : values) {
map.put("key1", val);
map.put("key1", val);
}
- final Set<String> set = MultiMapUtils.getValuesAsSet(map, "key1");
+ Set<String> set = MultiMapUtils.getValuesAsSet(map, "key1");
assertEquals(3, set.size());
- for (final String val : values) {
+ for (String val : values) {
assertTrue(set.contains(val));
}
}
@@ -142,16 +142,16 @@ public class MultiMapUtilsTest {
public void testGetValuesAsBag() {
assertNull(MultiMapUtils.getValuesAsBag(null, "key1"));
- final String values[] = { "v1", "v2", "v3" };
+ String values[] = { "v1", "v2", "v3" };
final MultiValuedMap<String, String> map = new ArrayListValuedHashMap<>();
- for (final String val : values) {
+ for (String val : values) {
map.put("key1", val);
map.put("key1", val);
}
- final Bag<String> bag = MultiMapUtils.getValuesAsBag(map, "key1");
+ Bag<String> bag = MultiMapUtils.getValuesAsBag(map, "key1");
assertEquals(6, bag.size());
- for (final String val : values) {
+ for (String val : values) {
assertTrue(bag.contains(val));
assertEquals(2, bag.getCount(val));
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/QueueUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/QueueUtilsTest.java b/src/test/java/org/apache/commons/collections4/QueueUtilsTest.java
index a3ba0b7..e4a3fa0 100644
--- a/src/test/java/org/apache/commons/collections4/QueueUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/QueueUtilsTest.java
@@ -40,7 +40,7 @@ public class QueueUtilsTest {
@Test
public void testUnmodifiableQueue() {
- final Queue<Object> queue = QueueUtils.unmodifiableQueue(new LinkedList<>());
+ Queue<Object> queue = QueueUtils.unmodifiableQueue(new LinkedList<>());
assertTrue("Returned object should be an UnmodifiableQueue.", queue instanceof UnmodifiableQueue);
try {
QueueUtils.unmodifiableQueue(null);
@@ -54,7 +54,7 @@ public class QueueUtilsTest {
@Test
public void testPredicatedQueue() {
- final Queue<Object> queue = QueueUtils.predicatedQueue(new LinkedList<>(), truePredicate);
+ Queue<Object> queue = QueueUtils.predicatedQueue(new LinkedList<>(), truePredicate);
assertTrue("Returned object should be a PredicatedQueue.", queue instanceof PredicatedQueue);
try {
QueueUtils.predicatedQueue(null, truePredicate);
@@ -72,7 +72,7 @@ public class QueueUtilsTest {
@Test
public void testTransformedQueue() {
- final Queue<Object> queue = QueueUtils.transformingQueue(new LinkedList<>(), nopTransformer);
+ Queue<Object> queue = QueueUtils.transformingQueue(new LinkedList<>(), nopTransformer);
assertTrue("Returned object should be an TransformedQueue.", queue instanceof TransformedQueue);
try {
QueueUtils.transformingQueue(null, nopTransformer);
@@ -90,7 +90,7 @@ public class QueueUtilsTest {
@Test
public void testEmptyQueue() {
- final Queue<Object> queue = QueueUtils.emptyQueue();
+ Queue<Object> queue = QueueUtils.emptyQueue();
assertTrue("Returned object should be an UnmodifiableQueue.", queue instanceof UnmodifiableQueue);
assertTrue("Returned queue is not empty.", queue.isEmpty());
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/SetUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/SetUtilsTest.java b/src/test/java/org/apache/commons/collections4/SetUtilsTest.java
index a743e2e..bff4203 100644
--- a/src/test/java/org/apache/commons/collections4/SetUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/SetUtilsTest.java
@@ -68,7 +68,7 @@ public class SetUtilsTest {
return o instanceof String;
}
};
- final Set<Object> set = SetUtils.predicatedSet(new HashSet<>(), predicate);
+ Set<Object> set = SetUtils.predicatedSet(new HashSet<>(), predicate);
assertTrue("returned object should be a PredicatedSet", set instanceof PredicatedSet);
try {
SetUtils.predicatedSet(new HashSet<>(), null);
@@ -126,8 +126,8 @@ public class SetUtilsTest {
@Test
public void testNewIdentityHashSet() {
- final Set<String> set = SetUtils.newIdentityHashSet();
- final String a = new String("a");
+ Set<String> set = SetUtils.newIdentityHashSet();
+ String a = new String("a");
set.add(a);
set.add(new String("b"));
set.add(a);
@@ -154,14 +154,14 @@ public class SetUtilsTest {
try {
SetUtils.union(setA, null);
fail("Expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
try {
SetUtils.union(null, setA);
fail("Expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
}
@@ -172,7 +172,7 @@ public class SetUtilsTest {
assertEquals(2, set.size());
assertTrue(set.contains(1));
assertTrue(set.contains(2));
- for (final Integer i : setB) {
+ for (Integer i : setB) {
assertFalse(set.contains(i));
}
@@ -182,14 +182,14 @@ public class SetUtilsTest {
try {
SetUtils.difference(setA, null);
fail("Expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
try {
SetUtils.difference(null, setA);
fail("Expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
}
@@ -212,14 +212,14 @@ public class SetUtilsTest {
try {
SetUtils.intersection(setA, null);
fail("Expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
try {
SetUtils.intersection(null, setA);
fail("Expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
}
@@ -242,14 +242,14 @@ public class SetUtilsTest {
try {
SetUtils.disjunction(setA, null);
fail("Expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
try {
SetUtils.disjunction(null, setA);
fail("Expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
}
[5/5] commons-collections git commit: [COLLECTIONS-661] Intermittent
test failures in Windows for HashSetValuedHashMap.
Posted by gg...@apache.org.
[COLLECTIONS-661] Intermittent test failures in Windows for
HashSetValuedHashMap.
Project: http://git-wip-us.apache.org/repos/asf/commons-collections/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-collections/commit/eed8a7ad
Tree: http://git-wip-us.apache.org/repos/asf/commons-collections/tree/eed8a7ad
Diff: http://git-wip-us.apache.org/repos/asf/commons-collections/diff/eed8a7ad
Branch: refs/heads/master
Commit: eed8a7adb3de7441751e846f4a75d110dd205f23
Parents: b5eb4fc
Author: Bruno P. Kinoshita <br...@yahoo.com.br.invalid>
Authored: Wed Oct 11 16:37:09 2017 -0600
Committer: Gary Gregory <gg...@apache.org>
Committed: Wed Oct 11 16:37:09 2017 -0600
----------------------------------------------------------------------
src/changes/changes.xml | 3 +++
.../collections4/multimap/AbstractMultiValuedMapTest.java | 9 +++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/eed8a7ad/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index cbe01ce..118df35 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -21,6 +21,9 @@
</properties>
<body>
<release version="4.2" date="YYYY-MM-DD" description="New features">
+ <action issue="COLLECTIONS-661" dev="kinow" type="fix">
+ Intermittent test failures in Windows for HashSetValuedHashMap
+ </action>
<action issue="COLLECTIONS-660" dev="kinow" type="fix">
Uncomment test in AbstractMapTest regarding LRUMap equals
</action>
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/eed8a7ad/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
index 1faaaa7..b578459 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
@@ -1086,7 +1086,10 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
@Override
@SuppressWarnings("unchecked")
public Collection<V>[] getSampleValues() {
- boolean isSetValuedMap = AbstractMultiValuedMapTest.this.getMap() instanceof SetValuedMap;
+ // Calling getMap() instead of makeObject() would make more sense, but due to concurrency
+ // issues, this may lead to intermittent issues. See COLLECTIONS-661. A better solution
+ // would be to re-design the tests, or add a boolean method to the parent.
+ boolean isSetValuedMap = AbstractMultiValuedMapTest.this.makeObject() instanceof SetValuedMap;
V[] sampleValues = AbstractMultiValuedMapTest.this.getSampleValues();
Collection<V>[] colArr = new Collection[3];
for(int i = 0; i < 3; i++) {
@@ -1099,7 +1102,9 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
@Override
@SuppressWarnings("unchecked")
public Collection<V>[] getNewSampleValues() {
- boolean isSetValuedMap = AbstractMultiValuedMapTest.this.getMap() instanceof SetValuedMap;
+ // See comment in getSampleValues() to understand why we are calling makeObject() and not
+ // getMap(). See COLLECTIONS-661 for more.
+ boolean isSetValuedMap = AbstractMultiValuedMapTest.this.makeObject() instanceof SetValuedMap;
Object[] sampleValues = { "ein", "ek", "zwei", "duey", "drei", "teen" };
Collection<V>[] colArr = new Collection[3];
for (int i = 0; i < 3; i++) {
[2/5] commons-collections git commit: Revert "Use final for locals."
Posted by gg...@apache.org.
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/TransformerUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/TransformerUtilsTest.java b/src/test/java/org/apache/commons/collections4/TransformerUtilsTest.java
index 7f78a95..13d881b 100644
--- a/src/test/java/org/apache/commons/collections4/TransformerUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/TransformerUtilsTest.java
@@ -247,7 +247,7 @@ public class TransformerUtilsTest {
assertEquals("A", TransformerUtils.ifTransformer(TruePredicate.truePredicate(), a, b).transform(null));
assertEquals("B", TransformerUtils.ifTransformer(FalsePredicate.falsePredicate(), a, b).transform(null));
- final Predicate<Integer> lessThanFivePredicate = new Predicate<Integer>() {
+ Predicate<Integer> lessThanFivePredicate = new Predicate<Integer>() {
@Override
public boolean evaluate(final Integer value) {
return value < 5;
@@ -258,7 +258,7 @@ public class TransformerUtilsTest {
assertEquals("B", TransformerUtils.<Integer, String>ifTransformer(lessThanFivePredicate, a, b).transform(5));
// if tests
- final Predicate<String> equalsAPredicate = EqualPredicate.equalPredicate("A");
+ Predicate<String> equalsAPredicate = EqualPredicate.equalPredicate("A");
assertEquals("C", TransformerUtils.<String>ifTransformer(equalsAPredicate, c).transform("A"));
assertEquals("B", TransformerUtils.<String>ifTransformer(equalsAPredicate, c).transform("B"));
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/TrieUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/TrieUtilsTest.java b/src/test/java/org/apache/commons/collections4/TrieUtilsTest.java
index f6a2526..21dd335 100644
--- a/src/test/java/org/apache/commons/collections4/TrieUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/TrieUtilsTest.java
@@ -32,7 +32,7 @@ public class TrieUtilsTest {
@Test
public void testUnmodifiableTrie() {
- final Trie<String, Object> trie = TrieUtils.unmodifiableTrie(new PatriciaTrie<>());
+ Trie<String, Object> trie = TrieUtils.unmodifiableTrie(new PatriciaTrie<>());
assertTrue("Returned object should be an UnmodifiableTrie.",
trie instanceof UnmodifiableTrie);
try {
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap2Test.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap2Test.java b/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap2Test.java
index d50cc71..cc4f7aa 100644
--- a/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap2Test.java
+++ b/src/test/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap2Test.java
@@ -153,7 +153,7 @@ public class DualTreeBidiMap2Test<K extends Comparable<K>, V extends Comparable<
*/
@Override
public String[] ignoredTests() {
- final String recursiveTest = "DualTreeBidiMap2Test.bulkTestInverseMap.bulkTestInverseMap";
+ String recursiveTest = "DualTreeBidiMap2Test.bulkTestInverseMap.bulkTestInverseMap";
if (IBMJDK16) {
final String preSub = "DualTreeBidiMap2Test.bulkTestSubMap.";
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/collection/AbstractCollectionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/collection/AbstractCollectionTest.java b/src/test/java/org/apache/commons/collections4/collection/AbstractCollectionTest.java
index 5aaa5f6..6960043 100644
--- a/src/test/java/org/apache/commons/collections4/collection/AbstractCollectionTest.java
+++ b/src/test/java/org/apache/commons/collections4/collection/AbstractCollectionTest.java
@@ -671,7 +671,7 @@ public abstract class AbstractCollectionTest<E> extends AbstractObjectTest {
resetFull();
elements = getOtherElements();
- for (final Object element : elements) {
+ for (Object element : elements) {
assertTrue("Full collection shouldn't contain element",
!getCollection().contains(element));
}
@@ -861,7 +861,7 @@ public abstract class AbstractCollectionTest<E> extends AbstractObjectTest {
resetEmpty();
final E[] elements = getFullElements();
- for (final E element : elements) {
+ for (E element : elements) {
assertTrue("Shouldn't remove nonexistent element", !getCollection().remove(element));
verify();
}
@@ -869,7 +869,7 @@ public abstract class AbstractCollectionTest<E> extends AbstractObjectTest {
final E[] other = getOtherElements();
resetFull();
- for (final E element : other) {
+ for (E element : other) {
assertTrue("Shouldn't remove nonexistent other element", !getCollection().remove(element));
verify();
}
@@ -939,7 +939,7 @@ public abstract class AbstractCollectionTest<E> extends AbstractObjectTest {
verify();
assertTrue("Collection should shrink after removeAll", getCollection().size() < size);
- for (final E element : all) {
+ for (E element : all) {
assertTrue("Collection shouldn't contain removed element", !getCollection().contains(element));
}
}
@@ -991,7 +991,7 @@ public abstract class AbstractCollectionTest<E> extends AbstractObjectTest {
getConfirmed().retainAll(elements.subList(min, max));
verify();
- for (final E element : getCollection()) {
+ for (E element : getCollection()) {
assertTrue("Collection only contains retained element", elements.subList(min, max).contains(element));
}
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionBuilderTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionBuilderTest.java b/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionBuilderTest.java
index 12344c4..0c8c5a8 100644
--- a/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionBuilderTest.java
+++ b/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionBuilderTest.java
@@ -39,7 +39,7 @@ public class PredicatedCollectionBuilderTest {
*/
@Test
public void addPass() {
- final PredicatedCollection.Builder<String> builder = PredicatedCollection.notNullBuilder();
+ PredicatedCollection.Builder<String> builder = PredicatedCollection.notNullBuilder();
builder.add("test");
Assert.assertEquals(builder.createPredicatedList().size(), 1);
}
@@ -49,7 +49,7 @@ public class PredicatedCollectionBuilderTest {
*/
@Test
public void addFail() {
- final PredicatedCollection.Builder<String> builder = PredicatedCollection.notNullBuilder();
+ PredicatedCollection.Builder<String> builder = PredicatedCollection.notNullBuilder();
builder.add((String) null);
Assert.assertTrue(builder.createPredicatedList().isEmpty());
@@ -61,27 +61,27 @@ public class PredicatedCollectionBuilderTest {
*/
@Test
public void addAllPass() {
- final PredicatedCollection.Builder<String> builder = PredicatedCollection.notNullBuilder();
+ PredicatedCollection.Builder<String> builder = PredicatedCollection.notNullBuilder();
builder.addAll(Arrays.asList("test1", null, "test2"));
Assert.assertEquals(builder.createPredicatedList().size(), 2);
}
@Test
public void createPredicatedCollectionWithNotNullPredicate() {
- final PredicatedCollection.Builder<String> builder = PredicatedCollection.notNullBuilder();
+ PredicatedCollection.Builder<String> builder = PredicatedCollection.notNullBuilder();
builder.add("test1");
builder.add((String) null);
- final List<String> predicatedList = builder.createPredicatedList();
+ List<String> predicatedList = builder.createPredicatedList();
checkPredicatedCollection1(predicatedList);
- final Set<String> predicatedSet = builder.createPredicatedSet();
+ Set<String> predicatedSet = builder.createPredicatedSet();
checkPredicatedCollection1(predicatedSet);
- final Bag<String> predicatedBag = builder.createPredicatedBag();
+ Bag<String> predicatedBag = builder.createPredicatedBag();
checkPredicatedCollection1(predicatedBag);
- final Queue<String> predicatedQueue = builder.createPredicatedQueue();
+ Queue<String> predicatedQueue = builder.createPredicatedQueue();
checkPredicatedCollection1(predicatedQueue);
}
@@ -94,30 +94,30 @@ public class PredicatedCollectionBuilderTest {
try {
collection.add(null);
Assert.fail("Expecting IllegalArgumentException for failing predicate!");
- } catch (final IllegalArgumentException iae) {
+ } catch (IllegalArgumentException iae) {
// expected
}
}
@Test
public void createPredicatedCollectionWithPredicate() {
- final OddPredicate p = new OddPredicate();
- final PredicatedCollection.Builder<Integer> builder = PredicatedCollection.builder(p);
+ OddPredicate p = new OddPredicate();
+ PredicatedCollection.Builder<Integer> builder = PredicatedCollection.builder(p);
builder.add(1);
builder.add(2);
builder.add(3);
- final List<Integer> predicatedList = builder.createPredicatedList();
+ List<Integer> predicatedList = builder.createPredicatedList();
checkPredicatedCollection2(predicatedList);
- final Set<Integer> predicatedSet = builder.createPredicatedSet();
+ Set<Integer> predicatedSet = builder.createPredicatedSet();
checkPredicatedCollection2(predicatedSet);
- final Bag<Integer> predicatedBag = builder.createPredicatedBag();
+ Bag<Integer> predicatedBag = builder.createPredicatedBag();
checkPredicatedCollection2(predicatedBag);
- final Queue<Integer> predicatedQueue = builder.createPredicatedQueue();
+ Queue<Integer> predicatedQueue = builder.createPredicatedQueue();
checkPredicatedCollection2(predicatedQueue);
}
@@ -127,7 +127,7 @@ public class PredicatedCollectionBuilderTest {
try {
collection.add(4);
Assert.fail("Expecting IllegalArgumentException for failing predicate!");
- } catch (final IllegalArgumentException iae) {
+ } catch (IllegalArgumentException iae) {
}
Assert.assertEquals(2, collection.size());
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/comparators/TransformingComparatorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/comparators/TransformingComparatorTest.java b/src/test/java/org/apache/commons/collections4/comparators/TransformingComparatorTest.java
index 81d8481..11cbd27 100644
--- a/src/test/java/org/apache/commons/collections4/comparators/TransformingComparatorTest.java
+++ b/src/test/java/org/apache/commons/collections4/comparators/TransformingComparatorTest.java
@@ -61,9 +61,9 @@ public class TransformingComparatorTest extends AbstractComparatorTest<Integer>
}
public void testEquals() {
- final Transformer<String, String> t1 = TransformerUtils.nopTransformer();
- final TransformingComparator<String, String> comp1 = new TransformingComparator<>(t1);
- final TransformingComparator<String, String> comp2 = new TransformingComparator<>(t1, comp1);
+ Transformer<String, String> t1 = TransformerUtils.nopTransformer();
+ TransformingComparator<String, String> comp1 = new TransformingComparator<>(t1);
+ TransformingComparator<String, String> comp2 = new TransformingComparator<>(t1, comp1);
// Checks the contract: equals-hashcode on comp1 and comp2
assertTrue("Contract failed: equals-hashcode",
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/iterators/BoundedIteratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/iterators/BoundedIteratorTest.java b/src/test/java/org/apache/commons/collections4/iterators/BoundedIteratorTest.java
index 7cf6372..0d868cb 100644
--- a/src/test/java/org/apache/commons/collections4/iterators/BoundedIteratorTest.java
+++ b/src/test/java/org/apache/commons/collections4/iterators/BoundedIteratorTest.java
@@ -66,7 +66,7 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testBounded() {
- final Iterator<E> iter = new BoundedIterator<>(testList.iterator(), 2, 4);
+ Iterator<E> iter = new BoundedIterator<>(testList.iterator(), 2, 4);
assertTrue(iter.hasNext());
assertEquals("c", iter.next());
@@ -81,7 +81,7 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
try {
iter.next();
fail("Expected NoSuchElementException.");
- } catch (final NoSuchElementException nsee) { /* Success case */
+ } catch (NoSuchElementException nsee) { /* Success case */
}
}
@@ -92,7 +92,7 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testSameAsDecorated() {
- final Iterator<E> iter = new BoundedIterator<>(testList.iterator(), 0,
+ Iterator<E> iter = new BoundedIterator<>(testList.iterator(), 0,
testList.size());
assertTrue(iter.hasNext());
@@ -114,7 +114,7 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
try {
iter.next();
fail("Expected NoSuchElementException.");
- } catch (final NoSuchElementException nsee) { /* Success case */
+ } catch (NoSuchElementException nsee) { /* Success case */
}
}
@@ -125,12 +125,12 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testEmptyBounded() {
- final Iterator<E> iter = new BoundedIterator<>(testList.iterator(), 3, 0);
+ Iterator<E> iter = new BoundedIterator<>(testList.iterator(), 3, 0);
assertFalse(iter.hasNext());
try {
iter.next();
fail("Expected NoSuchElementException.");
- } catch (final NoSuchElementException nsee) { /* Success case */
+ } catch (NoSuchElementException nsee) { /* Success case */
}
}
@@ -143,7 +143,7 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
try {
new BoundedIterator<>(testList.iterator(), -1, 4);
fail("Expected IllegalArgumentException.");
- } catch (final IllegalArgumentException iae) { /* Success case */
+ } catch (IllegalArgumentException iae) { /* Success case */
}
}
@@ -156,7 +156,7 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
try {
new BoundedIterator<>(testList.iterator(), 3, -1);
fail("Expected IllegalArgumentException.");
- } catch (final IllegalArgumentException iae) { /* Success case */
+ } catch (IllegalArgumentException iae) { /* Success case */
}
}
@@ -167,12 +167,12 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testOffsetGreaterThanSize() {
- final Iterator<E> iter = new BoundedIterator<>(testList.iterator(), 10, 4);
+ Iterator<E> iter = new BoundedIterator<>(testList.iterator(), 10, 4);
assertFalse(iter.hasNext());
try {
iter.next();
fail("Expected NoSuchElementException.");
- } catch (final NoSuchElementException nsee) { /* Success case */
+ } catch (NoSuchElementException nsee) { /* Success case */
}
}
@@ -184,7 +184,7 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testMaxGreaterThanSize() {
- final Iterator<E> iter = new BoundedIterator<>(testList.iterator(), 1, 10);
+ Iterator<E> iter = new BoundedIterator<>(testList.iterator(), 1, 10);
assertTrue(iter.hasNext());
assertEquals("b", iter.next());
@@ -203,7 +203,7 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
try {
iter.next();
fail("Expected NoSuchElementException.");
- } catch (final NoSuchElementException nsee) { /* Success case */
+ } catch (NoSuchElementException nsee) { /* Success case */
}
}
@@ -213,13 +213,13 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testRemoveWithoutCallingNext() {
- final List<E> testListCopy = new ArrayList<>(testList);
- final Iterator<E> iter = new BoundedIterator<>(testListCopy.iterator(), 1, 5);
+ List<E> testListCopy = new ArrayList<>(testList);
+ Iterator<E> iter = new BoundedIterator<>(testListCopy.iterator(), 1, 5);
try {
iter.remove();
fail("Expected IllegalStateException.");
- } catch (final IllegalStateException ise) { /* Success case */
+ } catch (IllegalStateException ise) { /* Success case */
}
}
@@ -229,8 +229,8 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testRemoveCalledTwice() {
- final List<E> testListCopy = new ArrayList<>(testList);
- final Iterator<E> iter = new BoundedIterator<>(testListCopy.iterator(), 1, 5);
+ List<E> testListCopy = new ArrayList<>(testList);
+ Iterator<E> iter = new BoundedIterator<>(testListCopy.iterator(), 1, 5);
assertTrue(iter.hasNext());
assertEquals("b", iter.next());
@@ -239,7 +239,7 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
try {
iter.remove();
fail("Expected IllegalStateException.");
- } catch (final IllegalStateException ise) { /* Success case */
+ } catch (IllegalStateException ise) { /* Success case */
}
}
@@ -249,8 +249,8 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testRemoveFirst() {
- final List<E> testListCopy = new ArrayList<>(testList);
- final Iterator<E> iter = new BoundedIterator<>(testListCopy.iterator(), 1, 5);
+ List<E> testListCopy = new ArrayList<>(testList);
+ Iterator<E> iter = new BoundedIterator<>(testListCopy.iterator(), 1, 5);
assertTrue(iter.hasNext());
assertEquals("b", iter.next());
@@ -271,7 +271,7 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
try {
iter.next();
fail("Expected NoSuchElementException.");
- } catch (final NoSuchElementException nsee) { /* Success case */
+ } catch (NoSuchElementException nsee) { /* Success case */
}
}
@@ -281,8 +281,8 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testRemoveMiddle() {
- final List<E> testListCopy = new ArrayList<>(testList);
- final Iterator<E> iter = new BoundedIterator<>(testListCopy.iterator(), 1, 5);
+ List<E> testListCopy = new ArrayList<>(testList);
+ Iterator<E> iter = new BoundedIterator<>(testListCopy.iterator(), 1, 5);
assertTrue(iter.hasNext());
assertEquals("b", iter.next());
@@ -303,7 +303,7 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
try {
iter.next();
fail("Expected NoSuchElementException.");
- } catch (final NoSuchElementException nsee) { /* Success case */
+ } catch (NoSuchElementException nsee) { /* Success case */
}
}
@@ -313,8 +313,8 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testRemoveLast() {
- final List<E> testListCopy = new ArrayList<>(testList);
- final Iterator<E> iter = new BoundedIterator<>(testListCopy.iterator(), 1, 5);
+ List<E> testListCopy = new ArrayList<>(testList);
+ Iterator<E> iter = new BoundedIterator<>(testListCopy.iterator(), 1, 5);
assertTrue(iter.hasNext());
assertEquals("b", iter.next());
@@ -331,7 +331,7 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
try {
iter.next();
fail("Expected NoSuchElementException.");
- } catch (final NoSuchElementException nsee) { /* Success case */
+ } catch (NoSuchElementException nsee) { /* Success case */
}
iter.remove();
@@ -341,7 +341,7 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
try {
iter.next();
fail("Expected NoSuchElementException.");
- } catch (final NoSuchElementException nsee) { /* Success case */
+ } catch (NoSuchElementException nsee) { /* Success case */
}
}
@@ -351,20 +351,20 @@ public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testRemoveUnsupported() {
- final Iterator<E> mockIterator = new AbstractIteratorDecorator<E>(testList.iterator()) {
+ Iterator<E> mockIterator = new AbstractIteratorDecorator<E>(testList.iterator()) {
@Override
public void remove() {
throw new UnsupportedOperationException();
}
};
- final Iterator<E> iter = new BoundedIterator<>(mockIterator, 1, 5);
+ Iterator<E> iter = new BoundedIterator<>(mockIterator, 1, 5);
assertTrue(iter.hasNext());
assertEquals("b", iter.next());
try {
iter.remove();
fail("Expected UnsupportedOperationException.");
- } catch (final UnsupportedOperationException usoe) { /* Success case */
+ } catch (UnsupportedOperationException usoe) { /* Success case */
}
}
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/iterators/IteratorEnumerationTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/iterators/IteratorEnumerationTest.java b/src/test/java/org/apache/commons/collections4/iterators/IteratorEnumerationTest.java
index 05aca00..1f60052 100644
--- a/src/test/java/org/apache/commons/collections4/iterators/IteratorEnumerationTest.java
+++ b/src/test/java/org/apache/commons/collections4/iterators/IteratorEnumerationTest.java
@@ -30,8 +30,8 @@ import junit.framework.TestCase;
public class IteratorEnumerationTest extends TestCase {
public void testEnumeration() {
- final Iterator<String> iterator = Arrays.asList("a", "b", "c").iterator();
- final IteratorEnumeration<String> enumeration = new IteratorEnumeration<>(iterator);
+ Iterator<String> iterator = Arrays.asList("a", "b", "c").iterator();
+ IteratorEnumeration<String> enumeration = new IteratorEnumeration<>(iterator);
assertEquals(iterator, enumeration.getIterator());
@@ -44,7 +44,7 @@ public class IteratorEnumerationTest extends TestCase {
try {
enumeration.nextElement();
fail("NoSuchElementException expected");
- } catch (final NoSuchElementException e) {
+ } catch (NoSuchElementException e) {
// expected
}
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/iterators/PeekingIteratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/iterators/PeekingIteratorTest.java b/src/test/java/org/apache/commons/collections4/iterators/PeekingIteratorTest.java
index 455d9d4..3876861 100644
--- a/src/test/java/org/apache/commons/collections4/iterators/PeekingIteratorTest.java
+++ b/src/test/java/org/apache/commons/collections4/iterators/PeekingIteratorTest.java
@@ -70,14 +70,14 @@ public class PeekingIteratorTest<E> extends AbstractIteratorTest<E> {
@Test
public void testEmpty() {
- final Iterator<E> it = makeEmptyIterator();
+ Iterator<E> it = makeEmptyIterator();
assertFalse(it.hasNext());
}
@Test
@SuppressWarnings("unchecked")
public void testSinglePeek() {
- final PeekingIterator<E> it = makeObject();
+ PeekingIterator<E> it = makeObject();
assertEquals("a", it.peek());
assertEquals("a", it.element());
validate(it, (E[]) testArray);
@@ -85,7 +85,7 @@ public class PeekingIteratorTest<E> extends AbstractIteratorTest<E> {
@Test
public void testMultiplePeek() {
- final PeekingIterator<E> it = makeObject();
+ PeekingIterator<E> it = makeObject();
assertEquals("a", it.peek());
assertEquals("a", it.peek());
assertEquals("a", it.next());
@@ -102,7 +102,7 @@ public class PeekingIteratorTest<E> extends AbstractIteratorTest<E> {
@Test
public void testIteratorExhausted() {
- final PeekingIterator<E> it = makeObject();
+ PeekingIterator<E> it = makeObject();
it.next();
it.next();
it.next();
@@ -112,14 +112,14 @@ public class PeekingIteratorTest<E> extends AbstractIteratorTest<E> {
try {
it.element();
fail();
- } catch (final NoSuchElementException e) {
+ } catch (NoSuchElementException e) {
// expected
}
}
@Test
public void testIllegalRemove() {
- final PeekingIterator<E> it = makeObject();
+ PeekingIterator<E> it = makeObject();
it.next();
it.remove(); // supported
@@ -129,13 +129,13 @@ public class PeekingIteratorTest<E> extends AbstractIteratorTest<E> {
try {
it.remove();
fail();
- } catch (final IllegalStateException e) {
+ } catch (IllegalStateException e) {
// expected
}
}
private void validate(final Iterator<E> iter, final E... items) {
- for (final E x : items) {
+ for (E x : items) {
assertTrue(iter.hasNext());
assertEquals(x, iter.next());
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/iterators/PermutationIteratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/iterators/PermutationIteratorTest.java b/src/test/java/org/apache/commons/collections4/iterators/PermutationIteratorTest.java
index 0cb9ba6..e8119f3 100644
--- a/src/test/java/org/apache/commons/collections4/iterators/PermutationIteratorTest.java
+++ b/src/test/java/org/apache/commons/collections4/iterators/PermutationIteratorTest.java
@@ -73,11 +73,11 @@ public class PermutationIteratorTest extends AbstractIteratorTest<List<Character
public void testPermutationResultSize() {
int factorial = 1;
for (int i = 0; i < 8; i++, factorial*=i) {
- final List<Integer> list = new ArrayList<>();
+ List<Integer> list = new ArrayList<>();
for (int j = 0; j < i; j++) {
list.add(j);
}
- final Iterator<List<Integer>> it = new PermutationIterator<>(list);
+ Iterator<List<Integer>> it = new PermutationIterator<>(list);
int count = 0;
while (it.hasNext()) {
it.next();
@@ -92,12 +92,12 @@ public class PermutationIteratorTest extends AbstractIteratorTest<List<Character
*/
@SuppressWarnings("boxing") // OK in test code
public void testPermutationExhaustivity() {
- final List<Character> perm1 = new ArrayList<>();
- final List<Character> perm2 = new ArrayList<>();
- final List<Character> perm3 = new ArrayList<>();
- final List<Character> perm4 = new ArrayList<>();
- final List<Character> perm5 = new ArrayList<>();
- final List<Character> perm6 = new ArrayList<>();
+ List<Character> perm1 = new ArrayList<>();
+ List<Character> perm2 = new ArrayList<>();
+ List<Character> perm3 = new ArrayList<>();
+ List<Character> perm4 = new ArrayList<>();
+ List<Character> perm5 = new ArrayList<>();
+ List<Character> perm6 = new ArrayList<>();
perm1.add('A');
perm2.add('A');
@@ -120,11 +120,11 @@ public class PermutationIteratorTest extends AbstractIteratorTest<List<Character
perm5.add('B');
perm6.add('A');
- final List<List<Character>> results = new ArrayList<>();
+ List<List<Character>> results = new ArrayList<>();
- final PermutationIterator<Character> it = makeObject();
+ PermutationIterator<Character> it = makeObject();
while (it.hasNext()) {
- final List<Character> next = it.next();
+ List<Character> next = it.next();
results.add(next);
}
//3! permutation for 3 elements
@@ -141,12 +141,12 @@ public class PermutationIteratorTest extends AbstractIteratorTest<List<Character
* test checking that all the permutations are returned only once.
*/
public void testPermutationUnicity() {
- final List<List<Character>> resultsList = new ArrayList<>();
- final Set<List<Character>> resultsSet = new HashSet<>();
+ List<List<Character>> resultsList = new ArrayList<>();
+ Set<List<Character>> resultsSet = new HashSet<>();
- final PermutationIterator<Character> it = makeObject();
+ PermutationIterator<Character> it = makeObject();
while (it.hasNext()) {
- final List<Character> permutation = it.next();
+ List<Character> permutation = it.next();
resultsList.add(permutation);
resultsSet.add(permutation);
}
@@ -156,24 +156,24 @@ public class PermutationIteratorTest extends AbstractIteratorTest<List<Character
}
public void testPermutationException() {
- final List<List<Character>> resultsList = new ArrayList<>();
+ List<List<Character>> resultsList = new ArrayList<>();
- final PermutationIterator<Character> it = makeObject();
+ PermutationIterator<Character> it = makeObject();
while (it.hasNext()) {
- final List<Character> permutation = it.next();
+ List<Character> permutation = it.next();
resultsList.add(permutation);
}
//asking for another permutation should throw an exception
try {
it.next();
fail();
- } catch (final NoSuchElementException e) {
+ } catch (NoSuchElementException e) {
// expected
}
}
public void testPermutatorHasMore() {
- final PermutationIterator<Character> it = makeObject();
+ PermutationIterator<Character> it = makeObject();
for (int i = 0; i < 6; i++) {
assertTrue(it.hasNext());
it.next();
@@ -182,11 +182,11 @@ public class PermutationIteratorTest extends AbstractIteratorTest<List<Character
}
public void testEmptyCollection() {
- final PermutationIterator<Character> it = makeEmptyIterator();
+ PermutationIterator<Character> it = makeEmptyIterator();
// there is one permutation for an empty set: 0! = 1
assertTrue(it.hasNext());
- final List<Character> nextPermutation = it.next();
+ List<Character> nextPermutation = it.next();
assertEquals(0, nextPermutation.size());
assertFalse(it.hasNext());
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java b/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java
index ad30e8d..3b7a9c0 100644
--- a/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java
+++ b/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java
@@ -68,7 +68,7 @@ public class PushbackIteratorTest<E> extends AbstractIteratorTest<E> {
@Test
public void testNormalIteration() {
- final PushbackIterator<E> iter = makeObject();
+ PushbackIterator<E> iter = makeObject();
assertEquals("a", iter.next());
assertEquals("b", iter.next());
assertEquals("c", iter.next());
@@ -78,7 +78,7 @@ public class PushbackIteratorTest<E> extends AbstractIteratorTest<E> {
@Test
@SuppressWarnings("unchecked")
public void testImmediatePushback() {
- final PushbackIterator<E> iter = makeObject();
+ PushbackIterator<E> iter = makeObject();
iter.pushback((E) "x");
assertEquals("x", iter.next());
assertEquals("a", iter.next());
@@ -88,7 +88,7 @@ public class PushbackIteratorTest<E> extends AbstractIteratorTest<E> {
@Test
@SuppressWarnings("unchecked")
public void testDelayedPushback() {
- final PushbackIterator<E> iter = makeObject();
+ PushbackIterator<E> iter = makeObject();
assertEquals("a", iter.next());
iter.pushback((E) "x");
assertEquals("x", iter.next());
@@ -99,7 +99,7 @@ public class PushbackIteratorTest<E> extends AbstractIteratorTest<E> {
@Test
@SuppressWarnings("unchecked")
public void testMultiplePushback() {
- final PushbackIterator<E> iter = makeObject();
+ PushbackIterator<E> iter = makeObject();
assertEquals("a", iter.next());
iter.pushback((E) "x");
iter.pushback((E) "y");
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/iterators/SkippingIteratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/iterators/SkippingIteratorTest.java b/src/test/java/org/apache/commons/collections4/iterators/SkippingIteratorTest.java
index c0ebf41..052201a 100644
--- a/src/test/java/org/apache/commons/collections4/iterators/SkippingIteratorTest.java
+++ b/src/test/java/org/apache/commons/collections4/iterators/SkippingIteratorTest.java
@@ -66,7 +66,7 @@ public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testSkipping() {
- final Iterator<E> iter = new SkippingIterator<>(testList.iterator(), 2);
+ Iterator<E> iter = new SkippingIterator<>(testList.iterator(), 2);
assertTrue(iter.hasNext());
assertEquals("c", iter.next());
@@ -83,7 +83,7 @@ public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
try {
iter.next();
fail("Expected NoSuchElementException.");
- } catch (final NoSuchElementException nsee) { /* Success case */
+ } catch (NoSuchElementException nsee) { /* Success case */
}
}
@@ -94,7 +94,7 @@ public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testSameAsDecorated() {
- final Iterator<E> iter = new SkippingIterator<>(testList.iterator(), 0);
+ Iterator<E> iter = new SkippingIterator<>(testList.iterator(), 0);
assertTrue(iter.hasNext());
assertEquals("a", iter.next());
@@ -115,7 +115,7 @@ public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
try {
iter.next();
fail("Expected NoSuchElementException.");
- } catch (final NoSuchElementException nsee) { /* Success case */
+ } catch (NoSuchElementException nsee) { /* Success case */
}
}
@@ -126,12 +126,12 @@ public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testOffsetGreaterThanSize() {
- final Iterator<E> iter = new SkippingIterator<>(testList.iterator(), 10);
+ Iterator<E> iter = new SkippingIterator<>(testList.iterator(), 10);
assertFalse(iter.hasNext());
try {
iter.next();
fail("Expected NoSuchElementException.");
- } catch (final NoSuchElementException nsee) { /* Success case */
+ } catch (NoSuchElementException nsee) { /* Success case */
}
}
@@ -144,7 +144,7 @@ public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
try {
new SkippingIterator<>(testList.iterator(), -1);
fail("Expected IllegalArgumentException.");
- } catch (final IllegalArgumentException iae) { /* Success case */
+ } catch (IllegalArgumentException iae) { /* Success case */
}
}
@@ -154,13 +154,13 @@ public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testRemoveWithoutCallingNext() {
- final List<E> testListCopy = new ArrayList<>(testList);
- final Iterator<E> iter = new SkippingIterator<>(testListCopy.iterator(), 1);
+ List<E> testListCopy = new ArrayList<>(testList);
+ Iterator<E> iter = new SkippingIterator<>(testListCopy.iterator(), 1);
try {
iter.remove();
fail("Expected IllegalStateException.");
- } catch (final IllegalStateException ise) { /* Success case */
+ } catch (IllegalStateException ise) { /* Success case */
}
}
@@ -170,8 +170,8 @@ public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testRemoveCalledTwice() {
- final List<E> testListCopy = new ArrayList<>(testList);
- final Iterator<E> iter = new SkippingIterator<>(testListCopy.iterator(), 1);
+ List<E> testListCopy = new ArrayList<>(testList);
+ Iterator<E> iter = new SkippingIterator<>(testListCopy.iterator(), 1);
assertTrue(iter.hasNext());
assertEquals("b", iter.next());
@@ -180,7 +180,7 @@ public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
try {
iter.remove();
fail("Expected IllegalStateException.");
- } catch (final IllegalStateException ise) { /* Success case */
+ } catch (IllegalStateException ise) { /* Success case */
}
}
@@ -190,8 +190,8 @@ public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testRemoveFirst() {
- final List<E> testListCopy = new ArrayList<>(testList);
- final Iterator<E> iter = new SkippingIterator<>(testListCopy.iterator(), 4);
+ List<E> testListCopy = new ArrayList<>(testList);
+ Iterator<E> iter = new SkippingIterator<>(testListCopy.iterator(), 4);
assertTrue(iter.hasNext());
assertEquals("e", iter.next());
@@ -208,7 +208,7 @@ public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
try {
iter.next();
fail("Expected NoSuchElementException.");
- } catch (final NoSuchElementException nsee) { /* Success case */
+ } catch (NoSuchElementException nsee) { /* Success case */
}
}
@@ -218,8 +218,8 @@ public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testRemoveMiddle() {
- final List<E> testListCopy = new ArrayList<>(testList);
- final Iterator<E> iter = new SkippingIterator<>(testListCopy.iterator(), 3);
+ List<E> testListCopy = new ArrayList<>(testList);
+ Iterator<E> iter = new SkippingIterator<>(testListCopy.iterator(), 3);
assertTrue(iter.hasNext());
assertEquals("d", iter.next());
@@ -238,7 +238,7 @@ public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
try {
iter.next();
fail("Expected NoSuchElementException.");
- } catch (final NoSuchElementException nsee) { /* Success case */
+ } catch (NoSuchElementException nsee) { /* Success case */
}
}
@@ -248,8 +248,8 @@ public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testRemoveLast() {
- final List<E> testListCopy = new ArrayList<>(testList);
- final Iterator<E> iter = new SkippingIterator<>(testListCopy.iterator(), 5);
+ List<E> testListCopy = new ArrayList<>(testList);
+ Iterator<E> iter = new SkippingIterator<>(testListCopy.iterator(), 5);
assertTrue(iter.hasNext());
assertEquals("f", iter.next());
@@ -260,7 +260,7 @@ public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
try {
iter.next();
fail("Expected NoSuchElementException.");
- } catch (final NoSuchElementException nsee) { /* Success case */
+ } catch (NoSuchElementException nsee) { /* Success case */
}
iter.remove();
@@ -270,7 +270,7 @@ public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
try {
iter.next();
fail("Expected NoSuchElementException.");
- } catch (final NoSuchElementException nsee) { /* Success case */
+ } catch (NoSuchElementException nsee) { /* Success case */
}
}
@@ -280,20 +280,20 @@ public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
*/
@Test
public void testRemoveUnsupported() {
- final Iterator<E> mockIterator = new AbstractIteratorDecorator<E>(testList.iterator()) {
+ Iterator<E> mockIterator = new AbstractIteratorDecorator<E>(testList.iterator()) {
@Override
public void remove() {
throw new UnsupportedOperationException();
}
};
- final Iterator<E> iter = new SkippingIterator<>(mockIterator, 1);
+ Iterator<E> iter = new SkippingIterator<>(mockIterator, 1);
assertTrue(iter.hasNext());
assertEquals("b", iter.next());
try {
iter.remove();
fail("Expected UnsupportedOperationException.");
- } catch (final UnsupportedOperationException usoe) { /* Success case */
+ } catch (UnsupportedOperationException usoe) { /* Success case */
}
}
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/iterators/ZippingIteratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/iterators/ZippingIteratorTest.java b/src/test/java/org/apache/commons/collections4/iterators/ZippingIteratorTest.java
index 59d3eb3..104acf2 100644
--- a/src/test/java/org/apache/commons/collections4/iterators/ZippingIteratorTest.java
+++ b/src/test/java/org/apache/commons/collections4/iterators/ZippingIteratorTest.java
@@ -100,7 +100,7 @@ public class ZippingIteratorTest extends AbstractIteratorTest<Integer> {
final ZippingIterator<Integer> iter = new ZippingIterator<>(odds.iterator(), evens.iterator());
for (int i = 0, j = 0; i < 20; i++) {
assertTrue(iter.hasNext());
- final int val = iter.next();
+ int val = iter.next();
if (i % 2 == 0) {
assertEquals(odds.get(j).intValue(), val);
} else {
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java b/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java
index 5285674..bb6741f 100644
--- a/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java
+++ b/src/test/java/org/apache/commons/collections4/list/AbstractListTest.java
@@ -472,7 +472,7 @@ public abstract class AbstractListTest<E> extends AbstractCollectionTest<E> {
final List<E> list1 = getCollection();
final List<E> list2 = getConfirmed();
- for (final E element : list2) {
+ for (E element : list2) {
assertEquals("indexOf should return correct result",
list1.indexOf(element), list2.indexOf(element));
verify();
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java b/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java
index 1207dc8..01b5e2f 100644
--- a/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java
+++ b/src/test/java/org/apache/commons/collections4/list/SetUniqueListTest.java
@@ -463,11 +463,11 @@ public class SetUniqueListTest<E> extends AbstractListTest<E> {
public void testSubListIsUnmodifiable() {
resetFull();
- final List<E> subList = getCollection().subList(1, 3);
+ List<E> subList = getCollection().subList(1, 3);
try {
subList.remove(0);
fail("subList should be unmodifiable");
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
// expected
}
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/list/TreeListTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/list/TreeListTest.java b/src/test/java/org/apache/commons/collections4/list/TreeListTest.java
index 5b0dba9..b077b7a 100644
--- a/src/test/java/org/apache/commons/collections4/list/TreeListTest.java
+++ b/src/test/java/org/apache/commons/collections4/list/TreeListTest.java
@@ -273,20 +273,20 @@ public class TreeListTest<E> extends AbstractListTest<E> {
// when initializing the TreeList with another collection
for (int size = 1; size < 1000; size++) {
- final List<Integer> other = new ArrayList<>(size);
+ List<Integer> other = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
other.add(i);
}
- final TreeList<Integer> l = new TreeList<>(other);
- final ListIterator<Integer> it = l.listIterator();
+ TreeList<Integer> l = new TreeList<>(other);
+ ListIterator<Integer> it = l.listIterator();
int i = 0;
while (it.hasNext()) {
- final Integer val = it.next();
+ Integer val = it.next();
assertEquals(i++, val.intValue());
}
while (it.hasPrevious()) {
- final Integer val = it.previous();
+ Integer val = it.previous();
assertEquals(--i, val.intValue());
}
}
@@ -301,28 +301,28 @@ public class TreeListTest<E> extends AbstractListTest<E> {
// to simulate different cases in addAll, do different runs where
// the number of elements already in the list and being added by addAll differ
- final int size = 1000;
+ int size = 1000;
for (int i = 0; i < 100; i++) {
- final List<Integer> other = new ArrayList<>(size);
+ List<Integer> other = new ArrayList<>(size);
for (int j = i; j < size; j++) {
other.add(j);
}
- final TreeList<Integer> l = new TreeList<>();
+ TreeList<Integer> l = new TreeList<>();
for (int j = 0; j < i; j++) {
l.add(j);
}
l.addAll(other);
- final ListIterator<Integer> it = l.listIterator();
+ ListIterator<Integer> it = l.listIterator();
int cnt = 0;
while (it.hasNext()) {
- final Integer val = it.next();
+ Integer val = it.next();
assertEquals(cnt++, val.intValue());
}
while (it.hasPrevious()) {
- final Integer val = it.previous();
+ Integer val = it.previous();
assertEquals(--cnt, val.intValue());
}
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java b/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java
index 50c09af..ccd1fc3 100644
--- a/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/map/AbstractMapTest.java
@@ -624,14 +624,14 @@ public abstract class AbstractMapTest<K, V> extends AbstractObjectTest {
final Object[] keys = getSampleKeys();
resetEmpty();
- for (final Object key : keys) {
+ for (Object key : keys) {
assertTrue("Map must not contain key when map is empty",
!getMap().containsKey(key));
}
verify();
resetFull();
- for (final Object key : keys) {
+ for (Object key : keys) {
assertTrue("Map must contain key for a mapping in the map. " +
"Missing: " + key, getMap().containsKey(key));
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/map/AbstractSortedMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/map/AbstractSortedMapTest.java b/src/test/java/org/apache/commons/collections4/map/AbstractSortedMapTest.java
index 86a9bb9..7a33ae4 100644
--- a/src/test/java/org/apache/commons/collections4/map/AbstractSortedMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/map/AbstractSortedMapTest.java
@@ -90,7 +90,7 @@ public abstract class AbstractSortedMapTest<K, V> extends AbstractMapTest<K, V>
public void testLastKey() {
final SortedMap<K, V> sm = makeFullMap();
K obj = null;
- for (final K k : sm.keySet()) {
+ for (K k : sm.keySet()) {
obj = k;
}
assertSame(obj, sm.lastKey());
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java b/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java
index ff9fc1b..fb6ee99 100644
--- a/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/map/LRUMapTest.java
@@ -74,42 +74,42 @@ public class LRUMapTest<K, V> extends AbstractOrderedMapTest<K, V> {
try {
new LRUMap<K, V>(0);
fail("maxSize must be positive");
- } catch(final IllegalArgumentException ex) {
+ } catch(IllegalArgumentException ex) {
// expected
}
try {
new LRUMap<K, V>(-1, 12, 0.75f, false);
fail("maxSize must be positive");
- } catch(final IllegalArgumentException ex) {
+ } catch(IllegalArgumentException ex) {
// expected
}
try {
new LRUMap<K, V>(10, -1);
fail("initialSize must not be negative");
- } catch(final IllegalArgumentException ex) {
+ } catch(IllegalArgumentException ex) {
// expected
}
try {
new LRUMap<K, V>(10, 12);
fail("initialSize must not be larger than maxSize");
- } catch(final IllegalArgumentException ex) {
+ } catch(IllegalArgumentException ex) {
// expected
}
try {
new LRUMap<K, V>(10, -1, 0.75f, false);
fail("initialSize must not be negative");
- } catch(final IllegalArgumentException ex) {
+ } catch(IllegalArgumentException ex) {
// expected
}
try {
new LRUMap<K, V>(10, 12, 0.75f, false);
fail("initialSize must not be larger than maxSize");
- } catch(final IllegalArgumentException ex) {
+ } catch(IllegalArgumentException ex) {
// expected
}
}
@@ -280,7 +280,7 @@ public class LRUMapTest<K, V> extends AbstractOrderedMapTest<K, V> {
Iterator<V> vit = null;
resetEmpty();
- final LRUMap<K, V> lruMap = (LRUMap<K, V>) map;
+ LRUMap<K, V> lruMap = (LRUMap<K, V>) map;
lruMap.put(keys[0], values[0]);
lruMap.put(keys[1], values[1]);
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java b/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java
index b0238c6..a79227b 100644
--- a/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/map/ListOrderedMapTest.java
@@ -386,13 +386,13 @@ public class ListOrderedMapTest<K, V> extends AbstractOrderedMapTest<K, V> {
}
public void testCOLLECTIONS_474_nullValues () {
- final Object key1 = new Object();
- final Object key2 = new Object();
- final HashMap<Object, Object> hmap = new HashMap<>();
+ Object key1 = new Object();
+ Object key2 = new Object();
+ HashMap<Object, Object> hmap = new HashMap<>();
hmap.put(key1, null);
hmap.put(key2, null);
assertEquals("Should have two elements", 2, hmap.size());
- final ListOrderedMap<Object, Object> listMap = new ListOrderedMap<>();
+ ListOrderedMap<Object, Object> listMap = new ListOrderedMap<>();
listMap.put(key1, null);
listMap.put(key2, null);
assertEquals("Should have two elements", 2, listMap.size());
@@ -400,13 +400,13 @@ public class ListOrderedMapTest<K, V> extends AbstractOrderedMapTest<K, V> {
}
public void testCOLLECTIONS_474_nonNullValues () {
- final Object key1 = new Object();
- final Object key2 = new Object();
- final HashMap<Object, Object> hmap = new HashMap<>();
+ Object key1 = new Object();
+ Object key2 = new Object();
+ HashMap<Object, Object> hmap = new HashMap<>();
hmap.put(key1, "1");
hmap.put(key2, "2");
assertEquals("Should have two elements", 2, hmap.size());
- final ListOrderedMap<Object, Object> listMap = new ListOrderedMap<>();
+ ListOrderedMap<Object, Object> listMap = new ListOrderedMap<>();
listMap.put(key1, "3");
listMap.put(key2, "4");
assertEquals("Should have two elements", 2, listMap.size());
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java b/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java
index 5f63f02..64310d3 100644
--- a/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/map/MultiValueMapTest.java
@@ -152,11 +152,10 @@ public class MultiValueMapTest<K, V> extends AbstractObjectTest {
public void testIterator() {
final MultiValueMap<K, V> map = createTestMap();
@SuppressWarnings("unchecked")
- final
Collection<V> values = new ArrayList<>((Collection<V>) map.values());
- final Iterator<Map.Entry<K, V>> iterator = map.iterator();
+ Iterator<Map.Entry<K, V>> iterator = map.iterator();
while (iterator.hasNext()) {
- final Map.Entry<K, V> entry = iterator.next();
+ Map.Entry<K, V> entry = iterator.next();
assertTrue(map.containsValue(entry.getKey(), entry.getValue()));
assertTrue(values.contains(entry.getValue()));
assertTrue(values.remove(entry.getValue()));
@@ -393,24 +392,24 @@ public class MultiValueMapTest<K, V> extends AbstractObjectTest {
}
public void testUnsafeDeSerialization() throws Exception {
- final MultiValueMap map1 = MultiValueMap.multiValueMap(new HashMap(), ArrayList.class);
+ MultiValueMap map1 = MultiValueMap.multiValueMap(new HashMap(), ArrayList.class);
byte[] bytes = serialize(map1);
Object result = deserialize(bytes);
assertEquals(map1, result);
- final MultiValueMap map2 = MultiValueMap.multiValueMap(new HashMap(), (Class) String.class);
+ MultiValueMap map2 = MultiValueMap.multiValueMap(new HashMap(), (Class) String.class);
bytes = serialize(map2);
try {
result = deserialize(bytes);
fail("unsafe clazz accepted when de-serializing MultiValueMap");
- } catch (final UnsupportedOperationException ex) {
+ } catch (UnsupportedOperationException ex) {
// expected
}
}
private byte[] serialize(final Object object) throws IOException {
- final ByteArrayOutputStream baos = new ByteArrayOutputStream();
- final ObjectOutputStream oos = new ObjectOutputStream(baos);
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(object);
oos.close();
@@ -419,8 +418,8 @@ public class MultiValueMapTest<K, V> extends AbstractObjectTest {
}
private Object deserialize(final byte[] data) throws IOException, ClassNotFoundException {
- final ByteArrayInputStream bais = new ByteArrayInputStream(data);
- final ObjectInputStream iis = new ObjectInputStream(bais);
+ ByteArrayInputStream bais = new ByteArrayInputStream(data);
+ ObjectInputStream iis = new ObjectInputStream(bais);
return iis.readObject();
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java b/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java
index 6e42b84..8da6831 100644
--- a/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/map/PassiveExpiringMapTest.java
@@ -241,7 +241,7 @@ public class PassiveExpiringMapTest<K, V> extends AbstractMapTest<K, V> {
try {
Thread.sleep(2 * timeout);
- } catch (final InterruptedException e) {
+ } catch (InterruptedException e) {
fail();
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
index 78e8d17..41d92f7 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
@@ -206,7 +206,6 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
public void testMultipleValues() {
final MultiValuedMap<K, V> map = makeFullMap();
@SuppressWarnings("unchecked")
- final
Collection<V> col = map.get((K) "one");
assertTrue(col.contains("uno"));
assertTrue(col.contains("un"));
@@ -230,8 +229,8 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
}
resetEmpty();
final MultiValuedMap<K, V> map = getMap();
- final Collection<V> col1 = map.get((K) "one");
- final Collection<V> col2 = map.get((K) "one");
+ Collection<V> col1 = map.get((K) "one");
+ Collection<V> col2 = map.get((K) "one");
assertTrue(col1.isEmpty());
assertTrue(col2.isEmpty());
assertEquals(0, map.size());
@@ -276,7 +275,6 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
resetFull();
final MultiValuedMap<K, V> map = getMap();
@SuppressWarnings("unchecked")
- final
Iterator<V> it = map.get((K) "one").iterator();
while (it.hasNext()) {
it.next();
@@ -288,7 +286,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
assertFalse(map.containsValue("uno"));
assertFalse(map.containsValue("un"));
assertEquals(4, map.size());
- final Collection<V> coll = map.remove("one");
+ Collection<V> coll = map.remove("one");
assertNotNull(coll);
assertEquals(0, coll.size());
}
@@ -356,7 +354,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
return;
}
final MultiValuedMap<K, V> map = makeFullMap();
- final Collection<V> values = map.values();
+ Collection<V> values = map.values();
values.remove("uno");
values.remove("un");
assertFalse(map.containsKey("one"));
@@ -390,10 +388,10 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
public void testEntriesCollectionIterator() {
final MultiValuedMap<K, V> map = makeFullMap();
- final Collection<V> values = new ArrayList<>(map.values());
- final Iterator<Map.Entry<K, V>> iterator = map.entries().iterator();
+ Collection<V> values = new ArrayList<>(map.values());
+ Iterator<Map.Entry<K, V>> iterator = map.entries().iterator();
while (iterator.hasNext()) {
- final Map.Entry<K, V> entry = iterator.next();
+ Map.Entry<K, V> entry = iterator.next();
assertTrue(map.containsMapping(entry.getKey(), entry.getValue()));
assertTrue(values.contains(entry.getValue()));
if (isRemoveSupported()) {
@@ -598,7 +596,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
try {
map.putAll((K) "A", null);
fail("expecting NullPointerException");
- } catch (final NullPointerException npe) {
+ } catch (NullPointerException npe) {
// expected
}
@@ -640,8 +638,8 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
}
public void testKeysMultiSet() {
- final MultiValuedMap<K, V> map = makeFullMap();
- final MultiSet<K> keyMultiSet = map.keys();
+ MultiValuedMap<K, V> map = makeFullMap();
+ MultiSet<K> keyMultiSet = map.keys();
assertEquals(2, keyMultiSet.getCount("one"));
assertEquals(2, keyMultiSet.getCount("two"));
assertEquals(2, keyMultiSet.getCount("three"));
@@ -649,13 +647,13 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
}
public void testKeysBagIterator() {
- final MultiValuedMap<K, V> map = makeFullMap();
- final Collection<K> col = new ArrayList<>();
- final Iterator<K> it = map.keys().iterator();
+ MultiValuedMap<K, V> map = makeFullMap();
+ Collection<K> col = new ArrayList<>();
+ Iterator<K> it = map.keys().iterator();
while (it.hasNext()) {
col.add(it.next());
}
- final Bag<K> bag = new HashBag<>(col);
+ Bag<K> bag = new HashBag<>(col);
assertEquals(2, bag.getCount("one"));
assertEquals(2, bag.getCount("two"));
assertEquals(2, bag.getCount("three"));
@@ -664,9 +662,9 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
@SuppressWarnings("unchecked")
public void testKeysBagContainsAll() {
- final MultiValuedMap<K, V> map = makeFullMap();
- final MultiSet<K> keyMultiSet = map.keys();
- final Collection<K> col = (Collection<K>) Arrays.asList("one", "two", "three", "one", "two", "three");
+ MultiValuedMap<K, V> map = makeFullMap();
+ MultiSet<K> keyMultiSet = map.keys();
+ Collection<K> col = (Collection<K>) Arrays.asList("one", "two", "three", "one", "two", "three");
assertTrue(keyMultiSet.containsAll(col));
}
@@ -678,7 +676,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
resetFull();
mapCol = getMap().asMap();
- final Collection<V> col = mapCol.get("one");
+ Collection<V> col = mapCol.get("one");
assertNotNull(col);
assertTrue(col.contains("un"));
assertTrue(col.contains("uno"));
@@ -689,7 +687,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
return;
}
resetFull();
- final Map<K, Collection<V>> mapCol = getMap().asMap();
+ Map<K, Collection<V>> mapCol = getMap().asMap();
mapCol.remove("one");
assertFalse(getMap().containsKey("one"));
assertEquals(4, getMap().size());
@@ -703,8 +701,8 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
resetFull();
mapIt = getMap().mapIterator();
while (mapIt.hasNext()) {
- final K key = mapIt.next();
- final V value = mapIt.getValue();
+ K key = mapIt.next();
+ V value = mapIt.getValue();
assertTrue(getMap().containsMapping(key, value));
}
}
@@ -714,7 +712,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
return;
}
resetFull();
- final MapIterator<K, V> mapIt = getMap().mapIterator();
+ MapIterator<K, V> mapIt = getMap().mapIterator();
while (mapIt.hasNext()) {
mapIt.next();
mapIt.remove();
@@ -725,12 +723,12 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
@SuppressWarnings("unchecked")
public void testMapIteratorUnsupportedSet() {
resetFull();
- final MapIterator<K, V> mapIt = getMap().mapIterator();
+ MapIterator<K, V> mapIt = getMap().mapIterator();
mapIt.next();
try {
mapIt.setValue((V) "some value");
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
}
@@ -1077,8 +1075,8 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
@Override
@SuppressWarnings("unchecked")
public K[] getSampleKeys() {
- final K[] samplekeys = AbstractMultiValuedMapTest.this.getSampleKeys();
- final Object[] finalKeys = new Object[3];
+ K[] samplekeys = AbstractMultiValuedMapTest.this.getSampleKeys();
+ Object[] finalKeys = new Object[3];
for (int i = 0; i < 3; i++) {
finalKeys[i] = samplekeys[i * 2];
}
@@ -1088,11 +1086,11 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
@Override
@SuppressWarnings("unchecked")
public Collection<V>[] getSampleValues() {
- final boolean isSetValuedMap = AbstractMultiValuedMapTest.this.getMap() instanceof SetValuedMap;
- final V[] sampleValues = AbstractMultiValuedMapTest.this.getSampleValues();
- final Collection<V>[] colArr = new Collection[3];
+ boolean isSetValuedMap = AbstractMultiValuedMapTest.this.getMap() instanceof SetValuedMap;
+ V[] sampleValues = AbstractMultiValuedMapTest.this.getSampleValues();
+ Collection<V>[] colArr = new Collection[3];
for(int i = 0; i < 3; i++) {
- final Collection<V> coll = Arrays.asList(sampleValues[i*2], sampleValues[i*2 + 1]);
+ Collection<V> coll = Arrays.asList(sampleValues[i*2], sampleValues[i*2 + 1]);
colArr[i] = isSetValuedMap ? new HashSet<>(coll) : coll;
}
return colArr;
@@ -1101,11 +1099,11 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
@Override
@SuppressWarnings("unchecked")
public Collection<V>[] getNewSampleValues() {
- final boolean isSetValuedMap = AbstractMultiValuedMapTest.this.getMap() instanceof SetValuedMap;
- final Object[] sampleValues = { "ein", "ek", "zwei", "duey", "drei", "teen" };
- final Collection<V>[] colArr = new Collection[3];
+ boolean isSetValuedMap = AbstractMultiValuedMapTest.this.getMap() instanceof SetValuedMap;
+ Object[] sampleValues = { "ein", "ek", "zwei", "duey", "drei", "teen" };
+ Collection<V>[] colArr = new Collection[3];
for (int i = 0; i < 3; i++) {
- final Collection<V> coll = Arrays.asList((V) sampleValues[i * 2], (V) sampleValues[i * 2 + 1]);
+ Collection<V> coll = Arrays.asList((V) sampleValues[i * 2], (V) sampleValues[i * 2 + 1]);
colArr[i] = isSetValuedMap ? new HashSet<>(coll) : coll;
}
return colArr;
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java
index 260947c..57b38f6 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/ArrayListValuedHashMapTest.java
@@ -51,7 +51,7 @@ public class ArrayListValuedHashMapTest<K, V> extends AbstractMultiValuedMapTest
public void testListValuedMapAdd() {
final ListValuedMap<K, V> listMap = makeObject();
assertTrue(listMap.get((K) "whatever") instanceof List);
- final List<V> list = listMap.get((K) "A");
+ List<V> list = listMap.get((K) "A");
list.add((V) "a1");
assertEquals(1, listMap.size());
assertTrue(listMap.containsKey("A"));
@@ -60,7 +60,7 @@ public class ArrayListValuedHashMapTest<K, V> extends AbstractMultiValuedMapTest
@SuppressWarnings("unchecked")
public void testListValuedMapAddViaListIterator() {
final ListValuedMap<K, V> listMap = makeObject();
- final ListIterator<V> listIt = listMap.get((K) "B").listIterator();
+ ListIterator<V> listIt = listMap.get((K) "B").listIterator();
assertFalse(listIt.hasNext());
listIt.add((V) "b1");
listIt.add((V) "b2");
@@ -74,7 +74,7 @@ public class ArrayListValuedHashMapTest<K, V> extends AbstractMultiValuedMapTest
@SuppressWarnings("unchecked")
public void testListValuedMapRemove() {
final ListValuedMap<K, V> listMap = makeObject();
- final List<V> list = listMap.get((K) "A");
+ List<V> list = listMap.get((K) "A");
list.add((V) "a1");
list.add((V) "a2");
list.add((V) "a3");
@@ -110,8 +110,8 @@ public class ArrayListValuedHashMapTest<K, V> extends AbstractMultiValuedMapTest
@SuppressWarnings({ "unchecked", "rawtypes" })
public void testEqualsHashCodeContract() {
- final MultiValuedMap map1 = makeObject();
- final MultiValuedMap map2 = makeObject();
+ MultiValuedMap map1 = makeObject();
+ MultiValuedMap map2 = makeObject();
map1.put("a", "a1");
map1.put("a", "a2");
@@ -127,8 +127,8 @@ public class ArrayListValuedHashMapTest<K, V> extends AbstractMultiValuedMapTest
@SuppressWarnings({ "unchecked", "rawtypes" })
public void testListValuedMapEqualsHashCodeContract() {
- final ListValuedMap map1 = makeObject();
- final ListValuedMap map2 = makeObject();
+ ListValuedMap map1 = makeObject();
+ ListValuedMap map2 = makeObject();
map1.put("a", "a1");
map1.put("a", "a2");
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java
index 2a46641..7455831 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/HashSetValuedHashMapTest.java
@@ -57,7 +57,7 @@ public class HashSetValuedHashMapTest<K, V> extends AbstractMultiValuedMapTest<K
final SetValuedMap<K, V> setMap = makeObject();
assertTrue(setMap.get((K) "whatever") instanceof Set);
- final Set<V> set = setMap.get((K) "A");
+ Set<V> set = setMap.get((K) "A");
assertTrue(set.add((V) "a1"));
assertTrue(set.add((V) "a2"));
assertFalse(set.add((V) "a1"));
@@ -70,7 +70,7 @@ public class HashSetValuedHashMapTest<K, V> extends AbstractMultiValuedMapTest<K
final SetValuedMap<K, V> setMap = makeObject();
assertTrue(setMap.get((K) "whatever") instanceof Set);
- final Set<V> set = setMap.get((K) "A");
+ Set<V> set = setMap.get((K) "A");
assertTrue(set.add((V) "a1"));
assertTrue(set.add((V) "a2"));
assertFalse(set.add((V) "a1"));
@@ -90,12 +90,12 @@ public class HashSetValuedHashMapTest<K, V> extends AbstractMultiValuedMapTest<K
final SetValuedMap<K, V> setMap = makeObject();
assertTrue(setMap.get((K) "whatever") instanceof Set);
- final Set<V> set = setMap.get((K) "A");
+ Set<V> set = setMap.get((K) "A");
set.add((V) "a1");
set.add((V) "a2");
set.add((V) "a1");
- final Iterator<V> it = set.iterator();
+ Iterator<V> it = set.iterator();
while (it.hasNext()) {
it.next();
it.remove();
@@ -106,8 +106,8 @@ public class HashSetValuedHashMapTest<K, V> extends AbstractMultiValuedMapTest<K
@SuppressWarnings({ "unchecked", "rawtypes" })
public void testSetValuedMapEqualsHashCodeContract() {
- final SetValuedMap map1 = makeObject();
- final SetValuedMap map2 = makeObject();
+ SetValuedMap map1 = makeObject();
+ SetValuedMap map2 = makeObject();
map1.put("a", "a1");
map1.put("a", "a2");
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMapTest.java
index 559d725..0133ee0 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/TransformedMultiValuedMapTest.java
@@ -53,7 +53,7 @@ public class TransformedMultiValuedMapTest<K, V> extends AbstractMultiValuedMapT
public void testKeyTransformedMap() {
final Object[] els = new Object[] { "1", "3", "5", "7", "2", "4", "6" };
- final MultiValuedMap<K, V> map = TransformedMultiValuedMap.transformingMap(
+ MultiValuedMap<K, V> map = TransformedMultiValuedMap.transformingMap(
new ArrayListValuedHashMap<K, V>(),
(Transformer<? super K, ? extends K>) TransformedCollectionTest.STRING_TO_INTEGER_TRANSFORMER,
null);
@@ -67,7 +67,7 @@ public class TransformedMultiValuedMapTest<K, V> extends AbstractMultiValuedMapT
assertEquals(true, map.get((K) Integer.valueOf((String) els[i])).contains(els[i]));
}
- final Collection<V> coll = map.remove(els[0]);
+ Collection<V> coll = map.remove(els[0]);
assertNotNull(coll);
assertEquals(0, coll.size());
assertEquals(true, map.remove(Integer.valueOf((String) els[0])).contains(els[0]));
@@ -77,7 +77,7 @@ public class TransformedMultiValuedMapTest<K, V> extends AbstractMultiValuedMapT
public void testValueTransformedMap() {
final Object[] els = new Object[] { "1", "3", "5", "7", "2", "4", "6" };
- final MultiValuedMap<K, V> map = TransformedMultiValuedMap.transformingMap(
+ MultiValuedMap<K, V> map = TransformedMultiValuedMap.transformingMap(
new ArrayListValuedHashMap<K, V>(), null,
(Transformer<? super V, ? extends V>) TransformedCollectionTest.STRING_TO_INTEGER_TRANSFORMER);
assertEquals(0, map.size());
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java
index 22e76ce..ad2d776 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/UnmodifiableMultiValuedMapTest.java
@@ -85,179 +85,179 @@ public class UnmodifiableMultiValuedMapTest<K, V> extends AbstractMultiValuedMap
try {
UnmodifiableMultiValuedMap.unmodifiableMultiValuedMap(null);
fail("map must not be null");
- } catch (final NullPointerException e) {
+ } catch (NullPointerException e) {
// expected
}
}
@SuppressWarnings("unchecked")
public void testAddException() {
- final MultiValuedMap<K, V> map = makeObject();
+ MultiValuedMap<K, V> map = makeObject();
try {
map.put((K) "one", (V) "uno");
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
}
@SuppressWarnings("unchecked")
public void testUnmodifiableEntries() {
resetFull();
- final Collection<Entry<K, V>> entries = getMap().entries();
+ Collection<Entry<K, V>> entries = getMap().entries();
try {
entries.clear();
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
- final Iterator<Entry<K, V>> it = entries.iterator();
- final Entry<K, V> entry = it.next();
+ Iterator<Entry<K, V>> it = entries.iterator();
+ Entry<K, V> entry = it.next();
try {
it.remove();
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
try {
entry.setValue((V) "three");
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
}
@SuppressWarnings("unchecked")
public void testUnmodifiableMapIterator() {
resetFull();
- final MapIterator<K, V> mapIt = getMap().mapIterator();
+ MapIterator<K, V> mapIt = getMap().mapIterator();
try {
mapIt.remove();
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
try {
mapIt.setValue((V) "three");
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
}
@SuppressWarnings("unchecked")
public void testUnmodifiableKeySet() {
resetFull();
- final Set<K> keySet = getMap().keySet();
+ Set<K> keySet = getMap().keySet();
try {
keySet.add((K) "four");
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
try {
keySet.remove("four");
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
try {
keySet.clear();
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
- final Iterator<K> it = keySet.iterator();
+ Iterator<K> it = keySet.iterator();
try {
it.remove();
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
}
@SuppressWarnings("unchecked")
public void testUnmodifiableValues() {
resetFull();
- final Collection<V> values = getMap().values();
+ Collection<V> values = getMap().values();
try {
values.add((V) "four");
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
try {
values.remove("four");
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
try {
values.clear();
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
- final Iterator<V> it = values.iterator();
+ Iterator<V> it = values.iterator();
try {
it.remove();
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
}
@SuppressWarnings("unchecked")
public void testUnmodifiableAsMap() {
resetFull();
- final Map<K, Collection<V>> mapCol = getMap().asMap();
+ Map<K, Collection<V>> mapCol = getMap().asMap();
try {
mapCol.put((K) "four", (Collection<V>) Arrays.asList("four"));
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
try {
mapCol.remove("four");
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
try {
mapCol.clear();
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
try {
mapCol.clear();
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
}
@SuppressWarnings("unchecked")
public void testUnmodifiableKeys() {
resetFull();
- final MultiSet<K> keys = getMap().keys();
+ MultiSet<K> keys = getMap().keys();
try {
keys.add((K) "four");
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
try {
keys.remove("four");
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
try {
keys.clear();
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
- final Iterator<K> it = keys.iterator();
+ Iterator<K> it = keys.iterator();
try {
it.remove();
fail();
- } catch (final UnsupportedOperationException e) {
+ } catch (UnsupportedOperationException e) {
}
}
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/queue/AbstractQueueTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/queue/AbstractQueueTest.java b/src/test/java/org/apache/commons/collections4/queue/AbstractQueueTest.java
index da33837..3d49d61 100644
--- a/src/test/java/org/apache/commons/collections4/queue/AbstractQueueTest.java
+++ b/src/test/java/org/apache/commons/collections4/queue/AbstractQueueTest.java
@@ -72,7 +72,7 @@ public abstract class AbstractQueueTest<E> extends AbstractCollectionTest<E> {
public void verify() {
super.verify();
final Iterator<E> iterator1 = getCollection().iterator();
- for (final E e : getConfirmed()) {
+ for (E e : getConfirmed()) {
assertTrue(iterator1.hasNext());
final Object o1 = iterator1.next();
final Object o2 = e;
http://git-wip-us.apache.org/repos/asf/commons-collections/blob/992ab3c9/src/test/java/org/apache/commons/collections4/queue/CircularFifoQueueTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/collections4/queue/CircularFifoQueueTest.java b/src/test/java/org/apache/commons/collections4/queue/CircularFifoQueueTest.java
index e38ade4..ac51874 100644
--- a/src/test/java/org/apache/commons/collections4/queue/CircularFifoQueueTest.java
+++ b/src/test/java/org/apache/commons/collections4/queue/CircularFifoQueueTest.java
@@ -48,7 +48,7 @@ public class CircularFifoQueueTest<E> extends AbstractQueueTest<E> {
public void verify() {
super.verify();
final Iterator<E> iterator1 = getCollection().iterator();
- for (final E e : getConfirmed()) {
+ for (E e : getConfirmed()) {
assertTrue(iterator1.hasNext());
final Object o1 = iterator1.next();
final Object o2 = e;