Bug 19344

Summary: Add Javadoc comment broken
Product: [Eclipse Project] JDT Reporter: Dani Megert <daniel_megert>
Component: UIAssignee: Dani Megert <daniel_megert>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: paul.raby
Version: 2.0   
Target Milestone: 2.0 F3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Dani Megert CLA 2002-06-05 11:21:22 EDT
Build F2

1. add JUnit to fresh workspace
2. open SuiteTest in J Editor
3. in the Outline view select method testOneTestCase()
4. select "Add Javadoc Comment" from context menu==> two bugs:
1) There is a line between the method and the Javadoc
2) The selection is wrong
Comment 1 Erich Gamma CLA 2002-06-07 13:37:58 EDT
need to investigate
Comment 2 Martin Aeschlimann CLA 2002-06-08 07:17:31 EDT
fixed reveal problem > 20020607, reviewed by EG

empty line comes from the code formatter
move to JCore
Comment 3 Philipe Mulet CLA 2002-06-09 12:49:54 EDT
Pls investigate
Comment 4 Olivier Thomann CLA 2002-06-10 13:00:41 EDT
The problem comes from the 
method:
org.eclipse.jdt.internal.corext.codemanipulation.StubUtility.codeFormat:

Replace 
it with the following code and the empty line disappears.

[public static String 
codeFormat(String sourceString, int initialIndentationLevel, String lineDelim) 
{
ICodeFormatter formatter= ToolFactory.createDefaultCodeFormatter(null);
return 
formatter.format(sourceString, initialIndentationLevel, null, lineDelim);
}]
The 
code formatter is not loosing anymore the last line delimiter, but this method always adds a line 
delimiter. Therefore we ended up with an extra blank line. (See bug 12159 for further details 
about this line delimiter at the end of the formatted source).
Comment 5 Dani Megert CLA 2002-06-12 04:47:26 EDT
Fix available in builds > 20020611
Reviewed by Dirk Bäumer
Comment 6 Dirk Baeumer CLA 2002-06-13 08:44:41 EDT
Verified on F3