You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by eb...@apache.org on 2016/09/28 15:05:33 UTC

[2/3] commons-rng git commit: foreach loops

foreach loops


Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/9c32b245
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/9c32b245
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/9c32b245

Branch: refs/heads/master
Commit: 9c32b245e105a1f08520d06c598873b4d60f252e
Parents: 7cbf1e2
Author: Emmanuel Bourg <eb...@apache.org>
Authored: Wed Sep 28 16:30:38 2016 +0200
Committer: Emmanuel Bourg <eb...@apache.org>
Committed: Wed Sep 28 16:30:38 2016 +0200

----------------------------------------------------------------------
 .../commons/rng/internal/source32/MersenneTwisterTest.java      | 5 ++---
 .../org/apache/commons/rng/internal/source32/Well1024aTest.java | 4 ++--
 .../apache/commons/rng/internal/source32/Well19937aTest.java    | 4 ++--
 .../apache/commons/rng/internal/source32/Well19937cTest.java    | 4 ++--
 .../apache/commons/rng/internal/source32/Well44497aTest.java    | 4 ++--
 .../apache/commons/rng/internal/source32/Well44497bTest.java    | 4 ++--
 .../org/apache/commons/rng/internal/source32/Well512aTest.java  | 4 ++--
 .../commons/rng/internal/source64/MersenneTwister64Test.java    | 4 ++--
 .../apache/commons/rng/internal/source64/SplitMix64Test.java    | 4 ++--
 .../commons/rng/internal/source64/XorShift1024StarTest.java     | 4 ++--
 10 files changed, 20 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source32/MersenneTwisterTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/internal/source32/MersenneTwisterTest.java b/src/test/java/org/apache/commons/rng/internal/source32/MersenneTwisterTest.java
index ef36277..4ce7fc4 100644
--- a/src/test/java/org/apache/commons/rng/internal/source32/MersenneTwisterTest.java
+++ b/src/test/java/org/apache/commons/rng/internal/source32/MersenneTwisterTest.java
@@ -232,9 +232,8 @@ public class MersenneTwisterTest {
             0x9d8b4bf7, 0xe83b5b67, 0x90106e3d, 0x534fbf99, 0xce3bcd2e, 
         };
 
