Skip to content

Commit

Permalink
try to fix issue where _numberString is used despite having old value
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Jan 22, 2025
1 parent e4ac4f8 commit 69321c9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/com/fasterxml/jackson/core/base/ParserBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -799,6 +800,7 @@ public long getLongValue() throws IOException
}
if ((_numTypesValid & NR_LONG) == 0) {
convertNumberToLong();
_numberString = null;
}
}
return _numberLong;
Expand All @@ -813,6 +815,8 @@ public BigInteger getBigIntegerValue() throws IOException
}
if ((_numTypesValid & NR_BIGINT) == 0) {
convertNumberToBigInteger();
_numberString = null;
return _numberBigInt;
}
}
return _getBigInteger();
Expand All @@ -835,6 +839,8 @@ public float getFloatValue() throws IOException
}
if ((_numTypesValid & NR_FLOAT) == 0) {
convertNumberToFloat();
_numberString = null;
return _numberFloat;
}
}
return _getNumberFloat();
Expand All @@ -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();
Expand All @@ -864,6 +872,8 @@ public BigDecimal getDecimalValue() throws IOException
}
if ((_numTypesValid & NR_BIGDECIMAL) == 0) {
convertNumberToBigDecimal();
_numberString = null;
return _numberBigDecimal;
}
}
return _getBigDecimal();
Expand Down

0 comments on commit 69321c9

Please sign in to comment.