Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrays.asList() value deserialization has changed from mutable to immutable in 2.13 #3565

Closed
JonasWilms opened this issue Aug 4, 2022 · 2 comments
Milestone

Comments

@JonasWilms
Copy link

During the restructuring of the JavaUtilCollectionsDeserializers (#2900) class the type for Arrays#ArrayList was changed from modifiable to unmodifiable.

This means you can no longer call methods like List#set on the deserialized List.

Since 2.13
https:/FasterXML/jackson-databind/blame/0016185419e35dc903d0098689cb00326500f054/src/main/java/com/fasterxml/jackson/databind/deser/impl/JavaUtilCollectionsDeserializers.java#L86

Before 2.13

@JonasWilms JonasWilms added the to-evaluate Issue that has been received but not yet evaluated label Aug 4, 2022
@cowtowncoder
Copy link
Member

cowtowncoder commented Aug 5, 2022

I think this would be best expressed in form of unit test, showing how mutability changed. Would it be possible to add it here -- even just couple of lines if not full test class.

Should be possible to change back in 2.14.0; looks like check is bit more general right now (anything ending with "List").

@cowtowncoder cowtowncoder added need-test-case To work on issue, a reproduction (ideally unit test) needed 2.14 and removed to-evaluate Issue that has been received but not yet evaluated labels Aug 5, 2022
@cowtowncoder cowtowncoder changed the title Arrays.asList deserialization has changed Arrays.asList() value deserialization has changed from mutable to immutable in 2.13 Aug 5, 2022
@cowtowncoder cowtowncoder added 2.13 and removed need-test-case To work on issue, a reproduction (ideally unit test) needed 2.14 labels Aug 22, 2022
@cowtowncoder cowtowncoder added this to the 2.13.4 milestone Aug 22, 2022
@cowtowncoder
Copy link
Member

Ok, fixed. Due to low risk backported in 2.13 for 2.13.4 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants