Skip to content

Commit 08ff181

Browse files
committed
Add forced override of getNumberValueExact() for binary codecs
1 parent 15424ca commit 08ff181

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

avro/src/main/java/com/fasterxml/jackson/dataformat/avro/deser/AvroParserImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ public final Number getNumberValue() throws IOException
208208
return _numberFloat;
209209
}
210210

211+
@Override // @since 2.12 -- for (most?) binary formats exactness guaranteed anyway
212+
public final Number getNumberValueExact() throws IOException {
213+
return getNumberValue();
214+
}
215+
211216
@Override
212217
public final NumberType getNumberType() throws IOException
213218
{

cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,6 +1786,11 @@ public Number getNumberValue() throws IOException
17861786
return _numberFloat;
17871787
}
17881788

1789+
@Override // @since 2.12 -- for (most?) binary formats exactness guaranteed anyway
1790+
public final Number getNumberValueExact() throws IOException {
1791+
return getNumberValue();
1792+
}
1793+
17891794
@Override
17901795
public NumberType getNumberType() throws IOException
17911796
{

ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@
3535
public class IonParser
3636
extends ParserMinimalBase
3737
{
38-
private static final BigInteger LONG_MIN_VALUE = BigInteger.valueOf(Long.MIN_VALUE);
39-
private static final BigInteger LONG_MAX_VALUE = BigInteger.valueOf(Long.MAX_VALUE);
40-
private static final BigInteger INT_MIN_VALUE = BigInteger.valueOf(Integer.MIN_VALUE);
41-
private static final BigInteger INT_MAX_VALUE = BigInteger.valueOf(Integer.MAX_VALUE);
42-
4338
/*
4439
/*****************************************************************
4540
/* Basic configuration
@@ -309,7 +304,12 @@ public Number getNumberValue() throws IOException {
309304
}
310305
return null;
311306
}
312-
307+
308+
@Override // @since 2.12 -- for (most?) binary formats exactness guaranteed anyway
309+
public final Number getNumberValueExact() throws IOException {
310+
return getNumberValue();
311+
}
312+
313313
/*
314314
/****************************************************************
315315
/* JsonParser implementation: Access to other (non-text/number) values

protobuf/src/main/java/com/fasterxml/jackson/dataformat/protobuf/ProtobufParser.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,12 @@ public Number getNumberValue() throws IOException
15281528
}
15291529
return _numberFloat;
15301530
}
1531-
1531+
1532+
@Override // @since 2.12 -- for (most?) binary formats exactness guaranteed anyway
1533+
public final Number getNumberValueExact() throws IOException {
1534+
return getNumberValue();
1535+
}
1536+
15321537
@Override
15331538
public NumberType getNumberType() throws IOException
15341539
{

smile/src/main/java/com/fasterxml/jackson/dataformat/smile/SmileParserBase.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,11 @@ public final Number getNumberValue() throws IOException
479479
}
480480
}
481481

482+
@Override // @since 2.12 -- for (most?) binary formats exactness guaranteed anyway
483+
public final Number getNumberValueExact() throws IOException {
484+
return getNumberValue();
485+
}
486+
482487
@Override
483488
public final NumberType getNumberType() throws IOException
484489
{

0 commit comments

Comments
 (0)