Skip to content

Commit e7ab455

Browse files
committed
Fix #3528
1 parent e88f8ae commit e7ab455

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

release-notes/VERSION-2.x

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ Project: jackson-databind
3636
`@JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = SomeFieldFilter.class)`
3737
(contributed by AmiDavidW@github)
3838
#3497: Deserialization of Throwables with PropertyNamingStrategy does not work
39+
#3528: `TokenBuffer` defaults for parser/stream-read features neither passed
40+
from parser nor use real defaults
3941

4042
2.13.4 (not yet released)
4143

src/main/java/com/fasterxml/jackson/databind/util/TokenBuffer.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,10 @@ public Parser(Segment firstSeg, ObjectCodec codec,
14981498
boolean hasNativeTypeIds, boolean hasNativeObjectIds,
14991499
JsonStreamContext parentContext)
15001500
{
1501-
super(0);
1501+
// 25-Jun-2022, tatu: Ideally would pass parser flags along (as
1502+
// per [databund#3528]) but for now make sure not to clear the flags
1503+
// but let defaults be used
1504+
super();
15021505
_segment = firstSeg;
15031506
_segmentPtr = -1; // not yet read
15041507
_codec = codec;

src/test/java/com/fasterxml/jackson/databind/util/TokenBufferTest.java

+11
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,17 @@ public void testBasicConfig() throws IOException
5252
assertTrue(buf.isClosed());
5353
}
5454

55+
// for [databind#3528]
56+
public void testParserFeatureDefaults() throws IOException
57+
{
58+
TokenBuffer buf = new TokenBuffer(MAPPER, false);
59+
try (JsonParser p = buf.asParser()) {
60+
for (JsonParser.Feature feat : JsonParser.Feature.values()) {
61+
assertEquals("Feature "+feat, feat.enabledByDefault(), p.isEnabled(feat));
62+
}
63+
}
64+
}
65+
5566
/**
5667
* Test writing of individual simple values
5768
*/

0 commit comments

Comments
 (0)