-        for (int i = 0; i < refInt.length; ++i) {
-            final int r = rng.nextInt();
-            Assert.assertEquals(refInt[i], r);
+        for (int i : refInt) {
+            Assert.assertEquals(i, rng.nextInt());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source32/Well1024aTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/internal/source32/Well1024aTest.java b/src/test/java/org/apache/commons/rng/internal/source32/Well1024aTest.java
index b4b8b4c..365f842 100644
--- a/src/test/java/org/apache/commons/rng/internal/source32/Well1024aTest.java
+++ b/src/test/java/org/apache/commons/rng/internal/source32/Well1024aTest.java
@@ -64,8 +64,8 @@ public class Well1024aTest {
             2117436668,    281073392,    741537353,   -483063506,   1850906286,   -244876135,   -270818140,   1817568823
         };
 
-        for (int i = 0; i < refInt.length; ++i) {
-            Assert.assertEquals(refInt[i], rng.nextInt());
+        for (int i : refInt) {
+            Assert.assertEquals(i, rng.nextInt());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source32/Well19937aTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/internal/source32/Well19937aTest.java b/src/test/java/org/apache/commons/rng/internal/source32/Well19937aTest.java
index f165f3a..975309e 100644
--- a/src/test/java/org/apache/commons/rng/internal/source32/Well19937aTest.java
+++ b/src/test/java/org/apache/commons/rng/internal/source32/Well19937aTest.java
@@ -102,8 +102,8 @@ public class Well19937aTest {
             -1397829266,  -1666371809,    858913807,   -610818620,   1554973298,    580023809,  -1662988256,   -408630026,   1316681876,    738204271,    942829881,   -758486983,    780345857,    667165037,  -2086803585,    789741324
         };
 
-        for (int i = 0; i < refInt.length; ++i) {
-            Assert.assertEquals(refInt[i], rng.nextInt());
+        for (int i : refInt) {
+            Assert.assertEquals(i, rng.nextInt());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source32/Well19937cTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/internal/source32/Well19937cTest.java b/src/test/java/org/apache/commons/rng/internal/source32/Well19937cTest.java
index c00461f..c7d9270 100644
--- a/src/test/java/org/apache/commons/rng/internal/source32/Well19937cTest.java
+++ b/src/test/java/org/apache/commons/rng/internal/source32/Well19937cTest.java
@@ -102,8 +102,8 @@ public class Well19937cTest {
             -339687826,   1219340319,    718895887,  -2007521340,  -1859185806,   2042164737,    -58146784,    742449142,   1930754708,    780832111,    715056441,  -1393886151,     -8150527,   -599607443,   -537300865,  -1212516084
         };
 
-        for (int i = 0; i < refInt.length; ++i) {
-            Assert.assertEquals(refInt[i], rng.nextInt());
+        for (int i : refInt) {
+            Assert.assertEquals(i, rng.nextInt());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source32/Well44497aTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/internal/source32/Well44497aTest.java b/src/test/java/org/apache/commons/rng/internal/source32/Well44497aTest.java
index 4f33195..76e7bb9 100644
--- a/src/test/java/org/apache/commons/rng/internal/source32/Well44497aTest.java
+++ b/src/test/java/org/apache/commons/rng/internal/source32/Well44497aTest.java
@@ -102,8 +102,8 @@ public class Well44497aTest {
             1257773681,  -1738604660,     77131430,  -1320261233,     -2342727,  -1817187590,  -1883997191,   1367221809,  -1863623746,  -1132606249,    149024763,  -1228275128,   -578030399,    356914163,   2109691820,   -880313621
         };
 
-        for (int i = 0; i < refInt.length; ++i) {
-            Assert.assertEquals(refInt[i], rng.nextInt());
+        for (int i : refInt) {
+            Assert.assertEquals(i, rng.nextInt());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source32/Well44497bTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/internal/source32/Well44497bTest.java b/src/test/java/org/apache/commons/rng/internal/source32/Well44497bTest.java
index 13ce9c2..0c2156f 100644
--- a/src/test/java/org/apache/commons/rng/internal/source32/Well44497bTest.java
+++ b/src/test/java/org/apache/commons/rng/internal/source32/Well44497bTest.java
@@ -102,8 +102,8 @@ public class Well44497bTest {
             -622491023,   1661205388,    -19071322,      6024591,   1473041593,   2053897978,  -1346768903,   1484764721,  -1552461890,   1287146711,   1613069307,    902497864,  -1504480063,    375292915,   -836353108,   2047602411
         };
 
-        for (int i = 0; i < refInt.length; ++i) {
-            Assert.assertEquals(refInt[i], rng.nextInt());
+        for (int i : refInt) {
+            Assert.assertEquals(i, rng.nextInt());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source32/Well512aTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/internal/source32/Well512aTest.java b/src/test/java/org/apache/commons/rng/internal/source32/Well512aTest.java
index 1c1e0e3..4890d41 100644
--- a/src/test/java/org/apache/commons/rng/internal/source32/Well512aTest.java
+++ b/src/test/java/org/apache/commons/rng/internal/source32/Well512aTest.java
@@ -62,8 +62,8 @@ public class Well512aTest {
             1812776767,    668822227,   -297283057,   2130183333,  -1169618692,    912860240,  -2028253096,   1244694278
         };
 
-        for (int i = 0; i < refInt.length; ++i) {
-            Assert.assertEquals(refInt[i], rng.nextInt());
+        for (int i : refInt) {
+            Assert.assertEquals(i, rng.nextInt());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source64/MersenneTwister64Test.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/internal/source64/MersenneTwister64Test.java b/src/test/java/org/apache/commons/rng/internal/source64/MersenneTwister64Test.java
index fe1cdad..c567436 100644
--- a/src/test/java/org/apache/commons/rng/internal/source64/MersenneTwister64Test.java
+++ b/src/test/java/org/apache/commons/rng/internal/source64/MersenneTwister64Test.java
@@ -232,8 +232,8 @@ public class MersenneTwister64Test {
             0x8d8325e82c4fdcdcL, 0xb47a658dad8e13a4L, 0x88710bf005fda027L, 0x69bd3edaf7111200L, 0xdccdd0c65c810ffL, 
         };
 
-        for (int i = 0; i < refLong.length; ++i) {
-            Assert.assertEquals(refLong[i], rng.nextLong());
+        for (long i : refLong) {
+            Assert.assertEquals(i, rng.nextLong());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source64/SplitMix64Test.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/internal/source64/SplitMix64Test.java b/src/test/java/org/apache/commons/rng/internal/source64/SplitMix64Test.java
index f67f303..b27ce88 100644
--- a/src/test/java/org/apache/commons/rng/internal/source64/SplitMix64Test.java
+++ b/src/test/java/org/apache/commons/rng/internal/source64/SplitMix64Test.java
@@ -38,8 +38,8 @@ public class SplitMix64Test {
             0x24b5d9d7a00a3140L, 0x79d983d781a34a3cL, 0x582e4a84d595f5ecL, 0x7316fe8b0f606d20L,
         };
 
-        for (int i = 0; i < refValues.length; ++i) {
-            Assert.assertEquals(refValues[i], rng.nextLong());
+        for (long i : refValues) {
+            Assert.assertEquals(i, rng.nextLong());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source64/XorShift1024StarTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/rng/internal/source64/XorShift1024StarTest.java b/src/test/java/org/apache/commons/rng/internal/source64/XorShift1024StarTest.java
index 2231bc9..79e1577 100644
--- a/src/test/java/org/apache/commons/rng/internal/source64/XorShift1024StarTest.java
+++ b/src/test/java/org/apache/commons/rng/internal/source64/XorShift1024StarTest.java
@@ -48,8 +48,8 @@ public class XorShift1024StarTest {
             0x769997671b2a0158L, 0xfa9cd84e0ffc174dL, 0x34df1cd959dca211L, 0xccea41a33ec1f763L,
         };
 
-        for (int i = 0; i < refValues.length; ++i) {
-            Assert.assertEquals(refValues[i], rng.nextLong());
+        for (long i : refValues) {
+            Assert.assertEquals(i, rng.nextLong());
         }
     }
 }


[RNG] Team work? (Was: ... commit: foreach loops)

Posted by Gilles <gi...@harfang.homelinux.org>.
On Thu, 29 Sep 2016 01:37:02 +0200, Emmanuel Bourg wrote:
> Le 28/09/2016 � 17:41, Gilles a �crit :
>
>> The array indexing was left on purpose (for debugging).
>> Please revert.
>
> Well, that wasn't really explicit, I'd suggest putting a comment the
> next time to materialize your intents.

Sorry but shouldn't it be the other way around, i.e. materialize
your intent to change something that looks odd to you?
Of course "foreach" is nicer; I had made that change, and reverted
it when I found myself counting the numbers on the screen...

> I made another modification to the tests and the index is now 
> reported
> when an assertion fails. Is this better?

Yes; that one is a really nice improvement in uniformity and
clarity. Thanks.

>> In general, could you please stop these unilateral changes?
>>
>> Some are going to turn out fine, some are not.
>>
>> Most are not trivial to figure out, even if they may look so
>> to you.
>
> Gilles, please relax and trust the other members here. It's great 
> that
> you review all commits but requiring your permission before 
> committing
> anything is excessive.

It's not about (my) permission; it's about caring for others'
work.
Allow them the possibility to avoid wasting time on reviewing
something that was agreed on.
It's just one post, or a JIRA report with a TODO list (as I
did in RNG-6) where one can have a quick view of what is coming,
and let it pass if obviously trivial, or ask for clarification
if not.

Overall, can you consider that my time is not worth less than
yours, and that it takes unnecessary effort to review unexpected
commits?

I'm curious of how people would have reacted if I had started
such a massive amount of cosmetic changes in other components.

I find it strange that you ask me to trust other developers
(which I do anyways, too much surely[1]) when they do not
return the favour.
I'll relax when I don't have to fight "rear guard" battles
such as about the scope of Commons RNG, or about the JDK's
"Random" being considered the eighth wonder of the world.

Will _you_ trust me on these, at least until you have more
arguments than I brought forward?

> Arguing all the day for minor changes is
> exhausting and counter-productive.

You can think that I'm stupid (for not having the same
definition of "trivial"), but do not assume that I take
pleasure in reviewing diffs (especially if they were
unannounced and uncalled for) and in writing posts,
begging for an explanation.

I proposed to delay the release because you wished to
include additional implementations.
I certainly did not expect that you'd take that opportunity
to start a beautifying crusade. [Rows of 4 numbers instead
of 5 ???]

>> Right now, I've been drowned by cosmetic changes that could hide
>> more substantial ones.
>
> Good news I think I'm done with the cosmetic changes. I'll start 
> working
> on the non trivial stuff now, on a feature branch of course.

Good news indeed.

I look forward to working as a team; please let me know
when we enter that stage. :-}


Gilles

[1] See where it got me to trust the former CM team!

>
> Emmanuel Bourg
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [2/3] commons-rng git commit: foreach loops

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 28/09/2016 � 17:41, Gilles a �crit :

> The array indexing was left on purpose (for debugging).
> Please revert.

Well, that wasn't really explicit, I'd suggest putting a comment the
next time to materialize your intents.

I made another modification to the tests and the index is now reported
when an assertion fails. Is this better?


> In general, could you please stop these unilateral changes?
> 
> Some are going to turn out fine, some are not.
> 
> Most are not trivial to figure out, even if they may look so
> to you.

Gilles, please relax and trust the other members here. It's great that
you review all commits but requiring your permission before committing
anything is excessive. Arguing all the day for minor changes is
exhausting and counter-productive.


> Right now, I've been drowned by cosmetic changes that could hide
> more substantial ones.

Good news I think I'm done with the cosmetic changes. I'll start working
on the non trivial stuff now, on a feature branch of course.

Emmanuel Bourg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [2/3] commons-rng git commit: foreach loops

Posted by Gilles <gi...@harfang.homelinux.org>.
Emmanuel,

On Wed, 28 Sep 2016 15:05:33 -0000, ebourg@apache.org wrote:
> foreach loops

The array indexing was left on purpose (for debugging).
Please revert.

In general, could you please stop these unilateral changes?

Some are going to turn out fine, some are not.

Most are not trivial to figure out, even if they may look so
to you.

By not asking first if someone objects, you made me loose a
_lot_ of time today, first wondering why this happened, and
then having to figure out on the spot (i.e. not at the best
time for me!) whether it is right or not.

Just asking and have the reviewer aware of the coming change
will make him more efficient at spotting problems on agreed
changes.

Right now, I've been drowned by cosmetic changes that could hide
more substantial ones (like the move of a whole class for an
unspecified reason).

Gilles

> Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
> Commit: 
> http://git-wip-us.apache.org/repos/asf/commons-rng/commit/9c32b245
> Tree: 
> http://git-wip-us.apache.org/repos/asf/commons-rng/tree/9c32b245
> Diff: 
> http://git-wip-us.apache.org/repos/asf/commons-rng/diff/9c32b245
>
> Branch: refs/heads/master
> Commit: 9c32b245e105a1f08520d06c598873b4d60f252e
> Parents: 7cbf1e2
> Author: Emmanuel Bourg <eb...@apache.org>
> Authored: Wed Sep 28 16:30:38 2016 +0200
> Committer: Emmanuel Bourg <eb...@apache.org>
> Committed: Wed Sep 28 16:30:38 2016 +0200
>
> 
> ----------------------------------------------------------------------
>  .../commons/rng/internal/source32/MersenneTwisterTest.java      | 5 
> ++---
>  .../org/apache/commons/rng/internal/source32/Well1024aTest.java | 4 
> ++--
>  .../apache/commons/rng/internal/source32/Well19937aTest.java    | 4 
> ++--
>  .../apache/commons/rng/internal/source32/Well19937cTest.java    | 4 
> ++--
>  .../apache/commons/rng/internal/source32/Well44497aTest.java    | 4 
> ++--
>  .../apache/commons/rng/internal/source32/Well44497bTest.java    | 4 
> ++--
>  .../org/apache/commons/rng/internal/source32/Well512aTest.java  | 4 
> ++--
>  .../commons/rng/internal/source64/MersenneTwister64Test.java    | 4 
> ++--
>  .../apache/commons/rng/internal/source64/SplitMix64Test.java    | 4 
> ++--
>  .../commons/rng/internal/source64/XorShift1024StarTest.java     | 4 
> ++--
>  10 files changed, 20 insertions(+), 21 deletions(-)
> 
> ----------------------------------------------------------------------
>
>
> 
> http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source32/MersenneTwisterTest.java
> 
> ----------------------------------------------------------------------
> diff --git
> 
> a/src/test/java/org/apache/commons/rng/internal/source32/MersenneTwisterTest.java
> 
> b/src/test/java/org/apache/commons/rng/internal/source32/MersenneTwisterTest.java
> index ef36277..4ce7fc4 100644
> ---
> 
> a/src/test/java/org/apache/commons/rng/internal/source32/MersenneTwisterTest.java
> +++
> 
> b/src/test/java/org/apache/commons/rng/internal/source32/MersenneTwisterTest.java
> @@ -232,9 +232,8 @@ public class MersenneTwisterTest {
>              0x9d8b4bf7, 0xe83b5b67, 0x90106e3d, 0x534fbf99, 
> 0xce3bcd2e,
>          };
>
> -        for (int i = 0; i < refInt.length; ++i) {
> -            final int r = rng.nextInt();
> -            Assert.assertEquals(refInt[i], r);
> +        for (int i : refInt) {
> +            Assert.assertEquals(i, rng.nextInt());
>          }
>      }
>  }
>
> 
> http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source32/Well1024aTest.java
> 
> ----------------------------------------------------------------------
> diff --git
> 
> a/src/test/java/org/apache/commons/rng/internal/source32/Well1024aTest.java
> 
> b/src/test/java/org/apache/commons/rng/internal/source32/Well1024aTest.java
> index b4b8b4c..365f842 100644
> ---
> 
> a/src/test/java/org/apache/commons/rng/internal/source32/Well1024aTest.java
> +++
> 
> b/src/test/java/org/apache/commons/rng/internal/source32/Well1024aTest.java
> @@ -64,8 +64,8 @@ public class Well1024aTest {
>              2117436668,    281073392,    741537353,   -483063506,
> 1850906286,   -244876135,   -270818140,   1817568823
>          };
>
> -        for (int i = 0; i < refInt.length; ++i) {
> -            Assert.assertEquals(refInt[i], rng.nextInt());
> +        for (int i : refInt) {
> +            Assert.assertEquals(i, rng.nextInt());
>          }
>      }
>  }
>
> 
> http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source32/Well19937aTest.java
> 
> ----------------------------------------------------------------------
> diff --git
> 
> a/src/test/java/org/apache/commons/rng/internal/source32/Well19937aTest.java
> 
> b/src/test/java/org/apache/commons/rng/internal/source32/Well19937aTest.java
> index f165f3a..975309e 100644
> ---
> 
> a/src/test/java/org/apache/commons/rng/internal/source32/Well19937aTest.java
> +++
> 
> b/src/test/java/org/apache/commons/rng/internal/source32/Well19937aTest.java
> @@ -102,8 +102,8 @@ public class Well19937aTest {
>              -1397829266,  -1666371809,    858913807,   -610818620,
> 1554973298,    580023809,  -1662988256,   -408630026,   1316681876,
> 738204271,    942829881,   -758486983,    780345857,    667165037,
> -2086803585,    789741324
>          };
>
> -        for (int i = 0; i < refInt.length; ++i) {
> -            Assert.assertEquals(refInt[i], rng.nextInt());
> +        for (int i : refInt) {
> +            Assert.assertEquals(i, rng.nextInt());
>          }
>      }
>  }
>
> 
> http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source32/Well19937cTest.java
> 
> ----------------------------------------------------------------------
> diff --git
> 
> a/src/test/java/org/apache/commons/rng/internal/source32/Well19937cTest.java
> 
> b/src/test/java/org/apache/commons/rng/internal/source32/Well19937cTest.java
> index c00461f..c7d9270 100644
> ---
> 
> a/src/test/java/org/apache/commons/rng/internal/source32/Well19937cTest.java
> +++
> 
> b/src/test/java/org/apache/commons/rng/internal/source32/Well19937cTest.java
> @@ -102,8 +102,8 @@ public class Well19937cTest {
>              -339687826,   1219340319,    718895887,  -2007521340,
> -1859185806,   2042164737,    -58146784,    742449142,   1930754708,
> 780832111,    715056441,  -1393886151,     -8150527,   -599607443,
> -537300865,  -1212516084
>          };
>
> -        for (int i = 0; i < refInt.length; ++i) {
> -            Assert.assertEquals(refInt[i], rng.nextInt());
> +        for (int i : refInt) {
> +            Assert.assertEquals(i, rng.nextInt());
>          }
>      }
>  }
>
> 
> http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source32/Well44497aTest.java
> 
> ----------------------------------------------------------------------
> diff --git
> 
> a/src/test/java/org/apache/commons/rng/internal/source32/Well44497aTest.java
> 
> b/src/test/java/org/apache/commons/rng/internal/source32/Well44497aTest.java
> index 4f33195..76e7bb9 100644
> ---
> 
> a/src/test/java/org/apache/commons/rng/internal/source32/Well44497aTest.java
> +++
> 
> b/src/test/java/org/apache/commons/rng/internal/source32/Well44497aTest.java
> @@ -102,8 +102,8 @@ public class Well44497aTest {
>              1257773681,  -1738604660,     77131430,  -1320261233,
> -2342727,  -1817187590,  -1883997191,   1367221809,  -1863623746,
> -1132606249,    149024763,  -1228275128,   -578030399,    356914163,
> 2109691820,   -880313621
>          };
>
> -        for (int i = 0; i < refInt.length; ++i) {
> -            Assert.assertEquals(refInt[i], rng.nextInt());
> +        for (int i : refInt) {
> +            Assert.assertEquals(i, rng.nextInt());
>          }
>      }
>  }
>
> 
> http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source32/Well44497bTest.java
> 
> ----------------------------------------------------------------------
> diff --git
> 
> a/src/test/java/org/apache/commons/rng/internal/source32/Well44497bTest.java
> 
> b/src/test/java/org/apache/commons/rng/internal/source32/Well44497bTest.java
> index 13ce9c2..0c2156f 100644
> ---
> 
> a/src/test/java/org/apache/commons/rng/internal/source32/Well44497bTest.java
> +++
> 
> b/src/test/java/org/apache/commons/rng/internal/source32/Well44497bTest.java
> @@ -102,8 +102,8 @@ public class Well44497bTest {
>              -622491023,   1661205388,    -19071322,      6024591,
> 1473041593,   2053897978,  -1346768903,   1484764721,  -1552461890,
> 1287146711,   1613069307,    902497864,  -1504480063,    375292915,
> -836353108,   2047602411
>          };
>
> -        for (int i = 0; i < refInt.length; ++i) {
> -            Assert.assertEquals(refInt[i], rng.nextInt());
> +        for (int i : refInt) {
> +            Assert.assertEquals(i, rng.nextInt());
>          }
>      }
>  }
>
> 
> http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source32/Well512aTest.java
> 
> ----------------------------------------------------------------------
> diff --git
> 
> a/src/test/java/org/apache/commons/rng/internal/source32/Well512aTest.java
> 
> b/src/test/java/org/apache/commons/rng/internal/source32/Well512aTest.java
> index 1c1e0e3..4890d41 100644
> ---
> 
> a/src/test/java/org/apache/commons/rng/internal/source32/Well512aTest.java
> +++
> 
> b/src/test/java/org/apache/commons/rng/internal/source32/Well512aTest.java
> @@ -62,8 +62,8 @@ public class Well512aTest {
>              1812776767,    668822227,   -297283057,   2130183333,
> -1169618692,    912860240,  -2028253096,   1244694278
>          };
>
> -        for (int i = 0; i < refInt.length; ++i) {
> -            Assert.assertEquals(refInt[i], rng.nextInt());
> +        for (int i : refInt) {
> +            Assert.assertEquals(i, rng.nextInt());
>          }
>      }
>  }
>
> 
> http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source64/MersenneTwister64Test.java
> 
> ----------------------------------------------------------------------
> diff --git
> 
> a/src/test/java/org/apache/commons/rng/internal/source64/MersenneTwister64Test.java
> 
> b/src/test/java/org/apache/commons/rng/internal/source64/MersenneTwister64Test.java
> index fe1cdad..c567436 100644
> ---
> 
> a/src/test/java/org/apache/commons/rng/internal/source64/MersenneTwister64Test.java
> +++
> 
> b/src/test/java/org/apache/commons/rng/internal/source64/MersenneTwister64Test.java
> @@ -232,8 +232,8 @@ public class MersenneTwister64Test {
>              0x8d8325e82c4fdcdcL, 0xb47a658dad8e13a4L,
> 0x88710bf005fda027L, 0x69bd3edaf7111200L, 0xdccdd0c65c810ffL,
>          };
>
> -        for (int i = 0; i < refLong.length; ++i) {
> -            Assert.assertEquals(refLong[i], rng.nextLong());
> +        for (long i : refLong) {
> +            Assert.assertEquals(i, rng.nextLong());
>          }
>      }
>  }
>
> 
> http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source64/SplitMix64Test.java
> 
> ----------------------------------------------------------------------
> diff --git
> 
> a/src/test/java/org/apache/commons/rng/internal/source64/SplitMix64Test.java
> 
> b/src/test/java/org/apache/commons/rng/internal/source64/SplitMix64Test.java
> index f67f303..b27ce88 100644
> ---
> 
> a/src/test/java/org/apache/commons/rng/internal/source64/SplitMix64Test.java
> +++
> 
> b/src/test/java/org/apache/commons/rng/internal/source64/SplitMix64Test.java
> @@ -38,8 +38,8 @@ public class SplitMix64Test {
>              0x24b5d9d7a00a3140L, 0x79d983d781a34a3cL,
> 0x582e4a84d595f5ecL, 0x7316fe8b0f606d20L,
>          };
>
> -        for (int i = 0; i < refValues.length; ++i) {
> -            Assert.assertEquals(refValues[i], rng.nextLong());
> +        for (long i : refValues) {
> +            Assert.assertEquals(i, rng.nextLong());
>          }
>      }
>  }
>
> 
> http://git-wip-us.apache.org/repos/asf/commons-rng/blob/9c32b245/src/test/java/org/apache/commons/rng/internal/source64/XorShift1024StarTest.java
> 
> ----------------------------------------------------------------------
> diff --git
> 
> a/src/test/java/org/apache/commons/rng/internal/source64/XorShift1024StarTest.java
> 
> b/src/test/java/org/apache/commons/rng/internal/source64/XorShift1024StarTest.java
> index 2231bc9..79e1577 100644
> ---
> 
> a/src/test/java/org/apache/commons/rng/internal/source64/XorShift1024StarTest.java
> +++
> 
> b/src/test/java/org/apache/commons/rng/internal/source64/XorShift1024StarTest.java
> @@ -48,8 +48,8 @@ public class XorShift1024StarTest {
>              0x769997671b2a0158L, 0xfa9cd84e0ffc174dL,
> 0x34df1cd959dca211L, 0xccea41a33ec1f763L,
>          };
>
> -        for (int i = 0; i < refValues.length; ++i) {
> -            Assert.assertEquals(refValues[i], rng.nextLong());
> +        for (long i : refValues) {
> +            Assert.assertEquals(i, rng.nextLong());
>          }
>      }
>  }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org