Community
Participate
Working Groups
When using <right-click> "Source|Add javadoc comment" for a method that is preceeded by // style comments, the javadoc comment is incorrectly placed above the // comment. Sample program: /** * */ public class JavadocTest { private int test = 0; //============================= // a plain comment //============================= public int getTest() { return test; } } Steps to reproduce: Move the cursor into the getTest() method, right click, select Source|Add javadoc comment. Results: the Javadoc comment is placed above the first // comment. Expected: The javadoc comment should be placed between the method and the // comment.
Not critical for 2.1.
JavaCore assigns the comment to the method, even there is a newline inbetween.
Defer
Reopen to close as it's fixed since 3.0
Many improvements have been made during 3.0 development about comments management in JDT/Core (CommentRecorderParser, DefaultCommentMapper classes). I guess that this fixed this problem as now line comments are no longer attached to the method. Functionality Source->Add javadoc commment works now properly since 3.0 in this case and you get following code after using it: public class Test { private int test = 0; //============================= // a plain comment //============================= /** * @return */ public int getTest () { return test; } }