You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2021/08/04 05:51:45 UTC

[commons-rng] branch master updated (92251f0 -> 3751bad)

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

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


    from 92251f0  Formatting
     new 329f25f  Update JPMS modules to require Java 11.
     new 110c06d  Update commons-parent 51 to 52
     new 3c60bfa  Specify maven plugin versions
     new d30506b  Update plugin versions
     new a8d6ac7  Update PMD
     new 8ab1acd  Remove unnecessary parentheses
     new 0906b47  Indentation
     new f2093bf  Suppress warning
     new f3411a4  Checkstyle indentation
     new 8607d65  Update checkstyle
     new 31be3d2  Specify maven versions
     new 4b428bd  Remove explicit spotbugs version
     new ea8b01c  Exclude JMH generated files from checkstyle
     new 5c51680  RNG-158: Update minimum Java version from 1.6 to 1.7
     new c2d20e2  Update coveralls to the Java 7 version
     new 0ae8c47  Use multi-catch
     new e0b0947  Use diamond operator
     new 764b0fb  Exclude UseUnderscoresInNumericLiterals
     new 8f4b8be  Use try with resources
     new 282c461  Use diamond operator
     new 9770143  Use multi-catch
     new 04d54b0  Use diamond operator
     new 3751bad  Update pre-Java 8 profile to 1.7

The 23 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../commons/rng/core/source32/JDKRandom.java       | 15 ++----
 .../apache/commons/rng/core/source64/TwoCmres.java |  2 +-
 .../rng/core/ProvidersCommonParametricTest.java    |  2 +-
 .../commons/rng/core/util/NumberFactoryTest.java   |  4 +-
 commons-rng-examples/examples-jmh/pom.xml          | 22 ++-------
 .../rng/examples/jmh/RandomSourceValues.java       |  3 +-
 .../rng/examples/jmh/core/BaselineSources.java     |  3 +-
 .../distribution/DiscreteSamplersPerformance.java  |  3 +-
 ...iscreteUniformSamplerGenerationPerformance.java |  2 +-
 .../EnumeratedDistributionSamplersPerformance.java | 11 ++---
 .../distribution/PoissonSamplersPerformance.java   | 15 ++----
 .../distribution/ZigguratSamplerPerformance.java   |  2 +-
 .../jmh/simple/SeedArrayGenerationPerformance.java |  3 +-
 commons-rng-examples/examples-jpms/pom.xml         |  6 +--
 commons-rng-examples/examples-quadrature/pom.xml   |  3 --
 commons-rng-examples/examples-sampling/pom.xml     |  1 +
 .../ProbabilityDensityApproximationCommand.java    |  2 +-
 commons-rng-examples/examples-stress/pom.xml       |  4 +-
 commons-rng-examples/pom.xml                       | 10 ++--
 .../commons/rng/sampling/CollectionSampler.java    |  2 +-
 .../commons/rng/sampling/CompositeSamplers.java    |  6 +--
 .../DiscreteProbabilityCollectionSampler.java      |  4 +-
 .../apache/commons/rng/sampling/ListSampler.java   |  2 +-
 .../rng/simple/ThreadLocalRandomSource.java        |  3 +-
 .../rng/simple/internal/ProviderBuilder.java       |  6 +--
 pom.xml                                            | 56 +++++++++++++++-------
 src/changes/changes.xml                            | 21 +++++---
 .../checkstyle/checkstyle-suppressions.xml         |  1 +
 src/main/resources/pmd/pmd-ruleset.xml             | 16 ++++---
 29 files changed, 113 insertions(+), 117 deletions(-)

[commons-rng] 13/23: Exclude JMH generated files from checkstyle

Posted by ah...@apache.org.
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

commit ea8b01c5b6bddcb53a911d8e613f5df3638f207e
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Aug 2 15:01:44 2021 +0100

    Exclude JMH generated files from checkstyle
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 4d427b5..e8d2810 100644
--- a/pom.xml
+++ b/pom.xml
@@ -611,7 +611,7 @@ Running "svn up" will download *all* the files of the live web site at
               <logViolationsToConsole>false</logViolationsToConsole>
               <failOnViolation>true</failOnViolation>
               <resourceExcludes>NOTICE.txt,LICENSE.txt,**/pom.properties,**/resolver-status.properties,**/sha512.properties</resourceExcludes>
