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

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

@odrotbohm

Description

@odrotbohm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions