[jboss-dev-forums] [JBoss Microcontainer Development] - Adding vargargs parameters to getXXXDeclaredXXX methods at J
flavia.rainone@jboss.com
do-not-reply at jboss.com
Thu Aug 27 15:48:23 EDT 2009
This post is related to issue JBREFLECT-53.
As result of implementing JBREFLECT-53, I noticed that MutableClassInfo now has two similar getDeclaredMethod methods:
| MutableMethodInfo getDeclaredMethod(String name, TypeInfo... parameters);
| MutableMethodInfo getDeclaredMethod(String name, String... parameters)
|
Now, if I try to call getDeclaredMethod with one parameter like the piece of code below:
MutableClassInfo mci = ....
| mci.getDeclaredMethod("bar");
I get the error:
The method getDeclaredMethod(String, TypeInfo[]) is ambiguous for the type MutableClassInfo
So, this forces us to use getDeclaredMethod with a minimum of two parameters, taking away some of the advantage of having a signature with vargars:
mci.getDeclaredMethod("bar", new TypeInfo[0]);
Would it be all right if I added a third method to MutableClassInfo (see below), so I can get rid of the problem?
MutableMethodInfo getDeclaredMethod(String name)
My main concern is whether there could be other classes outside of JBoss Reflection project implementing MutableClassInfo interface.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4252133#4252133
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4252133
More information about the jboss-dev-forums
mailing list