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

NPE for ResolvedRecursiveType in 2.8.0 due to caching #1302

Closed
cowtowncoder opened this issue Jul 16, 2016 · 0 comments
Closed

NPE for ResolvedRecursiveType in 2.8.0 due to caching #1302

cowtowncoder opened this issue Jul 16, 2016 · 0 comments
Milestone

Comments

@cowtowncoder
Copy link
Member

Looks like there is a problem with caching of generic types with self-referential types.
It results in exceptions like:

java.lang.NullPointerException:
at com.fasterxml.jackson.databind.type.ResolvedRecursiveType.equals(ResolvedRecursiveType.java:103)
at com.fasterxml.jackson.databind.type.TypeBindings$AsKey.equals(TypeBindings.java:458)
at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:947)
at com.fasterxml.jackson.databind.util.LRUMap.get(LRUMap.java:68)
at com.fasterxml.jackson.databind.type.TypeFactory._fromClass(TypeFactory.java:1211)
at com.fasterxml.jackson.databind.type.TypeFactory._fromParamType(TypeFactory.java:1384)
at com.fasterxml.jackson.databind.type.TypeFactory._fromAny(TypeFactory.java:1154)
at com.fasterxml.jackson.databind.type.TypeFactory._resolveSuperInterfaces(TypeFactory.java:1298)
at com.fasterxml.jackson.databind.type.TypeFactory._fromClass(TypeFactory.java:1243)
at com.fasterxml.jackson.databind.type.TypeFactory._fromParamType(TypeFactory.java:1384)

due to partially resolved self-reference. Note that this only happens if generic type is of something with self-referencial type parameter.

There are multiple potential ways to solve this; one would be to try to detect existence of ResolvedRecursiveType; another to ensure that ResolvedRecursiveType.equals() can deal with not-yet-referenced state.

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

1 participant