You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2025/08/02 12:10:10 UTC

(maven-enforcer) branch issue-917 created (now ff0ff93b)

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

khmarbaise pushed a change to branch issue-917
in repository https://gitbox.apache.org/repos/asf/maven-enforcer.git


      at ff0ff93b Fixes #917 - Remove usage of Hashtable

This branch includes the following new commits:

     new ff0ff93b Fixes #917 - Remove usage of Hashtable

The 1 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.



(maven-enforcer) 01/01: Fixes #917 - Remove usage of Hashtable

Posted by kh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a commit to branch issue-917
in repository https://gitbox.apache.org/repos/asf/maven-enforcer.git

commit ff0ff93b8ac30678b8dde243d15c83f44c5c21c7
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sat Aug 2 14:09:43 2025 +0200

    Fixes #917 - Remove usage of Hashtable
---
 .../src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java b/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java
index a7353606..0ef2a945 100644
--- a/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java
+++ b/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java
@@ -19,10 +19,11 @@
 package org.apache.maven.plugins.enforcer;
 
 import java.util.ArrayList;
-import java.util.Hashtable;
 import java.util.List;
+import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.stream.Collectors;
 
 import org.apache.maven.enforcer.rule.api.AbstractEnforcerRule;
@@ -70,7 +71,7 @@ public class EnforceMojo extends AbstractMojo {
     /**
      * This is a static variable used to persist the cached results across plugin invocations.
      */
-    protected static Hashtable<String, EnforcerRule> cache = new Hashtable<>();
+    protected static Map<String, EnforcerRule> cache = new ConcurrentHashMap<>();
 
     /**
      * MojoExecution needed by the ExpressionEvaluator