File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
src/main/java/com/fasterxml/jackson/core Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ a pure JSON library.
14
14
= == Releases == =
15
15
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
16
16
17
+ 2.18 .5 (not yet released )
18
+
19
+ #1433 : `JsonParser #getNumberType ()` throws `JsonParseException ` when
20
+ the current token is non - numeric instead of returning null
21
+ (reported by @CrazySqueak )
22
+
17
23
2.18 .4 (06 - May - 2025 )
18
24
19
25
No changes since 2.18 .3
Original file line number Diff line number Diff line change @@ -1772,12 +1772,18 @@ public Object getNumberValueDeferred() throws IOException {
1772
1772
* If current token is of type
1773
1773
* {@link JsonToken#VALUE_NUMBER_INT} or
1774
1774
* {@link JsonToken#VALUE_NUMBER_FLOAT}, returns
1775
- * one of {@link NumberType} constants; otherwise returns {@code null}.
1775
+ * one of {@link NumberType} constants; otherwise throws
1776
+ * a {@link JsonParseException}.
1777
+ *<p>
1778
+ * NOTE: before 2.18 was documented to return {@code null} for non-numeric
1779
+ * tokens, but this has never been the case.
1776
1780
*
1777
- * @return Type of current number, if parser points to numeric token; {@code null} otherwise
1781
+ * @return Type of current number, if parser points to numeric token.
1778
1782
*
1779
- * @throws IOException for low-level read issues, or
1780
- * {@link JsonParseException} for decoding problems
1783
+ * @throws IOException {@link JsonParseException} if
1784
+ * the current token is not numeric, or if decoding of the value fails
1785
+ * (invalid format for numbers); plain {@link IOException} if underlying
1786
+ * content read fails (possible if numbers are decoded lazily).
1781
1787
*/
1782
1788
public abstract NumberType getNumberType () throws IOException ;
1783
1789
You can’t perform that action at this time.
0 commit comments