Skip to content

Commit 3db4106

Browse files
author
tmayer
committed
reidentation and new exception
1 parent 4ad165d commit 3db4106

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

json-smart/src/main/java/net/minidev/json/parser/JSONParserBase.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,20 @@ public void checkLeadinZero() throws ParseException {
133133

134134
protected Number extractFloat() throws ParseException {
135135
if (!acceptLeadinZero)
136-
checkLeadinZero();
137-
138-
try {
139-
if (!useHiPrecisionFloat)
136+
checkLeadinZero();
137+
138+
try {
139+
if (!useHiPrecisionFloat)
140140
return Float.parseFloat(xs);
141-
142-
if (xs.length() > 18) // follow JSonIJ parsing method
141+
142+
if (xs.length() > 18) // follow JSonIJ parsing method
143143
return new BigDecimal(xs);
144144

145-
return Double.parseDouble(xs);
145+
return Double.parseDouble(xs);
146146

147-
} catch(Exception e){
148-
throw new ParseException(pos, ERROR_UNEXPECTED_TOKEN, xs);
149-
}
147+
} catch(NumberFormatException e){
148+
throw new ParseException(pos, ERROR_UNEXPECTED_TOKEN, xs);
149+
}
150150
}
151151

152152
/**

0 commit comments

Comments
 (0)