Skip to content

Commit 4c77a0f

Browse files
authored
Merge pull request #28 from winfriedgerlach/feature/use-newer-API-for-better-performance
Use newer `BigDecimal` api to avoid extra `String` allocation
2 parents 4d7cd58 + c1915bf commit 4c77a0f

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/main/java/org/codehaus/stax2/ri/typed/ValueDecoderFactory.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,12 +1074,7 @@ public void decode(char[] lexical, int start, int end) throws IllegalArgumentExc
10741074
{
10751075
int len = end-start;
10761076
try {
1077-
/* !!! 21-Nov-2008, TSa: This constructor was added in JDK1.5
1078-
* so can't yet be used (As of Woodstox 4.x).
1079-
* Need to use the older constructor for now
1080-
*/
1081-
//mValue = new BigDecimal(lexical, start, len);
1082-
mValue = new BigDecimal(new String(lexical, start, len));
1077+
mValue = new BigDecimal(lexical, start, len);
10831078
} catch (NumberFormatException nex) {
10841079
throw constructInvalidValue(new String(lexical, start, len));
10851080
}

0 commit comments

Comments
 (0)