Skip to content

Commit

Permalink
Fix copyCurrentEvent test.
Browse files Browse the repository at this point in the history
  • Loading branch information
htmldoug committed Dec 20, 2021
1 parent 1cb5dfb commit aaa3223
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/main/java/com/fasterxml/jackson/core/JsonGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -2617,13 +2617,17 @@ protected void _copyCurrentContents(JsonParser p) throws IOException
}
case ID_NUMBER_FLOAT:
{
NumberType n = p.getNumberType();
if (n == NumberType.BIG_DECIMAL) {
writeNumber(p.getDecimalValue());
} else if (n == NumberType.FLOAT) {
writeNumber(p.getFloatValue());
if (p.getReadCapabilities().isEnabled(StreamReadCapability.EXACT_FLOATS)) {
NumberType n = p.getNumberType();
if (n == NumberType.BIG_DECIMAL) {
writeNumber(p.getDecimalValue());
} else if (n == NumberType.FLOAT) {
writeNumber(p.getFloatValue());
} else {
writeNumber(p.getDoubleValue());
}
} else {
writeNumber(p.getDoubleValue());
writeNumber(p.getTextCharacters(), p.getTextOffset(), p.getTextLength());
}
break;
}
Expand Down

0 comments on commit aaa3223

Please sign in to comment.