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

commit c1fa047df3d78d65f8d8f84ad6fb672f74150a20
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sat Nov 16 11:15:05 2024 -0500

    Add generics to JXPathContext.decimalFormats
---
 src/changes/changes.xml                                    | 1 +
 src/main/java/org/apache/commons/jxpath/JXPathContext.java | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index cca2edb..ec3bb05 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -103,6 +103,7 @@ The <action> type attribute can be add,update,fix,remove.
       <action dev="ggregory" type="fix" due-to="Gary Gregory">Fix PMD 
UnnecessaryFullyQualifiedName.</action>
       <action dev="ggregory" type="fix" due-to="Gary Gregory">Add generics to 
JXPathContext.iterate(String).</action>
       <action dev="ggregory" type="fix" due-to="Gary Gregory">Add generics to 
JXPathContext.iteratePointers(String).</action>
+      <action dev="ggregory" type="fix" due-to="Gary Gregory">Add generics to 
JXPathContext.decimalFormats.</action>
       <!-- ADD -->
       <action issue="JXPATH-123" dev="mbenson" type="add">
         XPath function "ends-with" is not implemented (although "starts-with" 
is).
diff --git a/src/main/java/org/apache/commons/jxpath/JXPathContext.java 
b/src/main/java/org/apache/commons/jxpath/JXPathContext.java
index 63d02c7..b89643f 100644
--- a/src/main/java/org/apache/commons/jxpath/JXPathContext.java
+++ b/src/main/java/org/apache/commons/jxpath/JXPathContext.java
@@ -419,7 +419,7 @@ public abstract class JXPathContext {
     /** KeyManager */
     protected KeyManager keyManager;
     /** Decimal format map */
-    protected HashMap decimalFormats;
+    protected HashMap<String, DecimalFormatSymbols> decimalFormats;
 
     private Locale locale;
     private boolean lenientSet = false;
@@ -609,7 +609,7 @@ public abstract class JXPathContext {
     public synchronized void setDecimalFormatSymbols(final String name,
             final DecimalFormatSymbols symbols) {
         if (decimalFormats == null) {
-            decimalFormats = new HashMap();
+            decimalFormats = new HashMap<>();
         }
         decimalFormats.put(name, symbols);
     }
@@ -624,7 +624,7 @@ public abstract class JXPathContext {
         if (decimalFormats == null) {
             return parentContext == null ? null : 
parentContext.getDecimalFormatSymbols(name);
         }
-        return (DecimalFormatSymbols) decimalFormats.get(name);
+        return decimalFormats.get(name);
     }
 
     /**

Reply via email to