Bug 32089 - [javadoc] Incorrect placement of method comment relative to // comments
Summary: [javadoc] Incorrect placement of method comment relative to // comments
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-17 19:45 EST by Ian Jefferies CLA
Modified: 2005-08-05 04:33 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Jefferies CLA 2003-02-17 19:45:49 EST
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.
Comment 1 Dirk Baeumer CLA 2003-02-18 06:57:05 EST
Not critical for 2.1. 
Comment 2 Martin Aeschlimann CLA 2003-02-18 10:18:14 EST
JavaCore assigns the comment to the method, even there is a newline inbetween.
Comment 3 Philipe Mulet CLA 2003-02-18 10:53:56 EST
Defer
Comment 4 Frederic Fusier CLA 2005-08-05 04:27:12 EDT
Reopen to close as it's fixed since 3.0
Comment 5 Frederic Fusier CLA 2005-08-05 04:33:37 EDT
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;
	}


}