-              <excludes>**/generated/**.java</excludes>
+              <excludes>**/jmh_generated/**.java</excludes>
             </configuration>
             <executions>
               <execution>
@@ -647,7 +647,7 @@ Running "svn up" will download *all* the files of the live web site at
               <suppressionsLocation>${rng.parent.dir}/src/main/resources/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
               <enableRulesSummary>false</enableRulesSummary>
               <includeResources>false</includeResources>
-              <excludes>**/generated/**.java</excludes>
+              <excludes>**/jmh_generated/**.java</excludes>
             </configuration>
             <reportSets>
               <reportSet>

[commons-rng] 19/23: Use try with resources

Posted by ah...@apache.org.
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

commit 8f4b8be6304fcdffc14799e5eb44e1ad0dd5f8a1
Author: aherbert <ah...@apache.org>
AuthorDate: Tue Aug 3 10:14:16 2021 +0100

    Use try with resources
---
 .../java/org/apache/commons/rng/core/source32/JDKRandom.java   | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source32/JDKRandom.java b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source32/JDKRandom.java
index 9a2fd31..282e549 100644
--- a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source32/JDKRandom.java
+++ b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source32/JDKRandom.java
@@ -102,9 +102,8 @@ public class JDKRandom extends IntProvider {
     /** {@inheritDoc} */
     @Override
     protected byte[] getStateInternal() {
-        try {
-            final ByteArrayOutputStream bos = new ByteArrayOutputStream();
-            final ObjectOutputStream oos = new ObjectOutputStream(bos);
+        try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
+             ObjectOutputStream oos = new ObjectOutputStream(bos)) {
 
             // Serialize the "delegate".
             oos.writeObject(delegate);
@@ -133,9 +132,8 @@ public class JDKRandom extends IntProvider {
         final byte[][] c = splitStateInternal(s2[1], stateSize);
 
         // Use look-ahead deserialization to validate the state byte[] contains java.util.Random.
-        try {
-            final ByteArrayInputStream bis = new ByteArrayInputStream(c[0]);
-            final ObjectInputStream ois = new ValidatingObjectInputStream(bis);
+        try (ByteArrayInputStream bis = new ByteArrayInputStream(c[0]);
+             ObjectInputStream ois = new ValidatingObjectInputStream(bis)) {
 
             delegate = (Random) ois.readObject();
         } catch (ClassNotFoundException | IOException e) {

[commons-rng] 02/23: Update commons-parent 51 to 52

Posted by ah...@apache.org.
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

commit 110c06d22c411960178fdd8ae7a664b68d29ef7b
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Aug 2 12:43:52 2021 +0100

    Update commons-parent 51 to 52
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 4b3e417..c2e19a9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.commons</groupId>
     <artifactId>commons-parent</artifactId>
-    <version>51</version>
+    <version>52</version>
   </parent>
 
   <artifactId>commons-rng-parent</artifactId>

[commons-rng] 11/23: Specify maven versions

Posted by ah...@apache.org.
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

commit 31be3d2d8525f4ebaedd368529ff6b8271a339ac
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Aug 2 14:27:50 2021 +0100

    Specify maven versions
    
    maven-surefire-plugin 3.0.0-M5
    clirr-maven-plugin 2.8
---
 pom.xml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pom.xml b/pom.xml
index 366ebe0..6b82332 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,12 +53,14 @@
     <commons.encoding>UTF-8</commons.encoding>
     <maven.compiler.source>1.6</maven.compiler.source>
     <maven.compiler.target>1.6</maven.compiler.target>
+    <rng.clirr.version>2.8</rng.clirr.version>
     <rng.pmd.version>3.14.0</rng.pmd.version>
     <rng.pmd.dep.version>6.37.0</rng.pmd.dep.version>
     <rng.checkstyle.version>3.1.2</rng.checkstyle.version>
     <rng.checkstyle.dep.version>8.45</rng.checkstyle.dep.version>
     <rng.mathjax.url>https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js</rng.mathjax.url>
     <rng.antrun.version>1.8</rng.antrun.version>
+    <rng.surefire.version>3.0.0-M5</rng.surefire.version>
     <!-- Workaround to avoid duplicating config files. -->
     <rng.parent.dir>${basedir}</rng.parent.dir>
 
@@ -170,6 +172,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
+        <version>${rng.surefire.version}</version>
         <configuration>
           <!-- Fix for OpenJDK 8 now validating class-path attributes in Jar manifests. -->
           <!-- See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=912333#63 -->
@@ -671,6 +674,7 @@ Running "svn up" will download *all* the files of the live web site at
           <plugin>
             <groupId>org.codehaus.mojo</groupId>
             <artifactId>clirr-maven-plugin</artifactId>
+            <version>${rng.clirr.version}</version>
             <executions>
               <execution>
                 <phase>verify</phase>

[commons-rng] 18/23: Exclude UseUnderscoresInNumericLiterals

Posted by ah...@apache.org.
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

commit 764b0fbfa967643705d382140e12fb2c0d6832f3
Author: aherbert <ah...@apache.org>
AuthorDate: Tue Aug 3 10:12:40 2021 +0100

    Exclude UseUnderscoresInNumericLiterals
---
 src/main/resources/pmd/pmd-ruleset.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/main/resources/pmd/pmd-ruleset.xml b/src/main/resources/pmd/pmd-ruleset.xml
index bc8c631..ddce4af 100644
--- a/src/main/resources/pmd/pmd-ruleset.xml
+++ b/src/main/resources/pmd/pmd-ruleset.xml
@@ -40,6 +40,7 @@
     <exclude name="AtLeastOneConstructor" />
     <exclude name="GenericsNaming" />
     <exclude name="OnlyOneReturn" />
+    <exclude name="UseUnderscoresInNumericLiterals" />
   </rule>
   <rule ref="category/java/design.xml">
     <exclude name="TooManyMethods" />

[commons-rng] 20/23: Use diamond operator

Posted by ah...@apache.org.
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

commit 282c461b38c1b99b74e65de8becda16be105b39f
Author: aherbert <ah...@apache.org>
AuthorDate: Tue Aug 3 10:15:18 2021 +0100

    Use diamond operator
---
 .../java/org/apache/commons/rng/simple/ThreadLocalRandomSource.java    | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/ThreadLocalRandomSource.java b/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/ThreadLocalRandomSource.java
index 1e6e58c..8fbcc07 100644
--- a/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/ThreadLocalRandomSource.java
+++ b/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/ThreadLocalRandomSource.java
@@ -70,8 +70,7 @@ public final class ThreadLocalRandomSource {
      * <p>This should only be modified to create new instances in a synchronized block.
      */
     private static final EnumMap<RandomSource, ThreadLocal<UniformRandomProvider>> SOURCES =
-        new EnumMap<RandomSource,
-                    ThreadLocal<UniformRandomProvider>>(RandomSource.class);
+        new EnumMap<>(RandomSource.class);
 
     /** No public construction. */
     private ThreadLocalRandomSource() {}

[commons-rng] 01/23: Update JPMS modules to require Java 11.

Posted by ah...@apache.org.
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

commit 329f25f04da739d033aa7325a482d9cbf4f1616e
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Aug 2 12:42:27 2021 +0100

    Update JPMS modules to require Java 11.
    
    Previously the modules would not build on JDK 11 due to the strictness
    of the javadoc tool with packages in the unnamed module. The latest JDK
    11 version allows this (with warnings).
---
 commons-rng-examples/examples-jpms/pom.xml       |  6 +++---
 commons-rng-examples/examples-quadrature/pom.xml |  3 ---
 src/changes/changes.xml                          | 10 +++++++---
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/commons-rng-examples/examples-jpms/pom.xml b/commons-rng-examples/examples-jpms/pom.xml
index 286ab9a..2e43cef 100644
--- a/commons-rng-examples/examples-jpms/pom.xml
+++ b/commons-rng-examples/examples-jpms/pom.xml
@@ -36,10 +36,10 @@
     <rng.parent.dir>${basedir}/../..</rng.parent.dir>
 
     <!-- Java language level. -->
-    <maven.compiler.source>9</maven.compiler.source>
-    <maven.compiler.target>9</maven.compiler.target>
+    <maven.compiler.source>11</maven.compiler.source>
+    <maven.compiler.target>11</maven.compiler.target>
     <animal.sniffer.skip>true</animal.sniffer.skip>
-    <maven.compiler.release>9</maven.compiler.release>
+    <maven.compiler.release>11</maven.compiler.release>
   </properties>
 
   <build>
diff --git a/commons-rng-examples/examples-quadrature/pom.xml b/commons-rng-examples/examples-quadrature/pom.xml
index 56d1dfd..aea4ef8 100644
--- a/commons-rng-examples/examples-quadrature/pom.xml
+++ b/commons-rng-examples/examples-quadrature/pom.xml
@@ -32,9 +32,6 @@
   Code in this module is not part of the public API.</description>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
-
     <!-- OSGi -->
     <commons.osgi.symbolicName>org.apache.commons.rng.examples.quadrature</commons.osgi.symbolicName>
     <commons.osgi.export>org.apache.commons.rng.examples.quadrature</commons.osgi.export>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index c94a0a4..40abceb 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -63,10 +63,14 @@ Apache Commons RNG 1.4 contains the following library modules:
   commons-rng-sampling (requires Java 6)
 The code in module 'commons-rng-core' should not be accessed
 directly by applications as a future release might make use of
-the JPMS modularization feature available in Java 9+.
+the JPMS modularization feature available in Java 11+.
 
-Additional code is provided in the following module:
-  commons-rng-examples (requires Java 9)
+Additional code is provided in the following modules:
+  commons-rng-examples-quadrature (requires Java 7)
+  commons-rng-examples-jmh (requires Java 7)
+  commons-rng-examples-sampling (requires Java 8)
+  commons-rng-examples-stress (requires Java 8)
+  commons-rng-examples-jpms (requires Java 11)
 It is however not part of the official API and no compatibility
 should be expected in subsequent releases.
 

[commons-rng] 17/23: Use diamond operator

Posted by ah...@apache.org.
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

commit e0b0947ae8fd2e60a1c3ba2ef4c241eba1467c0e
Author: aherbert <ah...@apache.org>
AuthorDate: Tue Aug 3 10:12:27 2021 +0100

    Use diamond operator
---
 .../src/main/java/org/apache/commons/rng/core/source64/TwoCmres.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/TwoCmres.java b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/TwoCmres.java
index 9acdc5d..fb2d4cc 100644
--- a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/TwoCmres.java
+++ b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/TwoCmres.java
@@ -226,7 +226,7 @@ public class TwoCmres extends LongProvider {
         /** Factory. */
         static class Factory {
             /** List of good "Cmres" subcycle generators. */
-            private static final List<Cmres> TABLE = new ArrayList<Cmres>();
+            private static final List<Cmres> TABLE = new ArrayList<>();
 
             //
             // Populates the table.

[commons-rng] 14/23: RNG-158: Update minimum Java version from 1.6 to 1.7

Posted by ah...@apache.org.
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

commit 5c51680bdc98f9ce7139d41b33c51a3a721986e8
Author: aherbert <ah...@apache.org>
AuthorDate: Tue Aug 3 10:03:46 2021 +0100

    RNG-158: Update minimum Java version from 1.6 to 1.7
    
    Use the enforcer plugin to require Maven 3.3.9.
---
 commons-rng-examples/pom.xml |  3 ---
 pom.xml                      | 25 +++++++++++++++++++++++--
 src/changes/changes.xml      | 11 +++++++----
 3 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/commons-rng-examples/pom.xml b/commons-rng-examples/pom.xml
index f2d51f2..49fd72b 100644
--- a/commons-rng-examples/pom.xml
+++ b/commons-rng-examples/pom.xml
@@ -35,9 +35,6 @@
   and to help ensure correctness of the implementations.</description>
 
   <properties>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
-
     <!-- OSGi -->
     <commons.osgi.symbolicName>org.apache.commons.rng.examples</commons.osgi.symbolicName>
     <commons.osgi.export>org.apache.commons.rng.examples</commons.osgi.export>
diff --git a/pom.xml b/pom.xml
index e8d2810..1dba2bb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -51,8 +51,8 @@
     <commons.jira.id>RNG</commons.jira.id>
     <commons.jira.pid>12320623</commons.jira.pid>
     <commons.encoding>UTF-8</commons.encoding>
-    <maven.compiler.source>1.6</maven.compiler.source>
-    <maven.compiler.target>1.6</maven.compiler.target>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
     <rng.clirr.version>2.8</rng.clirr.version>
     <rng.pmd.version>3.14.0</rng.pmd.version>
     <rng.pmd.dep.version>6.37.0</rng.pmd.dep.version>
@@ -144,6 +144,27 @@
   <build>
     <defaultGoal>clean verify javadoc:javadoc</defaultGoal>
     <plugins>
+      <!-- Ensure maven is compatible with the plugins -->
+      <plugin>
+        <inherited>true</inherited>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <configuration>
+          <rules>
+            <requireMavenVersion>
+              <version>3.3.9</version>
+            </requireMavenVersion>
+          </rules>
+          <fail>true</fail>
+        </configuration>
+        <executions>
+          <execution>
+            <id>enforce-maven-3</id>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-jar-plugin</artifactId>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 40abceb..aafb456 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -57,10 +57,10 @@ If the output is not quite correct, check for invisible trailing spaces!
 This is a minor release of Apache Commons RNG, containing a
 few new features and performance improvements.
 Apache Commons RNG 1.4 contains the following library modules:
-  commons-rng-client-api (requires Java 6)
-  commons-rng-core (requires Java 6)
-  commons-rng-simple (requires Java 6)
-  commons-rng-sampling (requires Java 6)
+  commons-rng-client-api (requires Java 7)
+  commons-rng-core (requires Java 7)
+  commons-rng-simple (requires Java 7)
+  commons-rng-sampling (requires Java 7)
 The code in module 'commons-rng-core' should not be accessed
 directly by applications as a future release might make use of
 the JPMS modularization feature available in Java 11+.
@@ -81,6 +81,9 @@ re-run tests that fail, and pass the build if they succeed
 within the allotted number of reruns (the test will be marked
 as 'flaky' in the report).
 ">
+      <action dev="aherbert" type="update" issue="158">
+        Update the minimum Java version to 1.7.
+      </action>
       <action dev="aherbert" type="add" issue="156">
         New "DirichletSampler" class to sample from a Dirichlet distribution.
       </action>

[commons-rng] 09/23: Checkstyle indentation

Posted by ah...@apache.org.
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

commit f3411a4e6664057950fe2ea4dee5bc147e63b38f
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Aug 2 14:22:28 2021 +0100

    Checkstyle indentation
---
 .../commons/rng/examples/jmh/RandomSourceValues.java      |  3 +--
 .../commons/rng/examples/jmh/core/BaselineSources.java    |  3 +--
 .../distribution/DiscreteSamplersPerformance.java         |  3 +--
 .../DiscreteUniformSamplerGenerationPerformance.java      |  2 +-
 .../EnumeratedDistributionSamplersPerformance.java        | 11 ++++-------
 .../sampling/distribution/PoissonSamplersPerformance.java | 15 +++++----------
 .../sampling/distribution/ZigguratSamplerPerformance.java |  2 +-
 .../jmh/simple/SeedArrayGenerationPerformance.java        |  3 +--
 8 files changed, 15 insertions(+), 27 deletions(-)

diff --git a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/RandomSourceValues.java b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/RandomSourceValues.java
index bbcb1be..d1c7c13 100644
--- a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/RandomSourceValues.java
+++ b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/RandomSourceValues.java
@@ -84,8 +84,7 @@ public class RandomSourceValues {
             "XO_RO_SHI_RO_1024_SS",
             "PCG_XSH_RR_32_OS",
             "PCG_XSH_RS_32_OS",
-            "PCG_RXS_M_XS_64_OS",
-            })
+            "PCG_RXS_M_XS_64_OS"})
     private String randomSourceName;
 
     /** The RandomSource. */
diff --git a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/core/BaselineSources.java b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/core/BaselineSources.java
index 30710c5..a13ea84 100644
--- a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/core/BaselineSources.java
+++ b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/core/BaselineSources.java
@@ -106,8 +106,7 @@ public abstract class BaselineSources {
             "XO_RO_SHI_RO_1024_SS",
             "PCG_XSH_RR_32_OS",
             "PCG_XSH_RS_32_OS",
-            "PCG_RXS_M_XS_64_OS",
-            })
+            "PCG_RXS_M_XS_64_OS"})
     private String randomSourceName;
 
     /** RNG. */
diff --git a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/DiscreteSamplersPerformance.java b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/DiscreteSamplersPerformance.java
index 47afa4a..0de380f 100644
--- a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/DiscreteSamplersPerformance.java
+++ b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/DiscreteSamplersPerformance.java
@@ -96,8 +96,7 @@ public class DiscreteSamplersPerformance {
                 "MarsagliaTsangWangPoissonSampler",
                 "MarsagliaTsangWangBinomialSampler",
                 "GuideTableDiscreteSampler",
-                "AliasMethodDiscreteSampler",
-                })
+                "AliasMethodDiscreteSampler"})
         private String samplerType;
 
         /** The sampler. */
