QDox
  1. QDox
  2. QDOX-214

returns is null for Constructors, which makes several methods fail.

    Details

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

      Description

      Here is a test case, tested against the current trunk.

      public void testToString(){
      JavaDocBuilder javaDocBuilder = new JavaDocBuilder();
      javaDocBuilder.addSource(new StringReader("class A{ public A(){}}"));
      JavaClass a = javaDocBuilder.getClassByName("A");
      JavaMethod[] methods = a.getMethods();
      System.out.println(methods[0]);
      }

      toString is one of the methods that depends on returns not being null.

        Activity

        Hide
        Robert Scholte added a comment -

        Fixed in rev. 737

        Show
        Robert Scholte added a comment - Fixed in rev. 737
        Robert Scholte made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Robert Scholte [ rfscholte ]
        Fix Version/s 2.0 [ 15636 ]
        Resolution Fixed [ 1 ]
        Hide
        Stefan Ackermann added a comment -

        That was not everything that breaks. Here is another test case:

        public void testMethodsOnConstructor(){
        JavaDocBuilder javaDocBuilder = new JavaDocBuilder();
        javaDocBuilder.addSource(new StringReader("class A{ public A(testB.B b){}}"));
        JavaClass a = javaDocBuilder.getClassByName("A");
        JavaMethod[] methods = a.getMethods();
        JavaMethod jm = methods[0];
        System.out.println(jm);
        jm.getReturnType();
        jm.getParameterTypes();
        }

        The two last calls still fail with NPE's. Of course, getReturnType on a constructor does not make total sense...

        Show
        Stefan Ackermann added a comment - That was not everything that breaks. Here is another test case: public void testMethodsOnConstructor(){ JavaDocBuilder javaDocBuilder = new JavaDocBuilder(); javaDocBuilder.addSource(new StringReader("class A{ public A(testB.B b){}}")); JavaClass a = javaDocBuilder.getClassByName("A"); JavaMethod[] methods = a.getMethods(); JavaMethod jm = methods [0] ; System.out.println(jm); jm.getReturnType(); jm.getParameterTypes(); } The two last calls still fail with NPE's. Of course, getReturnType on a constructor does not make total sense...
        Stefan Ackermann made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Robert Scholte added a comment -

        Additional fix in rev. 738

        Show
        Robert Scholte added a comment - Additional fix in rev. 738
        Robert Scholte made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Robert Scholte made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Robert Scholte added a comment -

        Fixed in rev.1531 for QDox-1.12.1 patch release

        Show
        Robert Scholte added a comment - Fixed in rev.1531 for QDox-1.12.1 patch release
        Robert Scholte made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Fix Version/s 1.12.1 [ 18944 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Robert Scholte
            Reporter:
            Stefan Ackermann
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: