QDox
  1. QDox
  2. QDOX-244

Incorrect parsing of composite generic type parameters

    Details

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

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

        Fixed in rev.1557
        And again thanks for the test!
        Same story as QDOX-243: watch out for changed/removed signatures

        Show
        Robert Scholte added a comment - Fixed in rev.1557 And again thanks for the test! Same story as QDOX-243 : watch out for changed/removed signatures
        Robert Scholte made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0 [ 15636 ]
        Resolution Fixed [ 1 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: