commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject [1/4] commons-rng git commit: Fail early.
Date Thu, 01 Sep 2016 23:12:33 GMT
Repository: commons-rng
Updated Branches:
  refs/heads/master d0989acd5 -> 3a703ee1a


Fail early.

Raise an exception (rather than return "null") if something wrong was detected.


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

Branch: refs/heads/master
Commit: c8cc2eed532c650fa9f5d53455c9488b8685d17d
Parents: d0989ac
Author: Gilles <erans@apache.org>
Authored: Fri Sep 2 01:18:36 2016 +0200
Committer: Gilles <erans@apache.org>
Committed: Fri Sep 2 01:18:36 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/commons/rng/internal/ProviderBuilder.java     | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-rng/blob/c8cc2eed/src/main/java/org/apache/commons/rng/internal/ProviderBuilder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/rng/internal/ProviderBuilder.java b/src/main/java/org/apache/commons/rng/internal/ProviderBuilder.java
index 3ede581..0e100fe 100644
--- a/src/main/java/org/apache/commons/rng/internal/ProviderBuilder.java
+++ b/src/main/java/org/apache/commons/rng/internal/ProviderBuilder.java
@@ -180,6 +180,9 @@ public class ProviderBuilder {
                 nativeSeed = SeedFactory.createIntArray(RANDOM_SEED_ARRAY_SIZE);
             } else if (source.getSeed().equals(long[].class)) {
                 nativeSeed = SeedFactory.createLongArray(RANDOM_SEED_ARRAY_SIZE);
+            } else {
+                // Source's native type is not handled.
+                throw new IllegalStateException(INTERNAL_ERROR_MSG);
             }
         } else {
             // Convert to native type.


Mime
View raw message