Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions cbor/src/main/java/tools/jackson/dataformat/cbor/CBORParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import java.math.BigInteger;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Stack;

import tools.jackson.core.*;
import tools.jackson.core.base.ParserBase;
Expand Down Expand Up @@ -206,7 +206,7 @@ public void push(boolean hasNamespace) {

public void pop() {
--_nestedDepth;
if (!_stringRefs.empty() && _stringRefs.peek().depth == _nestedDepth) {
if (!_stringRefs.isEmpty() && _stringRefs.peek().depth == _nestedDepth) {
_stringRefs.pop();
}
}
Expand All @@ -216,10 +216,12 @@ public StringRefList peek() {
}

public boolean empty() {
return _stringRefs.empty();
return _stringRefs.isEmpty();
}

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

Expand Down
5 changes: 5 additions & 0 deletions release-notes/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ Juan Farré (@jafarre-bi)
* Reported #700: (cbor, smile) `META-INF/services/tools.jackson.databind.ObjectMapper`
references wrong class name (`...databind.CBORMapper` / `...databind.SmileMapper`)
(3.1.5)

Benoît Mériaux (@benoitmeriaux)

* Reported #742: Use `ArrayDeque` instead of `Stack` in `CBORParser`
(3.1.6)
3 changes: 3 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ No changes since 3.1
actual length to `shouldReferenceString()`
#736: (cbor) Long Object property names added to "stringref" reference table twice
(NOTE: in 3.x this affected the `nextNameMatch()` decoding path as well)
#742: Use `ArrayDeque` instead of `Stack` in `CBORParser`
(reported by Benoît M)
(fix by @cowtowncoder, w/ Claude code)

3.1.5 (07-Jul-2026)

Expand Down
Loading