[jboss-jira] [JBoss JIRA] Created: (JGRP-817) MethodCall: match between formal parameters and actual arguments fails if an argument is a subtype of a parameter
Bela Ban (JIRA)
jira-events at lists.jboss.org
Mon Aug 25 08:26:38 EDT 2008
MethodCall: match between formal parameters and actual arguments fails if an argument is a subtype of a parameter
-----------------------------------------------------------------------------------------------------------------
Key: JGRP-817
URL: https://jira.jboss.org/jira/browse/JGRP-817
Project: JGroups
Issue Type: Bug
Reporter: Bela Ban
Assignee: Bela Ban
Fix For: 2.6.4, 2.7
If we have class Foo with method:
public class Foo {
public void bar(Object a, String b) {}
}
then MethodCall fails if we invoke:
dispatcher.callRemoteMethods(null, "bar", new Object[] {"hello", "world"}, new Class[]{String.class,String.class}, ...);
because the first formal parameter of foo() is an Object and the arg a String, and we do an equals() on the 2 classes.
Solution: use Class.isAssignableFrom(Class)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list