commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aherb...@apache.org
Subject [commons-rng] branch master updated: Use short array initialiser
Date Mon, 17 Feb 2020 23:30:38 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 97848da  Use short array initialiser
97848da is described below

commit 97848da0f3d939cae8a19e6ccfa9c099d9adea01
Author: Alex Herbert <aherbert@apache.org>
AuthorDate: Mon Feb 17 23:30:34 2020 +0000

    Use short array initialiser
---
 .../java/org/apache/commons/rng/core/source32/IntProvider.java    | 4 ++--
 .../java/org/apache/commons/rng/core/source64/LongProvider.java   | 8 ++++----
 .../apache/commons/rng/sampling/distribution/InternalUtils.java   | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source32/IntProvider.java
b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source32/IntProvider.java
index b358fbd..9a4ab7a 100644
--- a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source32/IntProvider.java
+++ b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source32/IntProvider.java
@@ -85,8 +85,8 @@ public abstract class IntProvider
     /** {@inheritDoc} */
     @Override
     protected byte[] getStateInternal() {
-        final int[] state = new int[] {booleanSource,
-                                       booleanBitMask};
+        final int[] state = {booleanSource,
+                             booleanBitMask};
         return composeStateInternal(NumberFactory.makeByteArray(state),
                                     super.getStateInternal());
     }
diff --git a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/LongProvider.java
b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/LongProvider.java
index d1c2941..278c5bb 100644
--- a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/LongProvider.java
+++ b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/LongProvider.java
@@ -101,10 +101,10 @@ public abstract class LongProvider
     @Override
     protected byte[] getStateInternal() {
         // Pack the boolean inefficiently as a long
-        final long[] state = new long[] {booleanSource,
-                                         booleanBitMask,
-                                         intSource,
-                                         cachedIntSource ? 1 : 0 };
+        final long[] state = {booleanSource,
+                              booleanBitMask,
+                              intSource,
+                              cachedIntSource ? 1 : 0 };
         return composeStateInternal(NumberFactory.makeByteArray(state),
                                     super.getStateInternal());
     }
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InternalUtils.java
b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InternalUtils.java
index 3807001..bd55384 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InternalUtils.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InternalUtils.java
@@ -27,7 +27,7 @@ import org.apache.commons.rng.sampling.SharedStateSampler;
  */
 final class InternalUtils { // Class is package-private on purpose; do not make it public.
     /** All long-representable factorials. */
-    private static final long[] FACTORIALS = new long[] {
+    private static final long[] FACTORIALS = {
         1L,                1L,                  2L,
         6L,                24L,                 120L,
         720L,              5040L,               40320L,


Mime
View raw message