From b204f3d52cedb91392f7d175102158bd3c611363 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Tue, 6 May 2025 17:47:48 -0700 Subject: [PATCH 1/8] [maven-release-plugin] prepare for next development iteration --- avro/pom.xml | 2 +- cbor/pom.xml | 2 +- ion/pom.xml | 2 +- pom.xml | 6 +++--- protobuf/pom.xml | 2 +- smile/pom.xml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/avro/pom.xml b/avro/pom.xml index c03b0b2bb..ced811763 100644 --- a/avro/pom.xml +++ b/avro/pom.xml @@ -9,7 +9,7 @@ com.fasterxml.jackson.dataformat jackson-dataformats-binary - 2.18.4 + 2.18.5-SNAPSHOT jackson-dataformat-avro Jackson dataformat: Avro diff --git a/cbor/pom.xml b/cbor/pom.xml index 20e998b77..165bc9a92 100644 --- a/cbor/pom.xml +++ b/cbor/pom.xml @@ -9,7 +9,7 @@ com.fasterxml.jackson.dataformat jackson-dataformats-binary - 2.18.4 + 2.18.5-SNAPSHOT jackson-dataformat-cbor Jackson dataformat: CBOR diff --git a/ion/pom.xml b/ion/pom.xml index 1ac8b13a3..c0227302b 100644 --- a/ion/pom.xml +++ b/ion/pom.xml @@ -9,7 +9,7 @@ com.fasterxml.jackson.dataformat jackson-dataformats-binary - 2.18.4 + 2.18.5-SNAPSHOT com.fasterxml.jackson.dataformat jackson-dataformat-ion diff --git a/pom.xml b/pom.xml index 93274d90b..3f914e085 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ com.fasterxml.jackson.dataformat jackson-dataformats-binary Jackson dataformats: Binary - 2.18.4 + 2.18.5-SNAPSHOT pom Parent pom for Jackson binary dataformats. @@ -35,7 +35,7 @@ scm:git:git@github.com:FasterXML/jackson-dataformats-binary.git scm:git:git@github.com:FasterXML/jackson-dataformats-binary.git https://github.com/FasterXML/jackson-dataformats-binary - jackson-dataformats-binary-2.18.4 + HEAD https://github.com/FasterXML/jackson-dataformats-binary/issues @@ -45,7 +45,7 @@ UTF-8 - 2025-05-07T00:47:07Z + 2025-05-07T00:47:48Z + + - sonatype-nexus-snapshots - Sonatype Nexus Snapshots - https://oss.sonatype.org/content/repositories/snapshots + central-snapshots + Sonatype Central Portal (snapshots) + https://central.sonatype.com/repository/maven-snapshots false true From acc862aec989e60ce0fbf000a33812de95a947b2 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Thu, 23 Oct 2025 15:13:08 -0700 Subject: [PATCH 5/8] Update ion-java from 1.11.10 to 1.11.11 (#623) --- ion/pom.xml | 2 +- .../jackson/dataformat/ion/IonNumberOverflowTest.java | 4 +++- release-notes/VERSION-2.x | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ion/pom.xml b/ion/pom.xml index c0227302b..207cf888a 100644 --- a/ion/pom.xml +++ b/ion/pom.xml @@ -39,7 +39,7 @@ tree model) com.amazon.ion ion-java - 1.11.10 + 1.11.11 diff --git a/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/IonNumberOverflowTest.java b/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/IonNumberOverflowTest.java index 8793d3c41..2185c41e1 100644 --- a/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/IonNumberOverflowTest.java +++ b/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/IonNumberOverflowTest.java @@ -81,7 +81,9 @@ public void testLongAsBigIntegerSize() throws Exception { BigInteger bigIntLongValue = new BigInteger(Long.MAX_VALUE + "").subtract(BigInteger.TEN); IonParser bigIntLongParser = (IonParser) new IonFactory().createParser(bigIntLongValue.toString()); assertEquals(JsonToken.VALUE_NUMBER_INT, bigIntLongParser.nextToken()); - assertEquals(JsonParser.NumberType.BIG_INTEGER, bigIntLongParser.getNumberType()); + // 23-Oct-2025: Ion 1.11.11+ changed behavior: values that fit in long are now + // classified as LONG (was BIG_INTEGER before) + assertEquals(JsonParser.NumberType.LONG, bigIntLongParser.getNumberType()); assertEquals(JsonParser.NumberTypeFP.UNKNOWN, bigIntLongParser.getNumberTypeFP()); assertEquals(bigIntLongValue.longValue(), bigIntLongParser.getLongValue()); } diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index e9db9c84b..ce60b6419 100644 --- a/release-notes/VERSION-2.x +++ b/release-notes/VERSION-2.x @@ -14,6 +14,11 @@ Active maintainers: === Releases === ------------------------------------------------------------------------ +2.18.5 (not yet released) + +#623: (ion) Upgrade `ion-java` dep to 1.11.11 (from 1.11.10) + (requested by @Shaurya0108) + 2.18.4 (06-May-2025) #569: (ion) `IonParser` fails to parse some `long` values saying From 3c7875af054e5b519a8d53da85b239129f9e07d8 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Mon, 27 Oct 2025 09:22:53 -0700 Subject: [PATCH 6/8] Fix #599: handle skipping of CBOR string refs (#627) --- .../jackson/dataformat/cbor/CBORParser.java | 19 ++++++++ .../dataformat/cbor/StringRef599Test.java | 44 +++++++++++++++++++ release-notes/VERSION-2.x | 2 + 3 files changed, 65 insertions(+) create mode 100644 cbor/src/test/java/com/fasterxml/jackson/dataformat/cbor/StringRef599Test.java diff --git a/cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java b/cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java index 52f1d3514..e0e40415b 100644 --- a/cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java +++ b/cbor/src/main/java/com/fasterxml/jackson/dataformat/cbor/CBORParser.java @@ -3199,6 +3199,25 @@ protected void _skipIncomplete() throws IOException && type != CBORConstants.MAJOR_TYPE_BYTES) { _throwInternal(); } + + // [dataformats-binary#599]: If we are in a stringref namespace, we need to + // actually read and store the string/bytes value instead of just skipping it, + // so that later string references can find it. + // The finish methods will determine if the value should be added to the + // reference table based on shouldReferenceString(). + if (!_stringRefs.empty()) { + if (type == CBORConstants.MAJOR_TYPE_TEXT) { + // Need to actually read the text (which may add to stringRefs) + _finishTextToken(_typeByte); + } else { + // For bytes: decode length then read (which may add to stringRefs) + int len = _decodeExplicitLength(_typeByte & 0x1F); + _finishBytes(len); + } + return; + } + + // Standard skip logic when not in stringref namespace final int lowBits = _typeByte & 0x1F; if (lowBits <= 23) { if (lowBits > 0) { diff --git a/cbor/src/test/java/com/fasterxml/jackson/dataformat/cbor/StringRef599Test.java b/cbor/src/test/java/com/fasterxml/jackson/dataformat/cbor/StringRef599Test.java new file mode 100644 index 000000000..d3cb77ba6 --- /dev/null +++ b/cbor/src/test/java/com/fasterxml/jackson/dataformat/cbor/StringRef599Test.java @@ -0,0 +1,44 @@ +package com.fasterxml.jackson.dataformat.cbor; + +import java.util.Arrays; + +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.ObjectMapper; + +import org.junit.Test; + +public class StringRef599Test extends CBORTestBase +{ + private final ObjectMapper VANILLA_MAPPER = cborMapper(); + private final ObjectMapper REF_MAPPER = cborMapper(cborFactoryBuilder() + .enable(CBORGenerator.Feature.STRINGREF) + .build()); + + // [dataformats-binary#599] + @Test + public void testDupsNoStringRef() throws Exception + { + _testStringRef(VANILLA_MAPPER); + } + + // [dataformats-binary#599] + @Test + public void testDupsWithStringRef() throws Exception + { + _testStringRef(REF_MAPPER); + } + + private void _testStringRef(ObjectMapper mapper) throws Exception + { + byte[] cbor = mapper.writeValueAsBytes(Arrays.asList("foo", "foo")); + try (CBORParser p = cborParser(cbor)) { + assertToken(JsonToken.START_ARRAY, p.nextToken()); + assertToken(JsonToken.VALUE_STRING, p.nextToken()); + // important! Skip String value + assertToken(JsonToken.VALUE_STRING, p.nextToken()); + // equally important; try to check second instance + assertEquals("foo", p.getText()); + assertToken(JsonToken.END_ARRAY, p.nextToken()); + } + } +} diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index ce60b6419..d4cf9e3c5 100644 --- a/release-notes/VERSION-2.x +++ b/release-notes/VERSION-2.x @@ -16,6 +16,8 @@ Active maintainers: 2.18.5 (not yet released) +#599: (cbor) Unable to deserialize stringref-enabled CBOR with ignored properties + (reported by Yohei K) #623: (ion) Upgrade `ion-java` dep to 1.11.11 (from 1.11.10) (requested by @Shaurya0108) From 3d0c9aa224b0138719fffcb7620465e3e694bf4b Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Mon, 27 Oct 2025 19:04:51 -0700 Subject: [PATCH 7/8] Prep for 2.18.5 release --- pom.xml | 2 +- release-notes/VERSION-2.x | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 149d46b8a..55252a3c4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.fasterxml.jackson jackson-base - 2.18.5-SNAPSHOT + 2.18.5 com.fasterxml.jackson.dataformat jackson-dataformats-binary diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index d4cf9e3c5..25572b00e 100644 --- a/release-notes/VERSION-2.x +++ b/release-notes/VERSION-2.x @@ -14,7 +14,7 @@ Active maintainers: === Releases === ------------------------------------------------------------------------ -2.18.5 (not yet released) +2.18.5 (27-Oct-2025) #599: (cbor) Unable to deserialize stringref-enabled CBOR with ignored properties (reported by Yohei K) From 3552edff8f0eb50fc79ca90b19cfe667b0b927f5 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Mon, 27 Oct 2025 19:05:48 -0700 Subject: [PATCH 8/8] [maven-release-plugin] prepare release jackson-dataformats-binary-2.18.5 --- avro/pom.xml | 2 +- cbor/pom.xml | 2 +- ion/pom.xml | 2 +- pom.xml | 6 +++--- protobuf/pom.xml | 2 +- smile/pom.xml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/avro/pom.xml b/avro/pom.xml index ced811763..a52b2af4b 100644 --- a/avro/pom.xml +++ b/avro/pom.xml @@ -9,7 +9,7 @@ com.fasterxml.jackson.dataformat jackson-dataformats-binary - 2.18.5-SNAPSHOT + 2.18.5 jackson-dataformat-avro Jackson dataformat: Avro diff --git a/cbor/pom.xml b/cbor/pom.xml index 165bc9a92..87f008c87 100644 --- a/cbor/pom.xml +++ b/cbor/pom.xml @@ -9,7 +9,7 @@ com.fasterxml.jackson.dataformat jackson-dataformats-binary - 2.18.5-SNAPSHOT + 2.18.5 jackson-dataformat-cbor Jackson dataformat: CBOR diff --git a/ion/pom.xml b/ion/pom.xml index 207cf888a..0d18da1b5 100644 --- a/ion/pom.xml +++ b/ion/pom.xml @@ -9,7 +9,7 @@ com.fasterxml.jackson.dataformat jackson-dataformats-binary - 2.18.5-SNAPSHOT + 2.18.5 com.fasterxml.jackson.dataformat jackson-dataformat-ion diff --git a/pom.xml b/pom.xml index 55252a3c4..3ae2a0590 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ com.fasterxml.jackson.dataformat jackson-dataformats-binary Jackson dataformats: Binary - 2.18.5-SNAPSHOT + 2.18.5 pom Parent pom for Jackson binary dataformats. @@ -35,7 +35,7 @@ scm:git:git@github.com:FasterXML/jackson-dataformats-binary.git scm:git:git@github.com:FasterXML/jackson-dataformats-binary.git https://github.com/FasterXML/jackson-dataformats-binary - HEAD + jackson-dataformats-binary-2.18.5 https://github.com/FasterXML/jackson-dataformats-binary/issues @@ -45,7 +45,7 @@ UTF-8 - 2025-05-07T00:47:48Z + 2025-10-28T02:05:13Z