Skip to content

Commit ea28d49

Browse files
committed
Fix #2038 (or rather add a test; real fix in jackson-core)
1 parent bfeb1fa commit ea28d49

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.fasterxml.jackson</groupId>
77
<artifactId>jackson-base</artifactId>
8-
<version>2.9.5</version>
8+
<version>2.9.6-SNAPSHOT</version>
99
</parent>
1010

1111
<groupId>com.fasterxml.jackson.core</groupId>

src/test/java/com/fasterxml/jackson/databind/TestJDKSerialization.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,19 @@ public void testObjectMapper() throws IOException
167167
final String EXP_JSON = "{\"x\":2,\"y\":3}";
168168
final MyPojo p = new MyPojo(2, 3);
169169
assertEquals(EXP_JSON, MAPPER.writeValueAsString(p));
170+
assertNotNull(MAPPER.getFactory());
171+
assertNotNull(MAPPER.getFactory().getCodec());
170172

171173
byte[] bytes = jdkSerialize(MAPPER);
172174
ObjectMapper mapper2 = jdkDeserialize(bytes);
173175
assertEquals(EXP_JSON, mapper2.writeValueAsString(p));
174176
MyPojo p2 = mapper2.readValue(EXP_JSON, MyPojo.class);
175177
assertEquals(p.x, p2.x);
176178
assertEquals(p.y, p2.y);
179+
180+
// [databind#2038]: verify that codec is not lost
181+
assertNotNull(mapper2.getFactory());
182+
assertNotNull(mapper2.getFactory().getCodec());
177183
}
178184

179185
public void testTypeFactory() throws Exception

0 commit comments

Comments
 (0)