[ 
https://issues.apache.org/jira/browse/CAMEL-10396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15873345#comment-15873345
 ] 

ASF GitHub Bot commented on CAMEL-10396:
----------------------------------------

GitHub user aldettinger opened a pull request:

    https://github.com/apache/camel/pull/1477

    CAMEL-10396: Corrected a bug where BeanInfo was missing a method overload

    Actually the `toString(String)` overload was confused by `BeanInfo` to be 
an override of `toString(Object).`
    Now both methods are available to the overload selection mechanism.
    Could you please have a look at this PR ?
    
      Note that I may have discovered another issue in the overload selection 
mechanism where I can't select `toString(Object).` I need to qualify that a bit 
more and may open another ticket if needed.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aldettinger/camel master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/1477.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1477
    
----
commit 89e1946a3194229334ddc4393075844ca3e6990c
Author: aldettinger <[email protected]>
Date:   2017-02-18T15:27:31Z

    CAMEL-10396: Corrected a bug where BeanInfo was missing a method overload

commit 12164b2a4b9a30d1270cf51f771ea169d4084808
Author: aldettinger <[email protected]>
Date:   2017-02-18T15:28:55Z

    CAMEL-10396: Corrected a bug where BeanInfo was missing a method overload

commit d5d8a2604cce22d3bc6c1dac5f63e141fd8815b8
Author: aldettinger <[email protected]>
Date:   2017-02-18T22:02:28Z

    Removed useless code

----


> Can't use parameter type to select among overloaded methods
> -----------------------------------------------------------
>
>                 Key: CAMEL-10396
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10396
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.18.0
>         Environment: Ubuntu 14.04
>            Reporter: Alex Dettinger
>            Priority: Minor
>         Attachments: MethodOverloadCamelTest.java
>
>
> I've noticed that the overload selection mechanism based on parameter types 
> is not working when some parameters are assignable, in the sense of 
> Class.isAssignableFrom(...).
> Given those methods:
> {code:borderStyle=solid}
> String toString(String input)
> String toString(int input)
> {code}
> We can select both methods via bean:toString(String) or bean:toString(int)
> But given those methods:
> {code:borderStyle=solid}
> String toString(String input)
> String toString(Object input)
> {code}
> bean:toString(String) end in selecting toString(Object).
> Ideally, I would expect it to select toString(String). Otherwise, unwinding 
> an AmbiguousCallException may perhaps apply.
> Thoughts:
> I'm wondering whether ObjectHelper.isOverridingMethod(...) would be mixing 
> overload vs override.
> Will attach a test case.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to