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 2019/05/23 15:37:48 UTC

[commons-rng] branch master updated (f1a0089 -> 24a80c3)

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 f1a0089  Merge pull request #45 from aherbert/fix-pmd
     new 312d915  Add defaultGoal to pom to match Travis checks.
     new 24a80c3  Make utility classes final.

The 2 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:
 .../src/main/java/org/apache/commons/rng/sampling/ListSampler.java | 2 +-
 .../apache/commons/rng/sampling/distribution/InternalGamma.java    | 2 +-
 .../apache/commons/rng/sampling/distribution/InternalUtils.java    | 2 +-
 pom.xml                                                            | 1 +
 src/main/resources/checkstyle/checkstyle-suppressions.xml          | 2 --
 src/main/resources/pmd/pmd-ruleset.xml                             | 7 -------
 6 files changed, 4 insertions(+), 12 deletions(-)


[commons-rng] 01/02: Add defaultGoal to pom to match Travis checks.

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 312d9152821c9d5aeb604dbd2ef1f37247a338b6
Author: aherbert <ah...@apache.org>
AuthorDate: Thu May 23 13:21:11 2019 +0100

    Add defaultGoal to pom to match Travis checks.
---
 pom.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pom.xml b/pom.xml
index f8b3d33..bd4d214 100644
--- a/pom.xml
+++ b/pom.xml
@@ -155,6 +155,7 @@
   </properties>
 
   <build>
+    <defaultGoal>clean verify apache-rat:check clirr:check checkstyle:check pmd:check spotbugs:check javadoc:javadoc</defaultGoal>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>


[commons-rng] 02/02: Make utility classes final.

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 24a80c3ffa3bf7952ce60df1c31542496f89aba6
Author: aherbert <ah...@apache.org>
AuthorDate: Thu May 23 13:20:37 2019 +0100

    Make utility classes final.
---
 .../src/main/java/org/apache/commons/rng/sampling/ListSampler.java | 2 +-
 .../apache/commons/rng/sampling/distribution/InternalGamma.java    | 2 +-
 .../apache/commons/rng/sampling/distribution/InternalUtils.java    | 2 +-
 src/main/resources/checkstyle/checkstyle-suppressions.xml          | 2 --
 src/main/resources/pmd/pmd-ruleset.xml                             | 7 -------
 5 files changed, 3 insertions(+), 12 deletions(-)

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 db31105..88e9477 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
@@ -29,7 +29,7 @@ import org.apache.commons.rng.UniformRandomProvider;
  *
  * @since 1.0
  */
-public class ListSampler {
+public final class ListSampler {
     /**
      * Class contains only static methods.
      */
diff --git a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InternalGamma.java b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InternalGamma.java
index 6c87d69..0e27be5 100644
--- a/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InternalGamma.java
+++ b/commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InternalGamma.java
@@ -29,7 +29,7 @@ package org.apache.commons.rng.sampling.distribution;
  * &Gamma; (Gamma) family of functions.
  * </p>
  */
-class InternalGamma { // Class is package-private on purpose; do not make it public.
+final class InternalGamma { // Class is package-private on purpose; do not make it public.
     /**
      * Constant \( g = \frac{607}{128} \) in the Lanczos approximation.
      */
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 fe9e91b..8d8e010 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
@@ -22,7 +22,7 @@ package org.apache.commons.rng.sampling.distribution;
  * This class is not part of the public API, as it would be
  * better to group these utilities in a dedicated components.
  */
-class InternalUtils { // Class is package-private on purpose; do not make it public.
+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[] {
         1L,                1L,                  2L,
diff --git a/src/main/resources/checkstyle/checkstyle-suppressions.xml b/src/main/resources/checkstyle/checkstyle-suppressions.xml
index ad9e2d7..764a4f6 100644
--- a/src/main/resources/checkstyle/checkstyle-suppressions.xml
+++ b/src/main/resources/checkstyle/checkstyle-suppressions.xml
@@ -19,8 +19,6 @@
     "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
     "https://checkstyle.org/dtds/suppressions_1_2.dtd">
 <suppressions>
-  <!-- Making these final would break API compatibility. -->
-  <suppress checks="FinalClass" files="[\\/](ListSampler|InternalGamma|InternalUtils)\.java$" />
   <!-- Special cases with many parameters for the constructor. -->
   <suppress checks="ParameterNumber" files="[\\/]LargeMeanPoissonSampler\.java$" />
   <suppress checks="ParameterNumber" files="source64[\\/].*XoShiRo512.*\.java$" />
diff --git a/src/main/resources/pmd/pmd-ruleset.xml b/src/main/resources/pmd/pmd-ruleset.xml
index a461a5d..099ccb8 100644
--- a/src/main/resources/pmd/pmd-ruleset.xml
+++ b/src/main/resources/pmd/pmd-ruleset.xml
@@ -113,13 +113,6 @@
       <property name="violationSuppressXPath" value="//ClassOrInterfaceDeclaration[@Image='ProviderBuilder']"/>
     </properties>
   </rule>
-  <!-- These must remain final until 2.0 for binary compatibility. -->
-  <rule ref="category/java/design.xml/ClassWithOnlyPrivateConstructorsShouldBeFinal">
-    <properties>
-      <property name="violationSuppressXPath"
-        value="//ClassOrInterfaceDeclaration[@Image='InternalGamma' or @Image='InternalUtils' or @Image='ListSampler']"/>
-    </properties>
-  </rule>
 
   <rule ref="category/java/errorprone.xml/AvoidLiteralsInIfCondition">
     <properties>