diff --git a/src/main/java/org/apache/commons/collections/CollectionUtils.java b/src/main/java/org/apache/commons/collections/CollectionUtils.java index db94a3714..a849f0a82 100644 --- a/src/main/java/org/apache/commons/collections/CollectionUtils.java +++ b/src/main/java/org/apache/commons/collections/CollectionUtils.java @@ -548,7 +548,7 @@ public class CollectionUtils { } final Transformer transformer = new Transformer() { - public EquatorWrapper transform(Object input) { + public EquatorWrapper transform(final Object input) { return new EquatorWrapper(equator, input); } }; @@ -579,7 +579,7 @@ public class CollectionUtils { } @Override - public boolean equals(Object obj) { + public boolean equals(final Object obj) { if (!(obj instanceof EquatorWrapper)) { return false; } diff --git a/src/main/java/org/apache/commons/collections/bidimap/DualLinkedHashBidiMap.java b/src/main/java/org/apache/commons/collections/bidimap/DualLinkedHashBidiMap.java index 5183e699e..9f0a9bacb 100644 --- a/src/main/java/org/apache/commons/collections/bidimap/DualLinkedHashBidiMap.java +++ b/src/main/java/org/apache/commons/collections/bidimap/DualLinkedHashBidiMap.java @@ -52,7 +52,7 @@ public class DualLinkedHashBidiMap extends AbstractDualBidiMap imple * * @param map the map whose mappings are to be placed in this map */ - public DualLinkedHashBidiMap(Map map) { + public DualLinkedHashBidiMap(final Map map) { super(new LinkedHashMap(), new LinkedHashMap()); putAll(map); } @@ -64,7 +64,7 @@ public class DualLinkedHashBidiMap extends AbstractDualBidiMap imple * @param reverseMap the reverse direction map * @param inverseBidiMap the inverse BidiMap */ - protected DualLinkedHashBidiMap(Map normalMap, Map reverseMap, BidiMap inverseBidiMap) { + protected DualLinkedHashBidiMap(final Map normalMap, final Map reverseMap, final BidiMap inverseBidiMap) { super(normalMap, reverseMap, inverseBidiMap); } @@ -84,12 +84,12 @@ public class DualLinkedHashBidiMap extends AbstractDualBidiMap imple // Serialization //----------------------------------------------------------------------- - private void writeObject(ObjectOutputStream out) throws IOException { + private void writeObject(final ObjectOutputStream out) throws IOException { out.defaultWriteObject(); out.writeObject(normalMap); } - private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); normalMap = new LinkedHashMap(); reverseMap = new LinkedHashMap(); diff --git a/src/main/java/org/apache/commons/collections/functors/InstantiateFactory.java b/src/main/java/org/apache/commons/collections/functors/InstantiateFactory.java index b32ce1b4a..dfc4e3650 100644 --- a/src/main/java/org/apache/commons/collections/functors/InstantiateFactory.java +++ b/src/main/java/org/apache/commons/collections/functors/InstantiateFactory.java @@ -53,8 +53,8 @@ public class InstantiateFactory implements Factory, Serializable { * @return a new instantiate factory */ public static Factory instantiateFactory(final Class classToInstantiate, - Class[] paramTypes, - Object[] args) { + final Class[] paramTypes, + final Object[] args) { if (classToInstantiate == null) { throw new IllegalArgumentException("Class to instantiate must not be null"); } diff --git a/src/main/java/org/apache/commons/collections/iterators/NodeListIterator.java b/src/main/java/org/apache/commons/collections/iterators/NodeListIterator.java index c75e05255..9667f9d38 100644 --- a/src/main/java/org/apache/commons/collections/iterators/NodeListIterator.java +++ b/src/main/java/org/apache/commons/collections/iterators/NodeListIterator.java @@ -44,7 +44,7 @@ public class NodeListIterator implements Iterator { * @param node Node, who's child nodes are wrapped by this class. Must not be null * @throws IllegalArgumentException if node is null */ - public NodeListIterator(Node node) { + public NodeListIterator(final Node node) { if (node == null) { throw new IllegalArgumentException("node must not be null!"); } @@ -58,7 +58,7 @@ public class NodeListIterator implements Iterator { * @param nodeList node list, which is wrapped by this class. Must not be null * @throws IllegalArgumentException if nodeList is null */ - public NodeListIterator(NodeList nodeList) { + public NodeListIterator(final NodeList nodeList) { if (nodeList == null) { throw new IllegalArgumentException("nodeList must not be null!"); } diff --git a/src/main/java/org/apache/commons/collections/queue/AbstractQueueDecorator.java b/src/main/java/org/apache/commons/collections/queue/AbstractQueueDecorator.java index 8eec72b4e..244406a46 100644 --- a/src/main/java/org/apache/commons/collections/queue/AbstractQueueDecorator.java +++ b/src/main/java/org/apache/commons/collections/queue/AbstractQueueDecorator.java @@ -64,7 +64,7 @@ public abstract class AbstractQueueDecorator extends AbstractCollectionDecora //----------------------------------------------------------------------- - public boolean offer(E obj) { + public boolean offer(final E obj) { return decorated().offer(obj); } diff --git a/src/main/java/org/apache/commons/collections/queue/PredicatedQueue.java b/src/main/java/org/apache/commons/collections/queue/PredicatedQueue.java index 360a6790d..df888af05 100644 --- a/src/main/java/org/apache/commons/collections/queue/PredicatedQueue.java +++ b/src/main/java/org/apache/commons/collections/queue/PredicatedQueue.java @@ -94,7 +94,7 @@ public class PredicatedQueue extends PredicatedCollection implements Queue * @return the result of adding to the underlying queue * @throws IllegalArgumentException if the add is invalid */ - public boolean offer(E object) { + public boolean offer(final E object) { validate(object); return decorated().offer(object); } diff --git a/src/main/java/org/apache/commons/collections/queue/TransformedQueue.java b/src/main/java/org/apache/commons/collections/queue/TransformedQueue.java index 33e652010..2aab02536 100644 --- a/src/main/java/org/apache/commons/collections/queue/TransformedQueue.java +++ b/src/main/java/org/apache/commons/collections/queue/TransformedQueue.java @@ -111,7 +111,7 @@ public class TransformedQueue extends TransformedCollection implements Que //----------------------------------------------------------------------- - public boolean offer(E obj) { + public boolean offer(final E obj) { return getQueue().offer(transform(obj)); } diff --git a/src/main/java/org/apache/commons/collections/queue/UnmodifiableQueue.java b/src/main/java/org/apache/commons/collections/queue/UnmodifiableQueue.java index bdc8a2fef..2f9471df6 100644 --- a/src/main/java/org/apache/commons/collections/queue/UnmodifiableQueue.java +++ b/src/main/java/org/apache/commons/collections/queue/UnmodifiableQueue.java @@ -134,7 +134,7 @@ public final class UnmodifiableQueue //----------------------------------------------------------------------- @Override - public boolean offer(E obj) { + public boolean offer(final E obj) { throw new UnsupportedOperationException(); } diff --git a/src/test/java/org/apache/commons/collections/CollectionUtilsTest.java b/src/test/java/org/apache/commons/collections/CollectionUtilsTest.java index 843aa718f..5f8bdfbb5 100644 --- a/src/test/java/org/apache/commons/collections/CollectionUtilsTest.java +++ b/src/test/java/org/apache/commons/collections/CollectionUtilsTest.java @@ -514,7 +514,7 @@ public class CollectionUtilsTest extends MockTestCase { // odd / even equator final Equator e = new Equator() { - public boolean equate(Integer o1, Integer o2) { + public boolean equate(final Integer o1, final Integer o2) { if (o1.intValue() % 2 == 0 ^ o2.intValue() % 2 == 0) { return false; } else { @@ -522,7 +522,7 @@ public class CollectionUtilsTest extends MockTestCase { } } - public int hash(Integer o) { + public int hash(final Integer o) { return o.intValue() % 2 == 0 ? Integer.valueOf(0).hashCode() : Integer.valueOf(1).hashCode(); } }; diff --git a/src/test/java/org/apache/commons/collections/IteratorUtilsTest.java b/src/test/java/org/apache/commons/collections/IteratorUtilsTest.java index 138f58096..1f7190678 100644 --- a/src/test/java/org/apache/commons/collections/IteratorUtilsTest.java +++ b/src/test/java/org/apache/commons/collections/IteratorUtilsTest.java @@ -861,7 +861,7 @@ public class IteratorUtilsTest extends BulkTest { */ private NodeList createNodeList(final Node[] nodes) { return new NodeList() { - public Node item(int index) { + public Node item(final int index) { return nodes[index]; } public int getLength() { diff --git a/src/test/java/org/apache/commons/collections/collection/CompositeCollectionTest.java b/src/test/java/org/apache/commons/collections/collection/CompositeCollectionTest.java index 2067fa253..4508b27cc 100644 --- a/src/test/java/org/apache/commons/collections/collection/CompositeCollectionTest.java +++ b/src/test/java/org/apache/commons/collections/collection/CompositeCollectionTest.java @@ -127,7 +127,7 @@ public class CompositeCollectionTest extends AbstractCollectionTest { setUpTest(); c.setMutator(new CompositeCollection.CollectionMutator() { - public boolean add(CompositeCollection composite, List> collections, E obj) { + public boolean add(final CompositeCollection composite, final List> collections, final E obj) { for (final Collection coll : collections) { coll.add(obj); } diff --git a/src/test/java/org/apache/commons/collections/iterators/LazyIteratorChainTest.java b/src/test/java/org/apache/commons/collections/iterators/LazyIteratorChainTest.java index 9d3fbfa10..b362955ed 100644 --- a/src/test/java/org/apache/commons/collections/iterators/LazyIteratorChainTest.java +++ b/src/test/java/org/apache/commons/collections/iterators/LazyIteratorChainTest.java @@ -60,7 +60,7 @@ public class LazyIteratorChainTest extends AbstractIteratorTest { public LazyIteratorChain makeEmptyIterator() { return new LazyIteratorChain() { @Override - protected Iterator nextIterator(int count) { + protected Iterator nextIterator(final int count) { return null; } }; @@ -70,7 +70,7 @@ public class LazyIteratorChainTest extends AbstractIteratorTest { public LazyIteratorChain makeObject() { final LazyIteratorChain chain = new LazyIteratorChain() { @Override - protected Iterator nextIterator(int count) { + protected Iterator nextIterator(final int count) { switch (count) { case 1: return list1.iterator(); @@ -166,7 +166,7 @@ public class LazyIteratorChainTest extends AbstractIteratorTest { notEmpty.add("C"); final LazyIteratorChain chain = new LazyIteratorChain() { @Override - protected Iterator nextIterator(int count) { + protected Iterator nextIterator(final int count) { switch (count) { case 1: return empty.iterator(); diff --git a/src/test/java/org/apache/commons/collections/iterators/NodeListIteratorTest.java b/src/test/java/org/apache/commons/collections/iterators/NodeListIteratorTest.java index ea2b09fec..13c32e116 100644 --- a/src/test/java/org/apache/commons/collections/iterators/NodeListIteratorTest.java +++ b/src/test/java/org/apache/commons/collections/iterators/NodeListIteratorTest.java @@ -69,7 +69,7 @@ public class NodeListIteratorTest extends AbstractIteratorTest { @Override public Iterator makeEmptyIterator() { NodeList emptyNodeList = new NodeList() { - public Node item(int index) { + public Node item(final int index) { throw new IndexOutOfBoundsException(); } public int getLength() { @@ -91,7 +91,7 @@ public class NodeListIteratorTest extends AbstractIteratorTest { @Override public Iterator makeObject() { NodeList nodeList = new NodeList() { - public Node item(int index) { + public Node item(final int index) { return nodes[index]; } public int getLength() {