File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
json-path/src/main/java/com/jayway/jsonpath/spi/json Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ public Object unwrap(final Object o) {
85
85
86
86
private static boolean isPrimitiveNumber (final Number n ) {
87
87
return n instanceof Integer ||
88
+ n instanceof Float ||
88
89
n instanceof Double ||
89
90
n instanceof Long ||
90
91
n instanceof BigDecimal ||
@@ -97,9 +98,9 @@ private static Number unwrapNumber(final Number n) {
97
98
if (!isPrimitiveNumber (n )) {
98
99
BigDecimal bigDecimal = new BigDecimal (n .toString ());
99
100
if (bigDecimal .scale () <= 0 ) {
100
- if (bigDecimal .compareTo (new BigDecimal (Integer .MAX_VALUE )) <= 0 ) {
101
+ if (bigDecimal .abs (). compareTo (new BigDecimal (Integer .MAX_VALUE )) <= 0 ) {
101
102
unwrapped = bigDecimal .intValue ();
102
- } else if (bigDecimal .compareTo (new BigDecimal (Long .MAX_VALUE )) <= 0 ){
103
+ } else if (bigDecimal .abs (). compareTo (new BigDecimal (Long .MAX_VALUE )) <= 0 ){
103
104
unwrapped = bigDecimal .longValue ();
104
105
} else {
105
106
unwrapped = bigDecimal ;
You can’t perform that action at this time.
0 commit comments