Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.12
-
Fix Version/s: 2.0
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
Simple test:
public void testFieldWithWildcardType() { JavaDocBuilder javaDocBuilder = new JavaDocBuilder(); StringBuilder b = new StringBuilder("package test;\n"); b.append("import java.util.ArrayList;\n"); b.append("import java.util.Map;\n"); b.append("public class TestClass<E>{\n"); b.append("public ArrayList<? extends Map<String, E>> list;\n}"); javaDocBuilder.addSource(new StringReader(b.toString())); JavaClass javaClass = javaDocBuilder.getClasses()[0]; JavaField field = javaClass.getFields()[0]; assertNotNull(field.getType().getActualTypeArguments()[0].getActualTypeArguments()); assertEquals("? extends java.util.Map<java.lang.String,E>", field.getType().getActualTypeArguments()[0].getGenericValue()); }
Seems, type arguments lost in com.thoughtworks.qdox.parser.structs.WildcardTypeDef.
I add this row
this.actualArgumentTypes = typeDef.actualArgumentTypes;
to constructor and it's work for me.
Activity
Robert Scholte
made changes -
Field | Original Value | New Value |
---|---|---|
Status | Open [ 1 ] | Closed [ 6 ] |
Assignee | Robert Scholte [ rfscholte ] | |
Fix Version/s | 2.0 [ 15636 ] | |
Resolution | Fixed [ 1 ] |
Issue confirmed. QDox-2.0 has faced a huge refactoring, so I had to rewrite the test.
The suggested fix won't work anymore, but with this test I have enough info to fix the issue.