commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject commons-rng git commit: Override "toString" to keep track of the underlying class.
Date Fri, 04 Nov 2016 20:57:24 GMT
Repository: commons-rng
Updated Branches:
  refs/heads/multimodule f280d0182 -> 7e12202ac


Override "toString" to keep track of the underlying class.


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

Branch: refs/heads/multimodule
Commit: 7e12202acd1de9cb8624df67dd44e286d86ca44f
Parents: f280d01
Author: Gilles <erans@apache.org>
Authored: Fri Nov 4 21:55:57 2016 +0100
Committer: Gilles <erans@apache.org>
Committed: Fri Nov 4 21:55:57 2016 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/commons/rng/simple/RandomSource.java  | 6 ++++++
 .../commons/rng/simple/ProvidersCommonParametricTest.java      | 6 ++++++
 2 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/7e12202a/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/RandomSource.java
----------------------------------------------------------------------
diff --git a/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/RandomSource.java
b/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/RandomSource.java
index 97ff18b..adc8f43 100644
--- a/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/RandomSource.java
+++ b/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/RandomSource.java
@@ -500,6 +500,12 @@ public enum RandomSource {
             public double nextDouble() {
                 return delegate.nextDouble();
             }
+
+            /** {@inheritDoc} */
+            @Override
+            public String toString() {
+                return delegate.toString();
+            }
         };
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-rng/blob/7e12202a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
----------------------------------------------------------------------
diff --git a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
index f7e85b8..c629b19 100644
--- a/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
+++ b/commons-rng-simple/src/test/java/org/apache/commons/rng/simple/ProvidersCommonParametricTest.java
@@ -210,6 +210,12 @@ public class ProvidersCommonParametricTest {
         Assert.assertTrue(listOrig.equals(listReplay));
     }
 
+    @Test
+    public void testUnrestorableToString() {
+        Assert.assertEquals(generator.toString(),
+                            RandomSource.unrestorable(generator).toString());
+    }
+
     ///// Support methods below.
 
 


Mime
View raw message