Skip to content

Commit c385faf

Browse files
committed
Merge branch '3.0' into 3.x
2 parents 4b08f73 + b8c53d4 commit c385faf

File tree

6 files changed

+44
-9
lines changed

6 files changed

+44
-9
lines changed

cbor/src/main/java/tools/jackson/dataformat/cbor/CBORParser.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3378,6 +3378,25 @@ protected void _skipIncomplete() throws JacksonException
33783378
&& type != CBORConstants.MAJOR_TYPE_BYTES) {
33793379
_throwInternal();
33803380
}
3381+
3382+
// [dataformats-binary#599]: If we are in a stringref namespace, we need to
3383+
// actually read and store the string/bytes value instead of just skipping it,
3384+
// so that later string references can find it.
3385+
// The finish methods will determine if the value should be added to the
3386+
// reference table based on shouldReferenceString().
3387+
if (!_stringRefs.empty()) {
3388+
if (type == CBORConstants.MAJOR_TYPE_TEXT) {
3389+
// Need to actually read the text (which may add to stringRefs)
3390+
_finishTextToken(_typeByte);
3391+
} else {
3392+
// For bytes: decode length then read (which may add to stringRefs)
3393+
int len = _decodeExplicitLength(_typeByte & 0x1F);
3394+
_finishBytes(len);
3395+
}
3396+
return;
3397+
}
3398+
3399+
// Standard skip logic when not in stringref namespace
33813400
final int lowBits = _typeByte & 0x1F;
33823401
if (lowBits <= 23) {
33833402
if (lowBits > 0) {

cbor/src/test/java/module-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
opens tools.jackson.dataformat.cbor.seq;
2525
opens tools.jackson.dataformat.cbor.testutil;
2626
opens tools.jackson.dataformat.cbor.testutil.failure;
27-
opens tools.jackson.dataformat.cbor.tofix;
27+
//opens tools.jackson.dataformat.cbor.tofix;
2828
}

cbor/src/test/java/tools/jackson/dataformat/cbor/tofix/StringRef599Test.java renamed to cbor/src/test/java/tools/jackson/dataformat/cbor/StringRef599Test.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
package tools.jackson.dataformat.cbor.tofix;
1+
package tools.jackson.dataformat.cbor;
22

33
import java.util.Arrays;
44

5+
import org.junit.jupiter.api.Test;
6+
57
import tools.jackson.core.JsonToken;
68
import tools.jackson.databind.ObjectMapper;
79

810
import tools.jackson.dataformat.cbor.*;
9-
import tools.jackson.dataformat.cbor.testutil.failure.JacksonTestFailureExpected;
1011

1112
import static org.junit.jupiter.api.Assertions.assertEquals;
1213

13-
import org.junit.jupiter.api.Test;
14-
1514
public class StringRef599Test extends CBORTestBase
1615
{
1716
private final ObjectMapper VANILLA_MAPPER = cborMapper();
@@ -27,7 +26,6 @@ public void testDupsNoStringRef() throws Exception
2726
}
2827

2928
// [dataformats-binary#599]
30-
@JacksonTestFailureExpected
3129
@Test
3230
public void testDupsWithStringRef() throws Exception
3331
{

ion/src/test/java/tools/jackson/dataformat/ion/IonNumberOverflowTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@ public void testLongAsBigIntegerSize() throws Exception {
8181
IonParser bigIntLongParser = (IonParser) new IonFactory().createParser(ObjectReadContext.empty(),
8282
bigIntLongValue.toString());
8383
assertEquals(JsonToken.VALUE_NUMBER_INT, bigIntLongParser.nextToken());
84-
// 23-Oct-2025: Ion 1.11.11+ changed behavior: values that fit in long are now
85-
// classified as LONG (was BIG_INTEGER before)
86-
assertEquals(JsonParser.NumberType.LONG, bigIntLongParser.getNumberType());
84+
assertEquals(JsonParser.NumberType.BIG_INTEGER, bigIntLongParser.getNumberType());
8785
assertEquals(JsonParser.NumberTypeFP.UNKNOWN, bigIntLongParser.getNumberTypeFP());
8886
assertEquals(bigIntLongValue.longValue(), bigIntLongParser.getLongValue());
8987
}

release-notes/CREDITS-2.x

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,3 +422,7 @@ Vincent Eigenberger (@beseder1)
422422
* Contributed fix for #601: Jackson subtype Avro schema unions are non-deterministic
423423
and therefore incompatible with each other
424424
(2.20.1)
425+
426+
Yohei Kishimoto (@morokosi)
427+
* Reported #599: (cbor) Unable to deserialize stringref-enabled CBOR with ignored properties
428+
(2.21.0)

release-notes/VERSION-2.x

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,22 @@ Active maintainers:
1616

1717
2.21.0 (not yet released)
1818

19+
#599: (cbor) Unable to deserialize stringref-enabled CBOR with ignored properties
20+
(reported by Yohei K)
1921
#623: (ion) Upgrade `ion-java` dep to 1.11.11 (from 1.11.10)
2022
(requested by @Shaurya0108)
2123

2224
2.20.1 (not yet released)
2325

26+
#599: (cbor) Unable to deserialize stringref-enabled CBOR with ignored properties
27+
(reported by Yohei K)
2428
#601: Jackson subtype Avro schema unions are non-deterministic and therefore
2529
incompatible with each other
2630
(reported by Raphael W)
2731
(fix by Vincent E)
2832
#616: CBOR text gets truncated on decoding
2933
(reported, fix contributed by Manuel S)
34+
#623: (ion) Upgrade `ion-java` dep to 1.11.11 (from 1.11.10)
3035

3136
2.20.0 (28-Aug-2025)
3237

@@ -48,12 +53,16 @@ Active maintainers:
4853

4954
2.19.3 (not yet released)
5055

56+
#599: (cbor) Unable to deserialize stringref-enabled CBOR with ignored properties
57+
(reported by Yohei K)
5158
#601: Jackson subtype Avro schema unions are non-deterministic and therefore
5259
incompatible with each other
5360
(reported by Raphael W)
5461
(fix by Vincent E)
5562
#616: CBOR text gets truncated on decoding
5663
(reported, fix contributed by Manuel S)
64+
#623: (ion) Upgrade `ion-java` dep to 1.11.11 (from 1.11.10)
65+
(requested by @Shaurya0108)
5766

5867
2.19.2 (18-Jul-2025)
5968

@@ -90,6 +99,13 @@ No changes since 2.19.1
9099
#571: Unable to deserialize a pojo with IonStruct
91100
(reported, fix contributed by Josh C)
92101

102+
2.18.5 (not yet released)
103+
104+
#599: (cbor) Unable to deserialize stringref-enabled CBOR with ignored properties
105+
(reported by Yohei K)
106+
#623: (ion) Upgrade `ion-java` dep to 1.11.11 (from 1.11.10)
107+
(requested by @Shaurya0108)
108+
93109
2.18.4 (06-May-2025)
94110

95111
#569: (ion) `IonParser` fails to parse some `long` values saying

0 commit comments

Comments
 (0)