Skip to content

Commit 68caf9a

Browse files
committed
Merge branch '2.x' into 3.0
2 parents 9227b29 + 48149b6 commit 68caf9a

File tree

5 files changed

+39
-7
lines changed

5 files changed

+39
-7
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
{

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: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ Active maintainers:
1616

1717
2.21.0 (not yet released)
1818

19-
No changes since 2.20
19+
#599: (cbor) Unable to deserialize stringref-enabled CBOR with ignored properties
20+
(reported by Yohei K)
21+
#623: (ion) Upgrade `ion-java` dep to 1.11.11 (from 1.11.10)
22+
(requested by @Shaurya0108)
2023

2124
2.20.1 (not yet released)
2225

@@ -26,6 +29,7 @@ No changes since 2.20
2629
(fix by Vincent E)
2730
#616: CBOR text gets truncated on decoding
2831
(reported, fix contributed by Manuel S)
32+
#623: (ion) Upgrade `ion-java` dep to 1.11.11 (from 1.11.10)
2933

3034
2.20.0 (28-Aug-2025)
3135

@@ -53,6 +57,8 @@ No changes since 2.20
5357
(fix by Vincent E)
5458
#616: CBOR text gets truncated on decoding
5559
(reported, fix contributed by Manuel S)
60+
#623: (ion) Upgrade `ion-java` dep to 1.11.11 (from 1.11.10)
61+
(requested by @Shaurya0108)
5662

5763
2.19.2 (18-Jul-2025)
5864

@@ -89,6 +95,11 @@ No changes since 2.19.1
8995
#571: Unable to deserialize a pojo with IonStruct
9096
(reported, fix contributed by Josh C)
9197

98+
2.18.5 (not yet released)
99+
100+
#623: (ion) Upgrade `ion-java` dep to 1.11.11 (from 1.11.10)
101+
(requested by @Shaurya0108)
102+
92103
2.18.4 (06-May-2025)
93104

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

0 commit comments

Comments
 (0)