Skip to content

Commit

Permalink
Merge branch '2.17'
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Nov 29, 2023
2 parents 01899d6 + 11e4d93 commit 2f7e60c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,10 @@ public final void _initSchema(AvroSchema schema) throws JacksonException {
public final boolean isNaN() {
if (_currToken == JsonToken.VALUE_NUMBER_FLOAT) {
if ((_numTypesValid & NR_DOUBLE) != 0) {
// 10-Mar-2017, tatu: Alas, `Double.isFinite(d)` only added in JDK 8
double d = _numberDouble;
return Double.isNaN(d) || Double.isInfinite(d);
return !Double.isFinite(_numberDouble);
}
if ((_numTypesValid & NR_FLOAT) != 0) {
float f = _numberFloat;
return Float.isNaN(f) || Float.isInfinite(f);
return !Float.isFinite(_numberFloat);
}
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1988,13 +1988,10 @@ private final byte[] _getBinaryFromString(Base64Variant variant) throws JacksonE
public boolean isNaN() {
if (_currToken == JsonToken.VALUE_NUMBER_FLOAT) {
if ((_numTypesValid & NR_DOUBLE) != 0) {
// 10-Mar-2017, tatu: Alas, `Double.isFinite(d)` only added in JDK 8
double d = _numberDouble;
return Double.isNaN(d) || Double.isInfinite(d);
return !Double.isFinite(_numberDouble);
}
if ((_numTypesValid & NR_FLOAT) != 0) {
float f = _numberFloat;
return Float.isNaN(f) || Float.isInfinite(f);
return !Float.isFinite(_numberFloat);
}
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1577,13 +1577,10 @@ public int readBinaryValue(Base64Variant b64variant, OutputStream out) throws Ja
public boolean isNaN() {
if (_currToken == JsonToken.VALUE_NUMBER_FLOAT) {
if ((_numTypesValid & NR_DOUBLE) != 0) {
// 10-Mar-2017, tatu: Alas, `Double.isFinite(d)` only added in JDK 8
double d = _numberDouble;
return Double.isNaN(d) || Double.isInfinite(d);
return !Double.isFinite(_numberDouble);
}
if ((_numTypesValid & NR_FLOAT) != 0) {
float f = _numberFloat;
return Float.isNaN(f) || Float.isInfinite(f);
return !Float.isFinite(_numberFloat);
}
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,11 @@ public final boolean isNaN() throws JacksonException {
if (_numTypesValid == NR_UNKNOWN) {
_parseNumericValue(); // will also check event type
}
if (_numberType == NumberType.DOUBLE) {
// 10-Mar-2017, tatu: Alas, `Double.isFinite(d)` only added in JDK 8
double d = _numberDouble;
return Double.isNaN(d) || Double.isInfinite(d);
if ((_numTypesValid & NR_DOUBLE) != 0) {
return !Double.isFinite(_numberDouble);
}
if (_numberType == NumberType.FLOAT) {
float f = _numberFloat;
return Float.isNaN(f) || Float.isInfinite(f);
if ((_numTypesValid & NR_FLOAT) != 0) {
return !Float.isFinite(_numberFloat);
}
}
return false;
Expand Down

0 comments on commit 2f7e60c

Please sign in to comment.