QDox
  1. QDox
  2. QDOX-245

Incorrect parsing of resolved method parameter types

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.12
    • Fix Version/s: None
    • Component/s: Parser
    • Labels:
      None
    • Testcase included:
      yes
    • Number of attachments :
      0

      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 ]
        Hide
        Robert Scholte added a comment -

        Cannot reproduce with current trunk.
        I've added a test in rev.1559

        Show
        Robert Scholte added a comment - Cannot reproduce with current trunk. I've added a test in rev.1559
        Robert Scholte made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Cannot Reproduce [ 5 ]
        Robert Scholte made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Robert Scholte
            Reporter:
            Tom Denley
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: