jackson-databind icon indicating copy to clipboard operation
jackson-databind copied to clipboard

Try to catch, ignore `TypeNotPresentException` in `POJOPropertiesCollector._addCreators()`

Open leventov opened this issue 8 years ago • 1 comments

When Jackson scans a class for JSON creators among static methods, it may encounter parameter types that are not present in classpath. In this case we get TypeNotPresentException. Instead of failing, I think Jackson should catch this exception somewhere on this chain:

com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector._addCreators(POJOPropertiesCollector.java:423)
com.fasterxml.jackson.databind.introspect.AnnotatedWithParams.getParameter(AnnotatedWithParams.java:118)
com.fasterxml.jackson.databind.introspect.AnnotatedMethod.getGenericParameterType(AnnotatedMethod.java:206)

And assume that this method is NOT a JSON creator (maybe issuing a warning).

We get this with Jackson 2.6, but it looks like the issue is still present in the master.

leventov avatar Aug 04 '17 12:08 leventov