Add missing 'final' for parameters.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1457875 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
24e0cf268b
commit
5dd750e745
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public class DualLinkedHashBidiMap<K, V> extends AbstractDualBidiMap<K, V> imple
|
|||
*
|
||||
* @param map the map whose mappings are to be placed in this map
|
||||
*/
|
||||
public DualLinkedHashBidiMap(Map<K, V> map) {
|
||||
public DualLinkedHashBidiMap(final Map<K, V> map) {
|
||||
super(new LinkedHashMap<K, V>(), new LinkedHashMap<V, K>());
|
||||
putAll(map);
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class DualLinkedHashBidiMap<K, V> extends AbstractDualBidiMap<K, V> imple
|
|||
* @param reverseMap the reverse direction map
|
||||
* @param inverseBidiMap the inverse BidiMap
|
||||
*/
|
||||
protected DualLinkedHashBidiMap(Map<K, V> normalMap, Map<V, K> reverseMap, BidiMap<V, K> inverseBidiMap) {
|
||||
protected DualLinkedHashBidiMap(final Map<K, V> normalMap, final Map<V, K> reverseMap, final BidiMap<V, K> inverseBidiMap) {
|
||||
super(normalMap, reverseMap, inverseBidiMap);
|
||||
}
|
||||
|
||||
|
@ -84,12 +84,12 @@ public class DualLinkedHashBidiMap<K, V> extends AbstractDualBidiMap<K, V> 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<K, V>();
|
||||
reverseMap = new LinkedHashMap<V, K>();
|
||||
|
|
|
@ -53,8 +53,8 @@ public class InstantiateFactory<T> implements Factory<T>, Serializable {
|
|||
* @return a new instantiate factory
|
||||
*/
|
||||
public static <T> Factory<T> instantiateFactory(final Class<T> classToInstantiate,
|
||||
Class<?>[] paramTypes,
|
||||
Object[] args) {
|
||||
final Class<?>[] paramTypes,
|
||||
final Object[] args) {
|
||||
if (classToInstantiate == null) {
|
||||
throw new IllegalArgumentException("Class to instantiate must not be null");
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ public class NodeListIterator implements Iterator<Node> {
|
|||
* @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<Node> {
|
|||
* @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!");
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ public abstract class AbstractQueueDecorator<E> extends AbstractCollectionDecora
|
|||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
public boolean offer(E obj) {
|
||||
public boolean offer(final E obj) {
|
||||
return decorated().offer(obj);
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ public class PredicatedQueue<E> extends PredicatedCollection<E> 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);
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ public class TransformedQueue<E> extends TransformedCollection<E> implements Que
|
|||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
public boolean offer(E obj) {
|
||||
public boolean offer(final E obj) {
|
||||
return getQueue().offer(transform(obj));
|
||||
}
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ public final class UnmodifiableQueue<E>
|
|||
//-----------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public boolean offer(E obj) {
|
||||
public boolean offer(final E obj) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
|
|
@ -514,7 +514,7 @@ public class CollectionUtilsTest extends MockTestCase {
|
|||
|
||||
// odd / even equator
|
||||
final Equator<Integer> e = new Equator<Integer>() {
|
||||
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();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -127,7 +127,7 @@ public class CompositeCollectionTest<E> extends AbstractCollectionTest<E> {
|
|||
setUpTest();
|
||||
c.setMutator(new CompositeCollection.CollectionMutator<E>() {
|
||||
|
||||
public boolean add(CompositeCollection<E> composite, List<Collection<E>> collections, E obj) {
|
||||
public boolean add(final CompositeCollection<E> composite, final List<Collection<E>> collections, final E obj) {
|
||||
for (final Collection<E> coll : collections) {
|
||||
coll.add(obj);
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ public class LazyIteratorChainTest extends AbstractIteratorTest<String> {
|
|||
public LazyIteratorChain<String> makeEmptyIterator() {
|
||||
return new LazyIteratorChain<String>() {
|
||||
@Override
|
||||
protected Iterator<String> nextIterator(int count) {
|
||||
protected Iterator<String> nextIterator(final int count) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
@ -70,7 +70,7 @@ public class LazyIteratorChainTest extends AbstractIteratorTest<String> {
|
|||
public LazyIteratorChain<String> makeObject() {
|
||||
final LazyIteratorChain<String> chain = new LazyIteratorChain<String>() {
|
||||
@Override
|
||||
protected Iterator<String> nextIterator(int count) {
|
||||
protected Iterator<String> nextIterator(final int count) {
|
||||
switch (count) {
|
||||
case 1:
|
||||
return list1.iterator();
|
||||
|
@ -166,7 +166,7 @@ public class LazyIteratorChainTest extends AbstractIteratorTest<String> {
|
|||
notEmpty.add("C");
|
||||
final LazyIteratorChain<String> chain = new LazyIteratorChain<String>() {
|
||||
@Override
|
||||
protected Iterator<String> nextIterator(int count) {
|
||||
protected Iterator<String> nextIterator(final int count) {
|
||||
switch (count) {
|
||||
case 1:
|
||||
return empty.iterator();
|
||||
|
|
|
@ -69,7 +69,7 @@ public class NodeListIteratorTest extends AbstractIteratorTest<Node> {
|
|||
@Override
|
||||
public Iterator<Node> 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<Node> {
|
|||
@Override
|
||||
public Iterator<Node> makeObject() {
|
||||
NodeList nodeList = new NodeList() {
|
||||
public Node item(int index) {
|
||||
public Node item(final int index) {
|
||||
return nodes[index];
|
||||
}
|
||||
public int getLength() {
|
||||
|
|
Loading…
Reference in New Issue