diff --git a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/DiscreteUniformSamplerGenerationPerformance.java b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/DiscreteUniformSamplerGenerationPerformance.java
index 62d0f17..f735b02 100644
--- a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/DiscreteUniformSamplerGenerationPerformance.java
+++ b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/DiscreteUniformSamplerGenerationPerformance.java
@@ -76,7 +76,7 @@ public class DiscreteUniformSamplerGenerationPerformance {
                 // Comment in for slower generators
                 //"MWC_256", "KISS", "WELL_1024_A",
                 //"WELL_44497_B"
-                })
+        })
         private String randomSourceName;
 
         /** RNG. */
diff --git a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/EnumeratedDistributionSamplersPerformance.java b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/EnumeratedDistributionSamplersPerformance.java
index 7978c04..3307048 100644
--- a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/EnumeratedDistributionSamplersPerformance.java
+++ b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/EnumeratedDistributionSamplersPerformance.java
@@ -78,8 +78,7 @@ public class EnumeratedDistributionSamplersPerformance {
          */
         @Param({"WELL_44497_B",
                 "ISAAC",
-                "XO_RO_SHI_RO_128_PLUS",
-                })
+                "XO_RO_SHI_RO_128_PLUS"})
         private String randomSourceName;
 
         /** RNG. */
@@ -125,7 +124,7 @@ public class EnumeratedDistributionSamplersPerformance {
                 // A fair comparison is to use 2^alpha for the equivalent guide table method.
                 //"GuideTableDiscreteSamplerAlpha2",
                 //"GuideTableDiscreteSamplerAlpha4",
-                })
+        })
         private String samplerType;
 
         /** The factory. */
