commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chtom...@apache.org
Subject [21/50] [abbrv] commons-collections git commit: Add final to some ivars.
Date Tue, 11 Jul 2017 17:22:11 GMT
Add final to some ivars.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1734634 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/commons-collections/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-collections/commit/42d42b23
Tree: http://git-wip-us.apache.org/repos/asf/commons-collections/tree/42d42b23
Diff: http://git-wip-us.apache.org/repos/asf/commons-collections/diff/42d42b23

Branch: refs/heads/master
Commit: 42d42b2397bd4cd96dcba38165f59973cd04cf69
Parents: 5250fdf
Author: Gary D. Gregory <ggregory@apache.org>
Authored: Fri Mar 11 21:15:35 2016 +0000
Committer: Gary D. Gregory <ggregory@apache.org>
Committed: Fri Mar 11 21:15:35 2016 +0000

----------------------------------------------------------------------
 src/main/java/org/apache/commons/collections4/ListUtils.java   | 2 +-
 .../commons/collections4/iterators/PermutationIterator.java    | 6 +++---
 .../commons/collections4/iterators/PushbackIterator.java       | 2 +-
 .../commons/collections4/iterators/BoundedIteratorTest.java    | 2 +-
 .../commons/collections4/iterators/PeekingIteratorTest.java    | 2 +-
 .../commons/collections4/iterators/PushbackIteratorTest.java   | 2 +-
 .../commons/collections4/iterators/SkippingIteratorTest.java   | 2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-collections/blob/42d42b23/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 e13d60b..3b0e7bc 100644
--- a/src/main/java/org/apache/commons/collections4/ListUtils.java
+++ b/src/main/java/org/apache/commons/collections4/ListUtils.java
@@ -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>();

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/42d42b23/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 5f60632..456a3fd 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java
@@ -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

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/42d42b23/src/main/java/org/apache/commons/collections4/iterators/PushbackIterator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/collections4/iterators/PushbackIterator.java
b/src/main/java/org/apache/commons/collections4/iterators/PushbackIterator.java
index bf4d49a..7d19627 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/PushbackIterator.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/PushbackIterator.java
@@ -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>();
 
     //-----------------------------------------------------------------------
     /**

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/42d42b23/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 ca016cb..201e905 100644
--- a/src/test/java/org/apache/commons/collections4/iterators/BoundedIteratorTest.java
+++ b/src/test/java/org/apache/commons/collections4/iterators/BoundedIteratorTest.java
@@ -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"
     };
 

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/42d42b23/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 ee12aac..c16c959 100644
--- a/src/test/java/org/apache/commons/collections4/iterators/PeekingIteratorTest.java
+++ b/src/test/java/org/apache/commons/collections4/iterators/PeekingIteratorTest.java
@@ -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;
     

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/42d42b23/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 5a677e5..5cf0501 100644
--- a/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java
+++ b/src/test/java/org/apache/commons/collections4/iterators/PushbackIteratorTest.java
@@ -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;
 

http://git-wip-us.apache.org/repos/asf/commons-collections/blob/42d42b23/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 2eaaba3..070e310 100644
--- a/src/test/java/org/apache/commons/collections4/iterators/SkippingIteratorTest.java
+++ b/src/test/java/org/apache/commons/collections4/iterators/SkippingIteratorTest.java
@@ -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"
     };
 


Mime
View raw message