[ 
http://jira.codehaus.org/browse/QDOX-201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=216075#action_216075
 ] 

Robert Scholte commented on QDOX-201:
-------------------------------------

Confirm and reopened.
I wrote only unittests for the JavaMethod-part. I´ve written the failing 
JavaClass test, but it´s a bit more complicated. I´ve seen infinitive loops, so 
I need to restructure some parts.


> 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
>            Assignee: Robert Scholte
>             Fix For: 1.11
>
>         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