QDox
  1. QDox
  2. QDOX-154

JavaMethod#getComment() is parsed with an implicit order

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: None
    • Fix Version/s: 1.10
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      1

      Issue Links

        Activity

        Hide
        Vincent Siveton added a comment -

        Here is a small sample:

            /**
             * A Javadoc sample.
             *
             * @return The size.
             */
            public long getSize()
            {
                return 0;
            }
        
            /**
             * @return The size.
             *
             * A Javadoc sample.
             */
            public long getSize2()
            {
                return 0;
            }
        

        The javaMethod.getComment() is empty for getSize2() and should be equal to "A Javadoc sample."
        If it is a known limitation, the API should reflect this limitation.

        I attached a test case which displays the following.

        Looking the class: test.TestQDOX154
        Looking the method: getSize
        javaMethod.getComment()=A Javadoc sample.
        javaMethod.getTagByName( "return" )=The size.
        Looking the method: getSize2
        javaMethod.getComment()=
        javaMethod.getTagByName( "return" )=The size.
        
        A Javadoc sample.
        
        Show
        Vincent Siveton added a comment - Here is a small sample: /** * A Javadoc sample. * * @return The size. */ public long getSize() { return 0; } /** * @return The size. * * A Javadoc sample. */ public long getSize2() { return 0; } The javaMethod.getComment() is empty for getSize2() and should be equal to "A Javadoc sample." If it is a known limitation, the API should reflect this limitation. I attached a test case which displays the following. Looking the class: test.TestQDOX154 Looking the method: getSize javaMethod.getComment()=A Javadoc sample. javaMethod.getTagByName( "return" )=The size. Looking the method: getSize2 javaMethod.getComment()= javaMethod.getTagByName( "return" )=The size. A Javadoc sample.
        Vincent Siveton made changes -
        Field Original Value New Value
        Attachment TestQDOX154.java [ 40761 ]
        Hide
        Robert Scholte added a comment -

        test added, but succeeds right now. Good chance it's already solved by another issue (rev. 611)

        Show
        Robert Scholte added a comment - test added, but succeeds right now. Good chance it's already solved by another issue (rev. 611)
        Robert Scholte made changes -
        Fix Version/s 1.10 [ 15020 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Cannot Reproduce [ 5 ]
        Assignee Robert Scholte [ rfscholte ]
        Hide
        Robert Scholte added a comment -

        test was invalid, issue needs another review

        Show
        Robert Scholte added a comment - test was invalid, issue needs another review
        Robert Scholte made changes -
        Resolution Cannot Reproduce [ 5 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Robert Scholte made changes -
        Link This issue depends upon QDOX-168 [ QDOX-168 ]
        Hide
        Robert Scholte added a comment -

        qdox-168 will contain a new parsing stategy for javadoc comments which should make this issue easier to solve

        Show
        Robert Scholte added a comment - qdox-168 will contain a new parsing stategy for javadoc comments which should make this issue easier to solve
        Hide
        Robert Scholte added a comment -

        I've been thinking: what to do if there's a description above AND below a tag? Only one place to find the answer:http://java.sun.com/j2se/javadoc/writingdoccomments/#format
        According to this, the current behaviour is correct.
        But some data will get lost this way. So I'm not yet sure what to do. An option could be to add an extra method which will return the complete block unparsed.
        But I don't really like this, so maybe we should consider this as a "won't resolve".

        Show
        Robert Scholte added a comment - I've been thinking: what to do if there's a description above AND below a tag? Only one place to find the answer: http://java.sun.com/j2se/javadoc/writingdoccomments/#format According to this, the current behaviour is correct. But some data will get lost this way. So I'm not yet sure what to do. An option could be to add an extra method which will return the complete block unparsed. But I don't really like this, so maybe we should consider this as a "won't resolve".
        Hide
        Vincent Siveton added a comment -

        Robert, according the doc, my understanding is the same than you: the behaviour is correct.
        I propose that you add some documentation with this pointer and close this issue as you proposed.

        For the record, here is the javadoc tool test:

            /**
             * @return The size.
             *
             * A Javadoc sample.
             */
            public long getSize2()
            {
                return 0;
            }
        

        Here is the generated Javadoc by the Javadoc tool:

        <a name="getSize2()"><!-- --></a><h3>
        getSize2</h3>
        <pre>public long <b>getSize2</b>()</pre>
        <dl>
        <dd><dl>
        </dl>
        </dd>
        
        <dd><dl>
        
        <dt><b>Returns:</b></dt><dd>The size.
        
         A Javadoc sample.</dd></dl>
        </dd>
        </dl>
        
        Show
        Vincent Siveton added a comment - Robert, according the doc, my understanding is the same than you: the behaviour is correct. I propose that you add some documentation with this pointer and close this issue as you proposed. For the record, here is the javadoc tool test: /** * @return The size. * * A Javadoc sample. */ public long getSize2() { return 0; } Here is the generated Javadoc by the Javadoc tool: <a name="getSize2()"><!-- --></a><h3> getSize2</h3> <pre>public long <b>getSize2</b>()</pre> <dl> <dd><dl> </dl> </dd> <dd><dl> <dt><b>Returns:</b></dt><dd>The size. A Javadoc sample.</dd></dl> </dd> </dl>
        Hide
        Robert Scholte added a comment -

        Closing issue because behaviour follows javadoc specs. I added the test with proper expecting values to prefend other behaviour in the future.

        Show
        Robert Scholte added a comment - Closing issue because behaviour follows javadoc specs. I added the test with proper expecting values to prefend other behaviour in the future.
        Robert Scholte made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Not A Bug [ 6 ]

          People

          • Assignee:
            Robert Scholte
            Reporter:
            Vincent Siveton
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: