Skip to content

Commit

Permalink
Make utility classes final.
Browse files Browse the repository at this point in the history
  • Loading branch information
aherbert committed May 23, 2019
1 parent 312d915 commit 24a80c3
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*
* @since 1.0
*/
public class ListSampler {
public final class ListSampler {
/**
* Class contains only static methods.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* Γ (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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* 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,
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/checkstyle/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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$" />
Expand Down
7 changes: 0 additions & 7 deletions src/main/resources/pmd/pmd-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 24a80c3

Please sign in to comment.