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 2024/06/23 19:28:22 UTC

(commons-collections) 02/03: PatriciaTrie constructor reuse the stateless singleton StringKeyAnalyzer.INSTANCE

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-collections.git

commit 6c609f0d76a89cbf2a333d0874f2e4b1774f4630
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jun 23 15:13:27 2024 -0400

    PatriciaTrie constructor reuse the stateless singleton
    StringKeyAnalyzer.INSTANCE
---
 src/changes/changes.xml                                              | 1 +
 src/main/java/org/apache/commons/collections4/trie/PatriciaTrie.java | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 99d06af74..e0c5a8c42 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -28,6 +28,7 @@
     <action type="fix" dev="ggregory" due-to="Gary Gregory">Package private AbstractEmptyIterator implements ResettableIterator so subclasses don't.</action>
     <action type="fix" dev="ggregory" due-to="Gary Gregory">Deprecate AbstractEmptyIterator.add(E) without replacement.</action>
     <action type="fix" dev="ggregory" due-to="Gary Gregory">Add missing Javadocs.</action>
+    <action type="fix" dev="ggregory" due-to="Gary Gregory">PatriciaTrie constructor reuse the stateless singleton StringKeyAnalyzer.INSTANCE.</action>
     <!-- ADD -->
     <!-- UPDATE -->
   </release>
diff --git a/src/main/java/org/apache/commons/collections4/trie/PatriciaTrie.java b/src/main/java/org/apache/commons/collections4/trie/PatriciaTrie.java
index 950f498cd..26f327820 100644
--- a/src/main/java/org/apache/commons/collections4/trie/PatriciaTrie.java
+++ b/src/main/java/org/apache/commons/collections4/trie/PatriciaTrie.java
@@ -67,11 +67,11 @@ public class PatriciaTrie<V> extends AbstractPatriciaTrie<String, V> {
     private static final long serialVersionUID = 4446367780901817838L;
 
     public PatriciaTrie() {
-        super(new StringKeyAnalyzer());
+        super(StringKeyAnalyzer.INSTANCE);
     }
 
     public PatriciaTrie(final Map<? extends String, ? extends V> m) {
-        super(new StringKeyAnalyzer(), m);
+        super(StringKeyAnalyzer.INSTANCE, m);
     }
 
 }