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/06/14 22:38:14 UTC

[commons-io] branch master updated (9b3c039d -> 0732b44a)

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

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


    from 9b3c039d PMD: ignore empty catch block
     new 73d32811 Use removeIf() for a more efficient implementation which also deals with the PMD empty while loop error.
     new 0732b44a Use removeIf() for a more efficient implementation which also deals with the PMD empty while loop error.

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:
 .../java/org/apache/commons/io/monitor/FileAlterationMonitor.java     | 4 +---
 .../java/org/apache/commons/io/monitor/FileAlterationObserver.java    | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)


[commons-io] 01/02: Use removeIf() for a more efficient implementation which also deals with the PMD empty while loop error.

Posted by gg...@apache.org.
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-io.git

commit 73d32811ce6b6d6fc84a5d62071058db60b7f7dd
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jun 14 18:37:28 2022 -0400

    Use removeIf() for a more efficient implementation which also deals with
    the PMD empty while loop error.
---
 .../java/org/apache/commons/io/monitor/FileAlterationMonitor.java     | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/io/monitor/FileAlterationMonitor.java b/src/main/java/org/apache/commons/io/monitor/FileAlterationMonitor.java
index df539aa9..9a4b81b0 100644
--- a/src/main/java/org/apache/commons/io/monitor/FileAlterationMonitor.java
+++ b/src/main/java/org/apache/commons/io/monitor/FileAlterationMonitor.java
@@ -129,9 +129,7 @@ public final class FileAlterationMonitor implements Runnable {
      */
     public void removeObserver(final FileAlterationObserver observer) {
         if (observer != null) {
-            while (observers.remove(observer)) {
-                // empty
-            }
+            observers.removeIf(observer::equals);
         }
     }
 


[commons-io] 02/02: Use removeIf() for a more efficient implementation which also deals with the PMD empty while loop error.

Posted by gg...@apache.org.
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-io.git

commit 0732b44ae2706681a0bc4b8e9d66f0040ff3b3d7
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jun 14 18:37:53 2022 -0400

    Use removeIf() for a more efficient implementation which also deals with
    the PMD empty while loop error.
---
 .../java/org/apache/commons/io/monitor/FileAlterationObserver.java    | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java b/src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java
index 05f766fa..064e2ebe 100644
--- a/src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java
+++ b/src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java
@@ -444,9 +444,7 @@ public class FileAlterationObserver implements Serializable {
      */
     public void removeListener(final FileAlterationListener listener) {
         if (listener != null) {
-            while (listeners.remove(listener)) {
-                // empty
-            }
+            listeners.removeIf(listener::equals);
         }
     }