-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Milestone
Description
I encountered problem same to #935, but it also affects 2.8.3, and related to collection properties deserialization.
Here reproducing test case, and it fails:
public class JacksonBugReproduction {
private static class Foo {
@JsonProperty(access = READ_ONLY)
private List<Long> list = new ArrayList<>();
List<Long> getList() {
return list;
}
public Foo setList(List<Long> list) {
this.list = list;
return this;
}
}
@Test
public void shouldNotDeserializeList() throws Exception {
String payload = "{\"list\":[1,2,3,4]}";
ObjectMapper mapper = new ObjectMapper();
Foo foo = mapper.readValue(payload, Foo.class);
Assert.assertTrue("List should be empty", foo.getList().isEmpty());
}
}
Full project project available here .
Metadata
Metadata
Assignees
Labels
No labels