You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2008/10/13 21:05:52 UTC

[jira] Created: (CAMEL-983) BeanInfo - should consider overridden methods when selecting method from operations list

BeanInfo - should consider overridden methods when selecting method from operations list
----------------------------------------------------------------------------------------

                 Key: CAMEL-983
                 URL: https://issues.apache.org/activemq/browse/CAMEL-983
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 1.4.0
            Reporter: Claus Ibsen


See nabble:
http://www.nabble.com/BeanInfo.chooseMethodWithMatchingBody-throws-an-AmbiguousMethodCallException-when-there%27s-no-ambiguity-td19959124s22882.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (CAMEL-983) BeanInfo - should consider overridden methods when selecting method from operations list

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reopened CAMEL-983:
-------------------------------


The last commit failed camel-spring and some unit tests. Reverted the fix until I get this working as well.

> BeanInfo - should consider overridden methods when selecting method from operations list
> ----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-983
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-983
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.0
>
>         Attachments: CAMEL-983.patch
>
>
> See nabble:
> http://www.nabble.com/BeanInfo.chooseMethodWithMatchingBody-throws-an-AmbiguousMethodCallException-when-there%27s-no-ambiguity-td19959124s22882.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-983) BeanInfo - should consider overridden methods when selecting method from operations list

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-983?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46448#action_46448 ] 

Claus Ibsen commented on CAMEL-983:
-----------------------------------

Working on a better patch.

> BeanInfo - should consider overridden methods when selecting method from operations list
> ----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-983
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-983
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Claus Ibsen
>         Attachments: CAMEL-983.patch
>
>
> See nabble:
> http://www.nabble.com/BeanInfo.chooseMethodWithMatchingBody-throws-an-AmbiguousMethodCallException-when-there%27s-no-ambiguity-td19959124s22882.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-983) BeanInfo - should consider overridden methods when selecting method from operations list

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-983:
------------------------------

    Attachment: CAMEL-983.patch

A patch with a solution.

I would like review of this patch. 
PS: The methods should be named override*s*ExistingMethod (a s is missing)

> BeanInfo - should consider overridden methods when selecting method from operations list
> ----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-983
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-983
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Claus Ibsen
>         Attachments: CAMEL-983.patch
>
>
> See nabble:
> http://www.nabble.com/BeanInfo.chooseMethodWithMatchingBody-throws-an-AmbiguousMethodCallException-when-there%27s-no-ambiguity-td19959124s22882.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CAMEL-983) BeanInfo - should consider overridden methods when selecting method from operations list

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-983.
-------------------------------

    Fix Version/s: 1.5.0
       Resolution: Fixed

Commited a fix. See SVN log (JIRA has such a tab)

> BeanInfo - should consider overridden methods when selecting method from operations list
> ----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-983
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-983
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.0
>
>         Attachments: CAMEL-983.patch
>
>
> See nabble:
> http://www.nabble.com/BeanInfo.chooseMethodWithMatchingBody-throws-an-AmbiguousMethodCallException-when-there%27s-no-ambiguity-td19959124s22882.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-983) BeanInfo - should consider overridden methods when selecting method from operations list

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-983?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46432#action_46432 ] 

Claus Ibsen commented on CAMEL-983:
-----------------------------------

James suggested to use a comparator: create a Set(NameAndParamTypesComparator)

> BeanInfo - should consider overridden methods when selecting method from operations list
> ----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-983
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-983
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Claus Ibsen
>         Attachments: CAMEL-983.patch
>
>
> See nabble:
> http://www.nabble.com/BeanInfo.chooseMethodWithMatchingBody-throws-an-AmbiguousMethodCallException-when-there%27s-no-ambiguity-td19959124s22882.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CAMEL-983) BeanInfo - should consider overridden methods when selecting method from operations list

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-983.
-------------------------------

    Resolution: Fixed

Should be fixed now.

