On 10/06/2010 14:42, John Wu wrote:
> 
> Hi Mark,
> 
> The fix of "to derive the type directly from the value which ..." sounds not
> a solution. In a slightly more complex scenario, the fix still fails.
> 
> Say the method signature is "public * theMethod(TheSupperType o)" and
> calling the method in EL like
> "#{theClassInstance.theMethod(theDerivedTypeInstance)}", where the supper
> type can be a supper class or an interface, your fix fails.

super has one p, not two.

I looked at the current code and the spec again. There is no need for
any of this complexity. The exact types are defined when the method
expression is created. I'm not sure why I was trying to derive them at
invocation time when they were already available.

I have added a test case, modified the implementation and checked the
new code with the EL TCK and all looks to be OK.

Mark

> 
> Example project attached.
> 
> 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, AMBIGUOUS
> 
> 
> John Wu
> http://old.nabble.com/file/p28843317/jsf-2.0-el-2.2.testcase-v2.zip
> jsf-2.0-el-2.2.testcase-v2.zip 




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

Reply via email to