Skip to content

MessagingMethodInvokerHelper should disregard synthetic methods #3912

@chrylis

Description

@chrylis

In what version(s) of Spring Integration are you seeing this issue?

5.5.14

Describe the bug

I have a service object written in Groovy that I'm providing to the handle instruction on a DSL integration flow. This service method has a single public method plus some private fields and closures; the presence of the closures causes the generation of some synthetic methods to access the private fields in the top-level class. The MessagingMethodInvokerHelper throws an exception claiming ambiguous methods because it's processing the synthetics as fallbacks.

To Reproduce

Pass a class that carries synthetic methods to handle.

Expected behavior

I expect synthetic methods to be excluded. Specifically, at MessagingMethodInvokerHelper:776, the existing condition

!Modifier.isPublic(method1.getModifiers())

should be logically equivalent to

Modifier.isSynthetic(method1.getModifiers()) || !Modifier.isPublic(method1.getModifiers())

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions