Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

Calls to Executable.getParameters() should guard against MalformedParametersException #33

Closed
odrotbohm opened this issue Apr 1, 2016 · 1 comment
Milestone

Comments

@odrotbohm
Copy link

getParameters() is documented to throw MalformedParametersException in case there's something wrong with the parameter name declarations in the byte code. This is basically equivalent to not being able to lookup the names and thus I think ParameterNamesAnnotationIntrospector.findParameterName(…) should just return null.

I ran into this scenario with the Eclipse compiler generating some private static methods for lambda expressions, that didn't generate parameter names correctly, while the Maven compiler does correctly. As the MalformedParametersException is not handled by the introspector, my Jackson unmarshalling fails completely where it could just have ignored the method it failed to resolve the parameters for.

I am currently working around this issue by registering another module that checks for these special methods in an AnnotationIntrospector.hasIgnoreMarker(…) and look for the special method names the compiler uses.

@lpandzic
Copy link
Contributor

lpandzic commented Apr 1, 2016

Hello Oliver,
thank you for reporting this issue with a detailed description.
I've submitted a pull request to fix it.

Also, this is a duplicate of #16 where there was some discussion about handling this in jackson-databind, but now I think it is rather simple to handle in parameter names module itself. @cowtowncoder, what do you think?

@cowtowncoder cowtowncoder modified the milestones: 2.7.3, 2.7.4 Apr 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants