Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 1.12
-
Fix Version/s: None
-
Component/s: Parser
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
QDox doesn't seem to correctly parse a methods parameters when resolving nested generic types. The following failing unit test should illustrate the issue:
QDoxTest.java
import com.thoughtworks.qdox.JavaDocBuilder; import com.thoughtworks.qdox.model.JavaClass; import com.thoughtworks.qdox.model.JavaMethod; public class QDoxTest extends junit.framework.TestCase { final JavaDocBuilder builder = new JavaDocBuilder(); public void testReadsGenerifiedParameterTypes() { final String sourceCode = "" + "package foo;\n" + "public static class DummyOne {\n" + " public static String withGenerifiedParam(java.util.Collection<? extends Comparable<String>> things) { return null; }\n" + "}\n"; builder.addSource(new java.io.StringReader(sourceCode)); JavaClass qDoxClass = builder.getClassByName("foo.DummyOne"); JavaMethod qDoxMethod = qDoxClass.getMethods()[0]; String result = qDoxMethod.getParameterTypes(true)[0].getGenericValue(); assertEquals("java.util.Collection<? extends java.lang.Comparable<java.lang.String>>", result); } }
Activity
Robert Scholte
made changes -
Field | Original Value | New Value |
---|---|---|
Assignee | Robert Scholte [ rfscholte ] |
Robert Scholte
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Cannot Reproduce [ 5 ] |
Robert Scholte
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Cannot reproduce with current trunk.
I've added a test in rev.1559