@@ -288,8 +287,7 @@ public class EnumeratedDistributionSamplersPerformance {
                 "Geometric_P0.2",
                 "4SidedLoadedDie",
                 "Poisson_Mean3.22",
-                "Poisson_Mean10_Mean20",
-                })
+                "Poisson_Mean10_Mean20"})
         private String distribution;
 
         /** {@inheritDoc} */
@@ -388,8 +386,7 @@ public class EnumeratedDistributionSamplersPerformance {
                 //"192",
                 //"384",
                 // Above 2048 forces the Alias method to use more than 64-bits for sampling
-                "3072"
-                })
+                "3072"})
         private int randomNonUniformSize;
 
         /** {@inheritDoc} */
diff --git a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/PoissonSamplersPerformance.java b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/PoissonSamplersPerformance.java
index 089f960..f167a4d 100644
--- a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/PoissonSamplersPerformance.java
+++ b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/PoissonSamplersPerformance.java
@@ -71,8 +71,7 @@ public class PoissonSamplersPerformance {
                 "4",
                 "8",
                 "16",
-                "32",
-                })
+                "32"})
         private double mean;
 
         /**
@@ -100,11 +99,9 @@ public class PoissonSamplersPerformance {
          * @see <a href="https://commons.apache.org/proper/commons-rng/userguide/rng.html">
          *      Commons RNG user guide</a>
          */
-        @Param({
-                "WELL_44497_B",
+        @Param({"WELL_44497_B",
                 //"ISAAC",
-                "XO_RO_SHI_RO_128_PLUS",
-                })
+                "XO_RO_SHI_RO_128_PLUS"})
         private String randomSourceName;
 
         /**
@@ -117,8 +114,7 @@ public class PoissonSamplersPerformance {
                 "KempSmallMeanPoissonSamplerBinarySearch",
                 "KempSmallMeanPoissonSamplerGuideTable",
                 "LargeMeanPoissonSampler",
-                "TinyMeanPoissonSampler",
-                })
+                "TinyMeanPoissonSampler"})
         private String samplerType;
 
         /**
@@ -133,8 +129,7 @@ public class PoissonSamplersPerformance {
                 "8",
                 "16",
                 "32",
-                "64",
-                })
+                "64"})
         private double mean;
 
         /** RNG. */
diff --git a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/ZigguratSamplerPerformance.java b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/ZigguratSamplerPerformance.java
index d9e258e..1757f08 100644
--- a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/ZigguratSamplerPerformance.java
+++ b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/ZigguratSamplerPerformance.java
@@ -246,7 +246,7 @@ public class ZigguratSamplerPerformance {
         @Param({"XO_RO_SHI_RO_128_PP",
                 //"MWC_256",
                 //"JDK"
-                })
+        })
         private String randomSourceName;
 
         /** The sampler type. */
diff --git a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/simple/SeedArrayGenerationPerformance.java b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/simple/SeedArrayGenerationPerformance.java
index 4cc92b5..8a17f38 100644
--- a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/simple/SeedArrayGenerationPerformance.java
+++ b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/simple/SeedArrayGenerationPerformance.java
@@ -81,8 +81,7 @@ public class SeedArrayGenerationPerformance {
          * For seed generation only long period generators should be considered.
          */
         @Param({"WELL_44497_B",
-                "XOR_SHIFT_1024_S_PHI",
-                })
+                "XOR_SHIFT_1024_S_PHI"})
         private String randomSourceName;
 
         /** RNG. */

[commons-rng] 21/23: Use multi-catch

Posted by ah...@apache.org.
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

commit 97701436555c0f0d6fa0f0f4f0e22efa7e402cb1
Author: aherbert <ah...@apache.org>
AuthorDate: Tue Aug 3 10:15:57 2021 +0100

    Use multi-catch
---
 .../org/apache/commons/rng/simple/internal/ProviderBuilder.java     | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/internal/ProviderBuilder.java b/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/internal/ProviderBuilder.java
index 1e3fa9c..11399b9 100644
--- a/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/internal/ProviderBuilder.java
+++ b/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/internal/ProviderBuilder.java
@@ -646,11 +646,7 @@ public final class ProviderBuilder {
                                                               Object[] args) {
             try {
                 return (RestorableUniformRandomProvider) rng.newInstance(args);
-            } catch (InvocationTargetException e) {
-                throw new IllegalStateException(INTERNAL_ERROR_MSG, e);
-            } catch (InstantiationException e) {
-                throw new IllegalStateException(INTERNAL_ERROR_MSG, e);
-            } catch (IllegalAccessException e) {
+            } catch (InvocationTargetException | InstantiationException | IllegalAccessException e) {
                 throw new IllegalStateException(INTERNAL_ERROR_MSG, e);
             }
         }

[commons-rng] 10/23: Update checkstyle

Posted by ah...@apache.org.
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

commit 8607d65e32eaf529c1a9730514249c927ac6dc5c
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Aug 2 14:22:46 2021 +0100

    Update checkstyle
    
    checkstyle-plugin 3.1.0 -> 3.1.2
    checkstyle 8.29 -> 8.45
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 0be4644..366ebe0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,8 +55,8 @@
     <maven.compiler.target>1.6</maven.compiler.target>
     <rng.pmd.version>3.14.0</rng.pmd.version>
     <rng.pmd.dep.version>6.37.0</rng.pmd.dep.version>
-    <rng.checkstyle.version>3.1.0</rng.checkstyle.version>
-    <rng.checkstyle.dep.version>8.29</rng.checkstyle.dep.version>
+    <rng.checkstyle.version>3.1.2</rng.checkstyle.version>
+    <rng.checkstyle.dep.version>8.45</rng.checkstyle.dep.version>
     <rng.mathjax.url>https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js</rng.mathjax.url>
     <rng.antrun.version>1.8</rng.antrun.version>
     <!-- Workaround to avoid duplicating config files. -->

[commons-rng] 23/23: Update pre-Java 8 profile to 1.7

Posted by ah...@apache.org.
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

commit 3751badb29b901f886a442df385607832be9bc44
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Tue Aug 3 22:37:39 2021 +0100

    Update pre-Java 8 profile to 1.7
    
    Add notes about requiring --allow-script-in-comments flag.
    
    Note: Removal of the profile causes the build to fail on the Travis CI Java 7 job due to javadoc generation when using java version 7u151.
---
 pom.xml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 15cd4d9..32ed267 100644
--- a/pom.xml
+++ b/pom.xml
@@ -572,10 +572,12 @@ Running "svn up" will download *all* the files of the live web site at
     <profile>
       <id>pre-jdk8</id>
       <activation>
-        <jdk>[1.6,1.8)</jdk>
+        <jdk>[1.7,1.8)</jdk>
       </activation>
       <build>
-        <!-- Alter default goal as it uses checks from Java 8 plugins. -->
+        <!-- Alter default goal to avoid javadoc generation.
+          The inclusion of MathJax may require the 'allow-script-in-comments' flag
+          depending on the JDK 7 release version. -->
         <defaultGoal>clean verify</defaultGoal>
       </build>
     </profile>

[commons-rng] 15/23: Update coveralls to the Java 7 version

Posted by ah...@apache.org.
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

commit c2d20e24459b45eae573cdf006662171c16cb0ff
Author: aherbert <ah...@apache.org>
AuthorDate: Tue Aug 3 10:05:42 2021 +0100

    Update coveralls to the Java 7 version
    
    3.1.0 -> 4.3.0
---
 pom.xml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 1dba2bb..15cd4d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -560,8 +560,7 @@ Running "svn up" will download *all* the files of the live web site at
           <plugin>
             <groupId>org.eluder.coveralls</groupId>
             <artifactId>coveralls-maven-plugin</artifactId>
-            <!-- Version for JDK 6 target. -->
-            <version>3.1.0</version>
+            <version>4.3.0</version>
             <configuration>
               <timestampFormat>${commons.coveralls.timestampFormat}</timestampFormat>
             </configuration>

[commons-rng] 05/23: Update PMD

Posted by ah...@apache.org.
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

commit a8d6ac78ccd993e69848b6b7a207a253b9da16c1
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Aug 2 13:41:13 2021 +0100

    Update PMD
    
    pmd-core 6.21.0 -> 6.37.0
    pmd-plugin 3.13.0 -> 3.14.0
---
 pom.xml                                |  4 ++--
 src/main/resources/pmd/pmd-ruleset.xml | 15 ++++++++-------
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/pom.xml b/pom.xml
index 591ed01..0be4644 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,8 +53,8 @@
     <commons.encoding>UTF-8</commons.encoding>
     <maven.compiler.source>1.6</maven.compiler.source>
     <maven.compiler.target>1.6</maven.compiler.target>
-    <rng.pmd.version>3.13.0</rng.pmd.version>
-    <rng.pmd.dep.version>6.21.0</rng.pmd.dep.version>
+    <rng.pmd.version>3.14.0</rng.pmd.version>
+    <rng.pmd.dep.version>6.37.0</rng.pmd.dep.version>
     <rng.checkstyle.version>3.1.0</rng.checkstyle.version>
     <rng.checkstyle.dep.version>8.29</rng.checkstyle.dep.version>
     <rng.mathjax.url>https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js</rng.mathjax.url>
diff --git a/src/main/resources/pmd/pmd-ruleset.xml b/src/main/resources/pmd/pmd-ruleset.xml
index 9d95e9f..bc8c631 100644
--- a/src/main/resources/pmd/pmd-ruleset.xml
+++ b/src/main/resources/pmd/pmd-ruleset.xml
@@ -186,6 +186,14 @@
       <property name="violationSuppressXPath" value="//ClassOrInterfaceDeclaration[@SimpleName='CompositeSamplers']"/>
     </properties>
   </rule>
+  <rule ref="category/java/design.xml/CognitiveComplexity">
+    <properties>
+      <!-- Increase from default of 200 -->
+      <property name="violationSuppressXPath"
+        value="//ClassOrInterfaceDeclaration[@SimpleName='ChengBetaSampler' or @SimpleName='LargeMeanPoissonSampler'
+          or @SimpleName='ZigguratSampler']"/>
+    </properties>
+  </rule>
 
   <rule ref="category/java/errorprone.xml/AvoidLiteralsInIfCondition">
     <properties>
@@ -212,11 +220,4 @@
     </properties>
   </rule>
 
-  <rule ref="category/java/performance.xml/AvoidUsingShortType">
-    <properties>
-      <!-- Short datatype is used to optimise 16-bit storage. -->
-      <property name="violationSuppressXPath" value="//ClassOrInterfaceDeclaration[@SimpleName='MarsagliaTsangWangDiscreteSampler']"/>
-    </properties>
-  </rule>
-
 </ruleset>

[commons-rng] 04/23: Update plugin versions

Posted by ah...@apache.org.
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

commit d30506be9c8de3426f0705590fec75fa9306c2b3
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Aug 2 13:22:58 2021 +0100

    Update plugin versions
    
    picocli 3.9.5 -> 4.6.1
    jmh 1.22 -> 1.32
    junit 4.13.1 -> 4.13.2
---
 commons-rng-examples/examples-jmh/pom.xml | 2 +-
 commons-rng-examples/pom.xml              | 2 +-
 pom.xml                                   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/commons-rng-examples/examples-jmh/pom.xml b/commons-rng-examples/examples-jmh/pom.xml
index 5657678..73d8156 100644
--- a/commons-rng-examples/examples-jmh/pom.xml
+++ b/commons-rng-examples/examples-jmh/pom.xml
@@ -65,7 +65,7 @@
     <rng.parent.dir>${basedir}/../..</rng.parent.dir>
 
     <!-- JMH Benchmark related properties: version, name of the benchmarking uber jar. -->
-    <jmh.version>1.22</jmh.version>
+    <jmh.version>1.32</jmh.version>
     <uberjar.name>examples-jmh</uberjar.name>
     <project.mainClass>org.openjdk.jmh.Main</project.mainClass>
     <!-- Disable analysis for benchmarking code. -->
diff --git a/commons-rng-examples/pom.xml b/commons-rng-examples/pom.xml
index 262996e..f2d51f2 100644
--- a/commons-rng-examples/pom.xml
+++ b/commons-rng-examples/pom.xml
@@ -46,7 +46,7 @@
     <!-- Workaround to avoid duplicating config files. -->
     <rng.parent.dir>${basedir}/..</rng.parent.dir>
 
-    <rng.picocli.version>3.9.5</rng.picocli.version>
+    <rng.picocli.version>4.6.1</rng.picocli.version>
     <rng.exec.version>3.0.0</rng.exec.version>
     <rng.shade.version>3.2.4</rng.shade.version>
 
diff --git a/pom.xml b/pom.xml
index c2e19a9..591ed01 100644
--- a/pom.xml
+++ b/pom.xml
@@ -136,7 +136,7 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <version>4.13.1</version>
+      <version>4.13.2</version>
       <scope>test</scope>
     </dependency>
   </dependencies>

[commons-rng] 03/23: Specify maven plugin versions

Posted by ah...@apache.org.
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

commit 3c60bfa4d5767eccb49c49cca6cfa7675ccbed3f
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Aug 2 13:04:40 2021 +0100

    Specify maven plugin versions
---
 commons-rng-examples/examples-jmh/pom.xml      | 20 ++------------------
 commons-rng-examples/examples-sampling/pom.xml |  1 +
 commons-rng-examples/examples-stress/pom.xml   |  4 +++-
 commons-rng-examples/pom.xml                   |  5 ++++-
 4 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/commons-rng-examples/examples-jmh/pom.xml b/commons-rng-examples/examples-jmh/pom.xml
index b2e313d..5657678 100644
--- a/commons-rng-examples/examples-jmh/pom.xml
+++ b/commons-rng-examples/examples-jmh/pom.xml
@@ -88,17 +88,9 @@
       <build>
         <plugins>
           <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-compiler-plugin</artifactId>
-            <configuration>
-              <compilerVersion>${maven.compiler.target}</compilerVersion>
-              <source>${maven.compiler.target}</source>
-              <target>${maven.compiler.target}</target>
-            </configuration>
-          </plugin>
-          <plugin>
             <groupId>org.codehaus.mojo</groupId>
             <artifactId>exec-maven-plugin</artifactId>
+            <version>${rng.exec.version}</version>
             <executions>
               <execution>
                 <id>benchmark</id>
@@ -141,16 +133,8 @@
         <plugins>
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-compiler-plugin</artifactId>
-            <configuration>
-              <compilerVersion>${maven.compiler.target}</compilerVersion>
-              <source>${maven.compiler.target}</source>
-              <target>${maven.compiler.target}</target>
-            </configuration>
-          </plugin>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-shade-plugin</artifactId>
+            <version>${rng.shade.version}</version>
             <executions>
               <execution>
                 <phase>package</phase>
diff --git a/commons-rng-examples/examples-sampling/pom.xml b/commons-rng-examples/examples-sampling/pom.xml
index 235d28c..f15beb2 100644
--- a/commons-rng-examples/examples-sampling/pom.xml
+++ b/commons-rng-examples/examples-sampling/pom.xml
@@ -71,6 +71,7 @@
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-shade-plugin</artifactId>
+            <version>${rng.shade.version}</version>
             <executions>
               <execution>
                 <phase>package</phase>
diff --git a/commons-rng-examples/examples-stress/pom.xml b/commons-rng-examples/examples-stress/pom.xml
index 4407f64..db404aa 100644
--- a/commons-rng-examples/examples-stress/pom.xml
+++ b/commons-rng-examples/examples-stress/pom.xml
@@ -67,8 +67,9 @@
     <plugins>
       <plugin>
         <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>${rng.checkstyle.version}</version>
         <!-- The custom ApplicationException cannot be loaded by checkstyle unless the source is
-          compiled. Checkstyle runs in the validate phase  so here we switch to verify -->
+          compiled. Checkstyle runs in the validate phase so here we switch to verify -->
         <executions>
           <execution>
             <phase>verify</phase>
@@ -89,6 +90,7 @@
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-shade-plugin</artifactId>
+            <version>${rng.shade.version}</version>
             <executions>
               <execution>
                 <phase>package</phase>
diff --git a/commons-rng-examples/pom.xml b/commons-rng-examples/pom.xml
index ccfa97c..262996e 100644
--- a/commons-rng-examples/pom.xml
+++ b/commons-rng-examples/pom.xml
@@ -47,6 +47,8 @@
     <rng.parent.dir>${basedir}/..</rng.parent.dir>
 
     <rng.picocli.version>3.9.5</rng.picocli.version>
+    <rng.exec.version>3.0.0</rng.exec.version>
+    <rng.shade.version>3.2.4</rng.shade.version>
 
     <!-- Disable JApiCmp failures (but keep the report). The examples API is allowed to change. -->
     <commons.japicmp.breakBuildOnBinaryIncompatibleModifications>false</commons.japicmp.breakBuildOnBinaryIncompatibleModifications>
@@ -85,13 +87,14 @@
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>exec-maven-plugin</artifactId>
-          <version>1.6.0</version>
+          <version>${rng.exec.version}</version>
         </plugin>
       </plugins>
     </pluginManagement>
     <plugins>
       <plugin>
         <artifactId>maven-pmd-plugin</artifactId>
+        <version>${rng.pmd.version}</version>
         <configuration>
           <failOnViolation>false</failOnViolation>
         </configuration>

[commons-rng] 22/23: Use diamond operator

Posted by ah...@apache.org.
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

commit 04d54b05b1b1b3a7c6deef3128e5f6b4452610e7
Author: aherbert <ah...@apache.org>
AuthorDate: Tue Aug 3 10:17:27 2021 +0100

    Use diamond operator
---
 .../java/org/apache/commons/rng/sampling/CollectionSampler.java     | 2 +-
 .../java/org/apache/commons/rng/sampling/CompositeSamplers.java     | 6 +++---
 .../commons/rng/sampling/DiscreteProbabilityCollectionSampler.java  | 4 ++--
 .../src/main/java/org/apache/commons/rng/sampling/ListSampler.java  | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/CollectionSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/CollectionSampler.java
index 4504c26..b8ce38d 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/CollectionSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/CollectionSampler.java
@@ -53,7 +53,7 @@ public class CollectionSampler<T> implements SharedStateObjectSampler<T> {
         }
 
         this.rng = rng;
-        items = new ArrayList<T>(collection);
+        items = new ArrayList<>(collection);
     }
 
     /**
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/CompositeSamplers.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/CompositeSamplers.java
index 7679aba..9caed97 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/CompositeSamplers.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/CompositeSamplers.java
@@ -356,7 +356,7 @@ public final class CompositeSamplers {
                        SamplerFactory<S> compositeFactory) {
             this.specialisation = specialisation;
             this.compositeFactory = compositeFactory;
-            weightedSamplers = new ArrayList<WeightedSampler<S>>();
+            weightedSamplers = new ArrayList<>();
             factory = DiscreteProbabilitySampler.GUIDE_TABLE;
         }
 
@@ -410,7 +410,7 @@ public final class CompositeSamplers {
 
             // Extract the weights and samplers.
             final double[] weights = new double[n];
-            final ArrayList<S> samplers = new ArrayList<S>(n);
+            final ArrayList<S> samplers = new ArrayList<>(n);
             for (int i = 0; i < n; i++) {
                 final WeightedSampler<S> weightedItem = list.get(i);
                 weights[i] = weightedItem.getWeight();
@@ -1086,7 +1086,7 @@ public final class CompositeSamplers {
      */
     private static <T extends SharedStateSampler<T>> List<T> copy(List<T> samplers,
                                                                   UniformRandomProvider rng) {
-        final ArrayList<T> newSamplers = new ArrayList<T>(samplers.size());
+        final ArrayList<T> newSamplers = new ArrayList<>(samplers.size());
         for (final T s : samplers) {
             newSamplers.add(s.withUniformRandomProvider(rng));
         }
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSampler.java
index fef393f..43abcb3 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/DiscreteProbabilityCollectionSampler.java
@@ -68,7 +68,7 @@ public class DiscreteProbabilityCollectionSampler<T> implements SharedStateObjec
 
         // Extract the items and probabilities
         final int size = collection.size();
-        items = new ArrayList<T>(size);
+        items = new ArrayList<>(size);
         final double[] probabilities = new double[size];
 
         int count = 0;
@@ -110,7 +110,7 @@ public class DiscreteProbabilityCollectionSampler<T> implements SharedStateObjec
                                                collection.size());
         }
         // Shallow copy the list
