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/09/10 20:17:19 UTC

[commons-rng] branch master updated: JDKRandomBridge: Ignore PMD warning about method level synchronization.

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 379e5cc  JDKRandomBridge: Ignore PMD warning about method level synchronization.
379e5cc is described below

commit 379e5ccc110a4c6b1e041e07730d27395c569c55
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Tue Sep 10 21:11:00 2019 +0100

    JDKRandomBridge: Ignore PMD warning about method level synchronization.
    
    This synchronized method is an override of the super-class method which
    is synchronized.
---
 src/main/resources/pmd/pmd-ruleset.xml | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/main/resources/pmd/pmd-ruleset.xml b/src/main/resources/pmd/pmd-ruleset.xml
index 40c1312..3bf693d 100644
--- a/src/main/resources/pmd/pmd-ruleset.xml
+++ b/src/main/resources/pmd/pmd-ruleset.xml
@@ -139,14 +139,21 @@
   </rule>
 
   <rule ref="category/java/multithreading.xml/UseConcurrentHashMap">
-     <properties>
+    <properties>
       <property name="violationSuppressXPath" value="//ClassOrInterfaceDeclaration[@Image='DiscreteProbabilityCollectionSampler']"/>
     </properties>
   </rule>
 
+  <rule ref="category/java/multithreading.xml/AvoidSynchronizedAtMethodLevel">
+    <properties>
+      <!-- Allows synchronized method when it is an override of the parent class -->
+      <property name="violationSuppressXPath" value="//ClassOrInterfaceDeclaration[@Image='JDKRandomBridge']"/>
+    </properties>
+  </rule>
+
   <rule ref="category/java/performance.xml/AvoidUsingShortType">
-     <properties>
-     <!-- Short datatype is used to optimise 16-bit storage. -->
+    <properties>
+      <!-- Short datatype is used to optimise 16-bit storage. -->
       <property name="violationSuppressXPath" value="//ClassOrInterfaceDeclaration[@Image='MarsagliaTsangWangDiscreteSampler']"/>
     </properties>
   </rule>