Skip to content

Commit 4f3c662

Browse files
committed
Additional configuration to closer match Jackson 2 behavior
1 parent 90519b5 commit 4f3c662

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/main/java/tools/jackson/core/TSFBuilder.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,10 @@ public B configure(StreamWriteFeature f, boolean state) {
201201
* </p>
202202
*/
203203
public B configureForJackson2() {
204-
return disable(StreamReadFeature.USE_FAST_DOUBLE_PARSER)
205-
.disable(StreamReadFeature.USE_FAST_BIG_NUMBER_PARSER);
204+
return enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION)
205+
.disable(StreamReadFeature.USE_FAST_DOUBLE_PARSER)
206+
.disable(StreamReadFeature.USE_FAST_BIG_NUMBER_PARSER)
207+
.enable(TokenStreamFactory.Feature.INTERN_PROPERTY_NAMES);
206208
}
207209

208210
// // // Other configuration, constraints

src/main/java/tools/jackson/core/json/JsonFactoryBuilder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import tools.jackson.core.base.DecorableTSFactory.DecorableTSFBuilder;
55
import tools.jackson.core.io.CharacterEscapes;
66
import tools.jackson.core.io.SerializedString;
7+
import tools.jackson.core.util.JsonRecyclerPools;
78

89
/**
910
* {@link tools.jackson.core.TSFBuilder}
@@ -120,7 +121,8 @@ public JsonFactoryBuilder configure(JsonWriteFeature f, boolean state) {
120121
public JsonFactoryBuilder configureForJackson2() {
121122
return super.configureForJackson2()
122123
.disable(JsonWriteFeature.ESCAPE_FORWARD_SLASHES)
123-
.disable(JsonWriteFeature.COMBINE_UNICODE_SURROGATES_IN_UTF8);
124+
.disable(JsonWriteFeature.COMBINE_UNICODE_SURROGATES_IN_UTF8)
125+
.recyclerPool(JsonRecyclerPools.threadLocalPool());
124126
}
125127

126128
// // // Other JSON-specific configuration

0 commit comments

Comments
 (0)