Skip to content

Commit

Permalink
use NumberInput to parse floats (#3467)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning authored Apr 25, 2022
1 parent 5e5e43b commit 0b7d89b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ protected final Float _parseFloat(JsonParser p, DeserializationContext ctxt)
return (Float) getNullValue(ctxt);
}
try {
return Float.parseFloat(text);
return NumberInput.parseFloat(text);
} catch (IllegalArgumentException iae) { }
return (Float) ctxt.handleWeirdStringValue(_valueClass, text,
"not a valid `Float` value");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ protected final float _parseFloatPrimitive(DeserializationContext ctxt, String t
throws IOException
{
try {
return Float.parseFloat(text);
return NumberInput.parseFloat(text);
} catch (IllegalArgumentException iae) { }
Number v = (Number) ctxt.handleWeirdStringValue(Float.TYPE, text,
"not a valid `float` value");
Expand Down

0 comments on commit 0b7d89b

Please sign in to comment.