Method Resolution incorrect for methods with vararg-parameters
--------------------------------------------------------------

                 Key: QDOX-201
                 URL: http://jira.codehaus.org/browse/QDOX-201
             Project: QDox
          Issue Type: Bug
          Components: Java API
    Affects Versions: 1.10.1
         Environment: Tested with Snapshot of QDox 1.11 from 2010-01-10
            Reporter: Sam Bernet
         Attachments: TestQdoxVarArgsResolution.java

I suspect the method JavaParameter#getType()to give incorrect results for 
vararg-parameters, resulting in JavaClass#getMethodBySignature(String, Type[]) 
failing to correctly lookup existing methods.

getType() seems to just return the base type of a varargs-parameter. IMHO 
opinion the correct behaviour would be to return the corresponding array-type 
with dimension 1.

Example: 
{noformat}
class Test {
  method(String... param) {} // getType() returns Type 'String' instead of 
'String[]'
  method(String param) {}    // getType() returns Type 'String' as well, so 
there's no way to distuingish the two methods
{noformat} 

Result:
{noformat}
getMethodBySignature('method', new Type[] {new Type('String', 1)}) -> returns 
null
getMethodBySignature('method', new Type[] {new Type('String')})    -> returns 
first method
-> no way to retrieve second method at all?!
{noformat}

See attached test-case for a complete illustration of the problem, including a 
working JUnit-Test

Best regards,
Sam Bernet

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to