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 2020/02/16 20:16:08 UTC

[commons-collections] 02/06: Use final.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git

commit f95c8526ade8061b0a86da802af9df221a0c4455
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Feb 16 15:08:34 2020 -0500

    Use final.
---
 .../collections4/bloomfilter/hasher/DynamicHasherTest.java        | 8 ++++----
 .../commons/collections4/bloomfilter/hasher/StaticHasherTest.java | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/DynamicHasherTest.java b/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/DynamicHasherTest.java
index 117dc05..64ed1f7 100644
--- a/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/DynamicHasherTest.java
+++ b/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/DynamicHasherTest.java
@@ -88,9 +88,9 @@ public class DynamicHasherTest {
 
         final OfInt iter = hasher.getBits(shape);
 
-        for (int i = 0; i < expected.length; i++) {
+        for (final int element : expected) {
             assertTrue(iter.hasNext());
-            assertEquals(expected[i], iter.nextInt());
+            assertEquals(element, iter.nextInt());
         }
         assertFalse(iter.hasNext());
 
@@ -108,9 +108,9 @@ public class DynamicHasherTest {
 
         final OfInt iter = hasher.getBits(shape);
 
-        for (int i = 0; i < expected.length; i++) {
+        for (final int element : expected) {
             assertTrue(iter.hasNext());
-            assertEquals(expected[i], iter.nextInt());
+            assertEquals(element, iter.nextInt());
         }
         assertFalse(iter.hasNext());
 
diff --git a/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/StaticHasherTest.java b/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/StaticHasherTest.java
index 937340b..2eb157c 100644
--- a/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/StaticHasherTest.java
+++ b/src/test/java/org/apache/commons/collections4/bloomfilter/hasher/StaticHasherTest.java
@@ -124,9 +124,9 @@ public class StaticHasherTest {
         final StaticHasher hasher = new StaticHasher(Arrays.stream(input).iterator(), shape);
 
         final OfInt iter = hasher.getBits(shape);
-        for (int i = 0; i < expected.length; i++) {
+        for (final int element : expected) {
             assertTrue(iter.hasNext());
-            assertEquals(expected[i], iter.nextInt());
+            assertEquals(element, iter.nextInt());
         }
         assertFalse(iter.hasNext());
     }
@@ -282,9 +282,9 @@ public class StaticHasherTest {
 
         final StaticHasher hasher = new StaticHasher(testHasher, shape);
         final OfInt iter = hasher.getBits(shape);
-        for (int i = 0; i < expected.length; i++) {
+        for (final int element : expected) {
             assertTrue(iter.hasNext());
-            assertEquals(expected[i], iter.nextInt());
+            assertEquals(element, iter.nextInt());
         }
         assertFalse(iter.hasNext());
     }