Details
Description
QDox doesn't seem to correctly parse composite generic type parameters. 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 testReadsGenericTypeParameters() { final String sourceCode = "" + "package foo;\n" + "public static class DummyOne {\n" + " public static <T extends Number & Iterable<Integer>> T genericTypeParam(T x) { 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.getTypeParameters()[0].toGenericString(); assertEquals("<T extends java.lang.Number & java.lang.Iterable<java.lang.Integer>>", result); } }
Activity
Robert Scholte
made changes -
Field | Original Value | New Value |
---|---|---|
Assignee | Robert Scholte [ rfscholte ] |
Robert Scholte
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Fix Version/s | 2.0 [ 15636 ] | |
Resolution | Fixed [ 1 ] |
Fixed in rev.1557
And again thanks for the test!
Same story as
QDOX-243: watch out for changed/removed signatures