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) {
8585
8686 private static boolean isPrimitiveNumber (final Number n ) {
8787 return n instanceof Integer ||
88+ n instanceof Float ||
8889 n instanceof Double ||
8990 n instanceof Long ||
9091 n instanceof BigDecimal ||
@@ -97,9 +98,9 @@ private static Number unwrapNumber(final Number n) {
9798 if (!isPrimitiveNumber (n )) {
9899 BigDecimal bigDecimal = new BigDecimal (n .toString ());
99100 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 ) {
101102 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 ){
103104 unwrapped = bigDecimal .longValue ();
104105 } else {
105106 unwrapped = bigDecimal ;
You can’t perform that action at this time.
0 commit comments