Skip to content

Commit b9d1677

Browse files
committed
Merge branch '3.2' into 3.x
2 parents bcd3e64 + ea350a0 commit b9d1677

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
import java.math.BigInteger;
88
import java.nio.charset.Charset;
99
import java.nio.charset.StandardCharsets;
10+
import java.util.ArrayDeque;
1011
import java.util.ArrayList;
1112
import java.util.Arrays;
12-
import java.util.Stack;
1313

1414
import tools.jackson.core.*;
1515
import tools.jackson.core.base.ParserBase;
@@ -206,7 +206,7 @@ public void push(boolean hasNamespace) {
206206

207207
public void pop() {
208208
--_nestedDepth;
209-
if (!_stringRefs.empty() && _stringRefs.peek().depth == _nestedDepth) {
209+
if (!_stringRefs.isEmpty() && _stringRefs.peek().depth == _nestedDepth) {
210210
_stringRefs.pop();
211211
}
212212
}
@@ -216,10 +216,12 @@ public StringRefList peek() {
216216
}
217217

218218
public boolean empty() {
219-
return _stringRefs.empty();
219+
return _stringRefs.isEmpty();
220220
}
221221

222-
private Stack<StringRefList> _stringRefs = new Stack<>();
222+
// 28-Jul-2026, tatu: [dataformats-binary#742] Use non-synchronized
223+
// `ArrayDeque` instead of (synchronized) `Stack`
224+
private final ArrayDeque<StringRefList> _stringRefs = new ArrayDeque<>();
223225
private int _nestedDepth = 0;
224226
}
225227

release-notes/CREDITS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,8 @@ Juan Farré (@jafarre-bi)
5050
* Reported #700: (cbor, smile) `META-INF/services/tools.jackson.databind.ObjectMapper`
5151
references wrong class name (`...databind.CBORMapper` / `...databind.SmileMapper`)
5252
(3.1.5)
53+
54+
Benoît Mériaux (@benoitmeriaux)
55+
56+
* Reported #742: Use `ArrayDeque` instead of `Stack` in `CBORParser`
57+
(3.1.6)

release-notes/VERSION

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ No changes since 3.2
3939
#735: (cbor) "stringref" property-name paths pass 5-bit length marker instead of
4040
actual length to `shouldReferenceString()`
4141
#736: (cbor) Long Object property names added to "stringref" reference table twice
42+
#742: Use `ArrayDeque` instead of `Stack` in `CBORParser`
43+
(reported by Benoît M)
44+
(fix by @cowtowncoder, w/ Claude code)
4245

4346
3.2.1 (10-Jul-2026)
4447

@@ -73,6 +76,9 @@ No changes since 3.2.0
7376
actual length to `shouldReferenceString()`
7477
#736: (cbor) Long Object property names added to "stringref" reference table twice
7578
(NOTE: in 3.x this affected the `nextNameMatch()` decoding path as well)
79+
#742: Use `ArrayDeque` instead of `Stack` in `CBORParser`
80+
(reported by Benoît M)
81+
(fix by @cowtowncoder, w/ Claude code)
7682

7783
3.1.5 (07-Jul-2026)
7884

0 commit comments

Comments
 (0)