-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Milestone
Description
It appears that the default typing in jackson-databind-2.8.11 and jackson-databind-2.9.3 is inconsistent with prior versions. For example, the following test works in 2.9.2 and fails in 2.9.3 and 2.9.4-SNAPSHOT. The test also works in 2.8.10 but fails in 2.8.11
@Test
public void passesWith2dot9dot2AndFailsWith2dot9dot3() throws Exception {
ObjectMapper mapper = new ObjectMapper();
mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
Set<String> theSet = Collections.unmodifiableSet(Collections.singleton("a"));
String actualJson = mapper.writeValueAsString(theSet);
assertEquals("[\"java.util.Collections$UnmodifiableSet\",[\"a\"]]", actualJson);
}
The failure is:
org.junit.ComparisonFailure:
Expected :["java.util.Collections$UnmodifiableSet",["a"]]
Actual :["java.util.HashSet",["a"]]
This issue appears to be related to the build failures in spring-projects/spring-security#4918
Metadata
Metadata
Assignees
Labels
No labels