You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/07/03 00:09:12 UTC

[commons-pool] 04/04: Add PMD check to default Maven goal

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

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-pool.git

commit 4c86763f00c908aef5703352e8fb7d9bdddf6525
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jul 2 20:08:59 2022 -0400

    Add PMD check to default Maven goal
    
    PMD ignore empty control statement.
---
 pom.xml                                                                | 2 +-
 .../java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java    | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 886f3262..5da5b9b8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -210,7 +210,7 @@
   </properties> 
 
   <build>
-      <defaultGoal>clean verify apache-rat:check checkstyle:check japicmp:cmp javadoc:javadoc spotbugs:check</defaultGoal>
+      <defaultGoal>clean verify apache-rat:check checkstyle:check japicmp:cmp javadoc:javadoc spotbugs:check pmd:check</defaultGoal>
       <pluginManagement>
         <plugins>
           <plugin>
diff --git a/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java b/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
index bc5ad180..1093cbc5 100644
--- a/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
+++ b/src/main/java/org/apache/commons/pool2/impl/SoftReferenceObjectPool.java
@@ -353,8 +353,7 @@ public class SoftReferenceObjectPool<T, E extends Exception> extends BaseObjectP
         // Remove wrappers for enqueued references from idle and allReferences lists
         removeClearedReferences(idleReferences.iterator());
         removeClearedReferences(allReferences.iterator());
-        while (refQueue.poll() != null) {
-            // draining queue
+        while (refQueue.poll() != null) { // NOPMD
         }
     }