> BeanInfo - should consider overridden methods when selecting method from operations list
> ----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-983
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-983
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.0
>
>         Attachments: CAMEL-983.patch
>
>
> See nabble:
> http://www.nabble.com/BeanInfo.chooseMethodWithMatchingBody-throws-an-AmbiguousMethodCallException-when-there%27s-no-ambiguity-td19959124s22882.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (CAMEL-983) BeanInfo - should consider overridden methods when selecting method from operations list

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-983:
---------------------------------

    Assignee: Claus Ibsen

> BeanInfo - should consider overridden methods when selecting method from operations list
> ----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-983
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-983
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>         Attachments: CAMEL-983.patch
>
>
> See nabble:
> http://www.nabble.com/BeanInfo.chooseMethodWithMatchingBody-throws-an-AmbiguousMethodCallException-when-there%27s-no-ambiguity-td19959124s22882.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-983) BeanInfo - should consider overridden methods when selecting method from operations list

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-983?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46421#action_46421 ] 

Claus Ibsen commented on CAMEL-983:
-----------------------------------

Should be:

   private boolean overrideExistingMethod(MethodInfo methodInfo) {
+        for (MethodInfo info : operationsWithBody) {
+
+            // name test
+            if (!info.getMethod().getName().equals(methodInfo.getMethod().getName())) {
+                continue;
+            }
+
+            // parameter types
+            if (info.getMethod().getParameterTypes().length != methodInfo.getMethod().getParameterTypes().length) {
+                continue;
+            }
+
+            for (int i = 0; i < info.getMethod().getParameterTypes().length; i++) {
+                Class type1 = info.getMethod().getParameterTypes()[i];
+                Class type2 = methodInfo.getMethod().getParameterTypes()[i];
+                if (!type1.equals(type2)) {
+                    continue;
+                }
+            }
+
+            // sanme name, same parameters, then its overrides an existing class
+            return true;
+        }
+
+        return false;
+    }


> BeanInfo - should consider overridden methods when selecting method from operations list
> ----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-983
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-983
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Claus Ibsen
>         Attachments: CAMEL-983.patch
>
>
> See nabble:
> http://www.nabble.com/BeanInfo.chooseMethodWithMatchingBody-throws-an-AmbiguousMethodCallException-when-there%27s-no-ambiguity-td19959124s22882.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Work started: (CAMEL-983) BeanInfo - should consider overridden methods when selecting method from operations list

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on CAMEL-983 started by Claus Ibsen.

> BeanInfo - should consider overridden methods when selecting method from operations list
> ----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-983
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-983
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.0
>
>         Attachments: CAMEL-983.patch
>
>
> See nabble:
> http://www.nabble.com/BeanInfo.chooseMethodWithMatchingBody-throws-an-AmbiguousMethodCallException-when-there%27s-no-ambiguity-td19959124s22882.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-983) BeanInfo - should consider overridden methods when selecting method from operations list

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-983?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46420#action_46420 ] 

Claus Ibsen commented on CAMEL-983:
-----------------------------------

Bruce did a review and the code in the patch should use continue and not return false:

Hi

Ah of course it should be continue ;) I coded it with the laptop on my lap on the couch with the wife grumping why I looked at the computer and not hear. But I wanted quickly to throw in some code for review and suggestions.

I was a bit surprised to not find an API to be able to easier identify if a method is overridden. I have been working with the IDEA API for my generate toString() plugin for 6+ years and they have such a nice API where you can get tons of information about your code.

I would like the change to be tested more thoroughly before we can commit it. So feel free to add more unit tests that test with more methods in the inherited classes, without inheritance etc. We are closing in on 1.5 and I would be sad to break something this late in the game.


> BeanInfo - should consider overridden methods when selecting method from operations list
> ----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-983
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-983
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.4.0
>            Reporter: Claus Ibsen
>         Attachments: CAMEL-983.patch
>
>
> See nabble:
> http://www.nabble.com/BeanInfo.chooseMethodWithMatchingBody-throws-an-AmbiguousMethodCallException-when-there%27s-no-ambiguity-td19959124s22882.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.