-        items = new ArrayList<T>(collection);
+        items = new ArrayList<>(collection);
         // Delegate sampling
         sampler = createSampler(rng, probabilities);
     }
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/ListSampler.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/ListSampler.java
index b837615..638b66d 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/ListSampler.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/ListSampler.java
@@ -70,7 +70,7 @@ public final class ListSampler {
                                      int k) {
         final int n = collection.size();
         final PermutationSampler p = new PermutationSampler(rng, n, k);
-        final List<T> result = new ArrayList<T>(k);
+        final List<T> result = new ArrayList<>(k);
         final int[] index = p.sample();
 
         for (int i = 0; i < k; i++) {

[commons-rng] 12/23: Remove explicit spotbugs version

Posted by ah...@apache.org.
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

commit 4b428bde27e638a5ab135803cfbd588b72912f8b
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Aug 2 14:31:27 2021 +0100

    Remove explicit spotbugs version
    
    The version from commons parent 52 is suitable for site generation.
---
 pom.xml | 2 --
 1 file changed, 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 6b82332..4d427b5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -64,8 +64,6 @@
     <!-- Workaround to avoid duplicating config files. -->
     <rng.parent.dir>${basedir}</rng.parent.dir>
 
-    <!-- Version fix to support Java 11 site generation using parent-48 -->
-    <commons.spotbugs.version>3.1.11</commons.spotbugs.version>
     <!-- Fix to avoid JXR 3.0.0 forking the lifecycle phase 'compile' during site report
        jxr:aggregate. If compile is forked it fails when building the Java 9 modules that
        depend on other packages. -->

[commons-rng] 06/23: Remove unnecessary parentheses

Posted by ah...@apache.org.
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

commit 8ab1acdddb73e7d8677e8f3ba02609c563ef80fe
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Aug 2 13:45:00 2021 +0100

    Remove unnecessary parentheses
---
 .../org/apache/commons/rng/core/ProvidersCommonParametricTest.java    | 2 +-
 .../test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
index 071e6b6..7119282 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/ProvidersCommonParametricTest.java
@@ -516,7 +516,7 @@ public class ProvidersCommonParametricTest {
                 Arrays.fill(observed, 0);
                 for (int j = 0; j < sampleSize; j++) {
                     final long value = nextMethod.call().longValue();
-                    Assert.assertTrue("Range", (value >= 0) && (value < n));
+                    Assert.assertTrue("Range", value >= 0 && value < n);
 
                     for (int k = 0; k < numBins; k++) {
                         if (value < binUpperBounds[k]) {
diff --git a/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java b/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java
index 9236f4d..8d959eb 100644
--- a/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java
+++ b/commons-rng-core/src/test/java/org/apache/commons/rng/core/util/NumberFactoryTest.java
@@ -184,7 +184,7 @@ public class NumberFactoryTest {
         for (int i = 0; i <= 20; i++) {
             try {
                 NumberFactory.makeIntArray(new byte[i]);
-                if (i != 0 && (i % INT_SIZE != 0)) {
+                if (i != 0 && i % INT_SIZE != 0) {
                     Assert.fail("Exception expected");
                 }
             } catch (IllegalArgumentException e) {
@@ -212,7 +212,7 @@ public class NumberFactoryTest {
         for (int i = 0; i <= 20; i++) {
             try {
                 NumberFactory.makeLongArray(new byte[i]);
-                if (i != 0 && (i % LONG_SIZE != 0)) {
+                if (i != 0 && i % LONG_SIZE != 0) {
                     Assert.fail("Exception expected");
                 }
             } catch (IllegalArgumentException e) {

[commons-rng] 07/23: Indentation

Posted by ah...@apache.org.
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

commit 0906b47d1548d19f1532605a1599a5b2ce4ef223
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Aug 2 13:48:37 2021 +0100

    Indentation
---
 .../rng/examples/sampling/ProbabilityDensityApproximationCommand.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ProbabilityDensityApproximationCommand.java b/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ProbabilityDensityApproximationCommand.java
index 1407b5b..d66b1f0 100644
--- a/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ProbabilityDensityApproximationCommand.java
+++ b/commons-rng-examples/examples-sampling/src/main/java/org/apache/commons/rng/examples/sampling/ProbabilityDensityApproximationCommand.java
@@ -64,7 +64,7 @@ class ProbabilityDensityApproximationCommand  implements Callable<Void> {
     @Option(names = {"-s", "--samplers"},
             split = ",",
             description = {"The samplers (comma-delimited for multiple options).",
-                          "Valid values: ${COMPLETION-CANDIDATES}."})
+                           "Valid values: ${COMPLETION-CANDIDATES}."})
     private EnumSet<Sampler> samplers = EnumSet.noneOf(Sampler.class);
 
     /** Flag to output all samplers. */

[commons-rng] 16/23: Use multi-catch

Posted by ah...@apache.org.
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

commit 0ae8c47c2d77893db0b517928a4ee06e27e8ccb6
Author: aherbert <ah...@apache.org>
AuthorDate: Tue Aug 3 10:11:47 2021 +0100

    Use multi-catch
---
 .../main/java/org/apache/commons/rng/core/source32/JDKRandom.java    | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source32/JDKRandom.java b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source32/JDKRandom.java
index c152c0a..9a2fd31 100644
--- a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source32/JDKRandom.java
+++ b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source32/JDKRandom.java
@@ -138,10 +138,7 @@ public class JDKRandom extends IntProvider {
             final ObjectInputStream ois = new ValidatingObjectInputStream(bis);
 
             delegate = (Random) ois.readObject();
-        } catch (ClassNotFoundException e) {
-            // Workaround checked exception.
-            throw new IllegalStateException(e);
-        } catch (IOException e) {
+        } catch (ClassNotFoundException | IOException e) {
             // Workaround checked exception.
             throw new IllegalStateException(e);
         }

[commons-rng] 08/23: Suppress warning

Posted by ah...@apache.org.
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

commit f2093bf821fb7adf0dcea80a2d14592d4edcf00a
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Aug 2 13:50:51 2021 +0100

    Suppress warning
---
 src/main/resources/checkstyle/checkstyle-suppressions.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/main/resources/checkstyle/checkstyle-suppressions.xml b/src/main/resources/checkstyle/checkstyle-suppressions.xml
index a4060ba..0ac768f 100644
--- a/src/main/resources/checkstyle/checkstyle-suppressions.xml
+++ b/src/main/resources/checkstyle/checkstyle-suppressions.xml
@@ -22,6 +22,7 @@
   <!-- Special cases with many parameters for the constructor. -->
   <suppress checks="ParameterNumber" files="[\\/]LargeMeanPoissonSampler\.java$" />
   <suppress checks="ParameterNumber" files="source64[\\/].*XoShiRo512.*\.java$" />
+  <suppress checks="UnnecessaryParentheses" files=".*stress[/\\]StressTestCommand\.java$" lines="672" />
   <!-- Special to allow withUniformRandomProvider to act as a constructor. -->
   <suppress checks="HiddenField" files=".*Sampler\.java$" message="'rng' hides a field." />
   <!-- Be more lenient on tests. -->