On 29/06/2010 22:32, Mark Thomas wrote:
On 21/06/2010 15:16, John Wu wrote:

Hi Mark,

I just got a chance to test it on the Beta release. It's still broken,
with
a slightly different exception message.

Confirmed. I'm pretty sure JSF is doing the right thing here and that I
need to read the spec more carefully. I'll post an update when I have a
fix.

It looks like we are going to have to go with your original proposal. I was trying to avoid the complexity it adds but I can't see a way around it.

There is minor tweak to your suggested algorithm I intend making:

My suggestion as to the solution of resolving which method to call:
. Retrieve all methods of *theClassInstance*, and put them into the
CANDIDATES collection;

// Search a match by method name
. For each method in CANDIDATES,
. if the name is not *theMethod*, remove it from CANDIDATES
. If CANDIDATES is empty, then NOT-FOUND;
. else if only one is left, then FOUND;

// Search a match by params count
. else, count the number of actual params,
. For each method in CANDIDATES,
. if the number of formal params does not match that of actual params,
remove it from CANDIDATES
. // Optoional, handle cases of "method has variable number of
arguments"
. If CANDIDATES is empty, then NOT-FOUND;
. else if only one is left, then FOUND;

// Search a match by param types
. else, evaluate all actual params;
. For each method in CANDIDATES,
. if NOT( for-each formalParamType.isAssignableFrom(actualParamType)
),
remove it from CANDIDATES
. // Optoional, handle cases of "method has variable number of
arguments"
. If CANDIDATES is empty, then NOT-FOUND;
. else if only one is left, then FOUND;

else if exactly one CANDIDATE has more formal parameters that exactly match the types of the actual parameters than all other CANDIDATES, then FOUND;

. else, AMBIGUOUS

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to