File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor
ion/src/main/java/com/fasterxml/jackson/dataformat/ion Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -770,7 +770,9 @@ public void close() throws IOException {
770
770
_closed = true ;
771
771
_symbols .release ();
772
772
// 30-May-2025, tatu: was missing before 2.20
773
- _currToken = null ;
773
+ if (JsonParser .Feature .CLEAR_CURRENT_TOKEN_ON_CLOSE .enabledIn (_features )) {
774
+ _currToken = null ;
775
+ }
774
776
try {
775
777
_closeInput ();
776
778
} finally {
Original file line number Diff line number Diff line change @@ -254,6 +254,10 @@ public boolean isClosed() {
254
254
@ Override
255
255
public void close () throws IOException {
256
256
if (!_closed ) {
257
+ // 30-May-2025, tatu: was missing before 2.20
258
+ if (JsonParser .Feature .CLEAR_CURRENT_TOKEN_ON_CLOSE .enabledIn (_features )) {
259
+ _currToken = null ;
260
+ }
257
261
// should only close if manage the resource
258
262
if (_ioContext .isResourceManaged ()) {
259
263
Object src = _ioContext .contentReference ().getRawContent ();
@@ -448,6 +452,10 @@ private void _verifyIsNumberToken() throws IOException
448
452
}
449
453
}
450
454
455
+ // NOTE: Ion implementation follows original (up to 2.19) JsonParser Javadocs
456
+ // behavior (if non-number, return `null`), which is different from other
457
+ // backends (if non-number, throw exception). But since 3.0 will switch to
458
+ // "return null for non-numbers", Ion behavior is retained in 2.20+.
451
459
@ Override
452
460
public NumberType getNumberType () throws IOException
453
461
{
You can’t perform that action at this time.
0 commit comments