From 69321c90492b72b7ece38f683868ca6c47e78471 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 22 Jan 2025 21:28:03 +0100 Subject: [PATCH] try to fix issue where _numberString is used despite having old value --- .../com/fasterxml/jackson/core/base/ParserBase.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/fasterxml/jackson/core/base/ParserBase.java b/src/main/java/com/fasterxml/jackson/core/base/ParserBase.java index 73347e0405..a104ffc307 100644 --- a/src/main/java/com/fasterxml/jackson/core/base/ParserBase.java +++ b/src/main/java/com/fasterxml/jackson/core/base/ParserBase.java @@ -785,6 +785,7 @@ public int getIntValue() throws IOException } if ((_numTypesValid & NR_INT) == 0) { // wasn't an int natively? convertNumberToInt(); // let's make it so, if possible + _numberString = null; } } return _numberInt; @@ -799,6 +800,7 @@ public long getLongValue() throws IOException } if ((_numTypesValid & NR_LONG) == 0) { convertNumberToLong(); + _numberString = null; } } return _numberLong; @@ -813,6 +815,8 @@ public BigInteger getBigIntegerValue() throws IOException } if ((_numTypesValid & NR_BIGINT) == 0) { convertNumberToBigInteger(); + _numberString = null; + return _numberBigInt; } } return _getBigInteger(); @@ -835,6 +839,8 @@ public float getFloatValue() throws IOException } if ((_numTypesValid & NR_FLOAT) == 0) { convertNumberToFloat(); + _numberString = null; + return _numberFloat; } } return _getNumberFloat(); @@ -850,6 +856,8 @@ public double getDoubleValue() throws IOException // if underlying type not FP, need conversion: if ((_numTypesValid & NR_DOUBLE) == 0) { convertNumberToDouble(); + _numberString = null; + return _numberDouble; } } return _getNumberDouble(); @@ -864,6 +872,8 @@ public BigDecimal getDecimalValue() throws IOException } if ((_numTypesValid & NR_BIGDECIMAL) == 0) { convertNumberToBigDecimal(); + _numberString = null; + return _numberBigDecimal; } } return _getBigDecimal();