Archie Cobbs wrote:


I have come across this same challenge several times now, i.e.,
having to write code that implements the Java "best match" semantics
for method invocation using reflection. Usually I end up doing something
that works in all the 'easy' cases and punt on the rest.
[...]
So it would be nice if we could write this algorithm once and for all
and make it public somewhere :-)


Maybe
http://cvs.groovy.codehaus.org/viewrep/groovy/groovy-core/src/main/groovy/lang/MetaClass.java?r=HEAD
chooseMethod(String methodName, List methods, Class[] arguments, boolean coerce)
?


I don't know sure good it is in practice, but it seems to cover most cases including wrapped primitives.

Artur


_______________________________________________ Classpath mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/classpath

Reply via email to