Skip to content

Commit d6ee9ba

Browse files
committed
PMD: allow public members in non public type
Added exclusions to allow build using PMD 7.21.0. See also: pmd/pmd#6477
1 parent 0c69475 commit d6ee9ba

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

commons-rng-sampling/src/main/java/org/apache/commons/rng/sampling/distribution/InternalUtils.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,10 @@ static double makeNonZeroDouble(long v) {
271271
* It allows to allocate a cache of precomputed values.
272272
* In case of cache miss, computation is performed by a call to
273273
* {@link InternalGamma#logGamma(double)}.
274+
*
275+
* <p>TODO: Remove public modifiers in next major release. This class is
276+
* effectively package-private but changing triggers a false-positive
277+
* binary compatibility failure using japicmp.
274278
*/
275279
public static final class FactorialLog {
276280
/**

src/conf/pmd/pmd-ruleset.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,16 @@
240240
value="./ancestor-or-self::ClassDeclaration[@SimpleName='LargeMeanPoissonSamplerState']"/>
241241
</properties>
242242
</rule>
243+
<rule ref="category/java/design.xml/PublicMemberInNonPublicType">
244+
<properties>
245+
<!-- AbstractWell.IndexTable is a protected class for use in derived classes of the
246+
public outer class. InternalUtils.FactorialLog should be package-private but this
247+
change is not allowed by japicmp (false positive). -->
248+
<property name="violationSuppressXPath"
249+
value="./ancestor-or-self::ClassDeclaration[@SimpleName='IndexTable'
250+
or @SimpleName='FactorialLog']"/>
251+
</properties>
252+
</rule>
243253

244254
<rule ref="category/java/documentation.xml/CommentRequired">
245255
<properties>

0 commit comments

Comments
 (0)