|
From: | Artur Biesiadowski |
Subject: | Re: finding method efficiently |
Date: | Tue, 28 Sep 2004 23:18:38 +0200 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 |
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=HEADchooseMethod(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
[Prev in Thread] | Current Thread | [Next in Thread] |