Skip to content

Commit c1fa047

Browse files
committed
Add generics to JXPathContext.decimalFormats
1 parent 226d4c8 commit c1fa047

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ The <action> type attribute can be add,update,fix,remove.
103103
<action dev="ggregory" type="fix" due-to="Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName.</action>
104104
<action dev="ggregory" type="fix" due-to="Gary Gregory">Add generics to JXPathContext.iterate(String).</action>
105105
<action dev="ggregory" type="fix" due-to="Gary Gregory">Add generics to JXPathContext.iteratePointers(String).</action>
106+
<action dev="ggregory" type="fix" due-to="Gary Gregory">Add generics to JXPathContext.decimalFormats.</action>
106107
<!-- ADD -->
107108
<action issue="JXPATH-123" dev="mbenson" type="add">
108109
XPath function "ends-with" is not implemented (although "starts-with" is).

src/main/java/org/apache/commons/jxpath/JXPathContext.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ public abstract class JXPathContext {
419419
/** KeyManager */
420420
protected KeyManager keyManager;
421421
/** Decimal format map */
422-
protected HashMap decimalFormats;
422+
protected HashMap<String, DecimalFormatSymbols> decimalFormats;
423423

424424
private Locale locale;
425425
private boolean lenientSet = false;
@@ -609,7 +609,7 @@ public synchronized Locale getLocale() {
609609
public synchronized void setDecimalFormatSymbols(final String name,
610610
final DecimalFormatSymbols symbols) {
611611
if (decimalFormats == null) {
612-
decimalFormats = new HashMap();
612+
decimalFormats = new HashMap<>();
613613
}
614614
decimalFormats.put(name, symbols);
615615
}
@@ -624,7 +624,7 @@ public synchronized DecimalFormatSymbols getDecimalFormatSymbols(final String na
624624
if (decimalFormats == null) {
625625
return parentContext == null ? null : parentContext.getDecimalFormatSymbols(name);
626626
}
627-
return (DecimalFormatSymbols) decimalFormats.get(name);
627+
return decimalFormats.get(name);
628628
}
629629

630630
/**

0 commit comments

Comments
 (0)