Add final to some ivars.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1734634 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2016-03-11 21:15:35 +00:00
parent 5250fdfdf3
commit 42d42b2397
7 changed files with 9 additions and 9 deletions

View File

@ -580,7 +580,7 @@ public class ListUtils {
* A helper class used to construct the longest common subsequence.
*/
private static final class LcsVisitor<E> implements CommandVisitor<E> {
private ArrayList<E> sequence;
private final ArrayList<E> sequence;
public LcsVisitor() {
sequence = new ArrayList<E>();

View File

@ -46,12 +46,12 @@ public class PermutationIterator<E> implements Iterator<List<E>> {
/**
* Permutation is done on theses keys to handle equal objects.
*/
private int[] keys;
private final int[] keys;
/**
* Mapping between keys and objects.
*/
private Map<Integer, E> objectMap;
private final Map<Integer, E> objectMap;
/**
* Direction table used in the algorithm:
@ -60,7 +60,7 @@ public class PermutationIterator<E> implements Iterator<List<E>> {
* <li>true is right</li>
* </ul>
*/
private boolean[] direction;
private final boolean[] direction;
/**
* Next permutation to return. When a permutation is requested

View File

@ -39,7 +39,7 @@ public class PushbackIterator<E> implements Iterator<E> {
private final Iterator<? extends E> iterator;
/** The LIFO queue containing the pushed back items. */
private Deque<E> items = new ArrayDeque<E>();
private final Deque<E> items = new ArrayDeque<E>();
//-----------------------------------------------------------------------
/**

View File

@ -30,7 +30,7 @@ import org.junit.Test;
public class BoundedIteratorTest<E> extends AbstractIteratorTest<E> {
/** Test array of size 7 */
private String[] testArray = {
private final String[] testArray = {
"a", "b", "c", "d", "e", "f", "g"
};

View File

@ -34,7 +34,7 @@ import org.junit.Test;
*/
public class PeekingIteratorTest<E> extends AbstractIteratorTest<E> {
private String[] testArray = { "a", "b", "c" };
private final String[] testArray = { "a", "b", "c" };
private List<E> testList;

View File

@ -32,7 +32,7 @@ import org.junit.Test;
*/
public class PushbackIteratorTest<E> extends AbstractIteratorTest<E> {
private String[] testArray = { "a", "b", "c" };
private final String[] testArray = { "a", "b", "c" };
private List<E> testList;

View File

@ -30,7 +30,7 @@ import org.junit.Test;
public class SkippingIteratorTest<E> extends AbstractIteratorTest<E> {
/** Test array of size 7 */
private String[] testArray = {
private final String[] testArray = {
"a", "b", "c", "d", "e", "f", "g"
};