Bug 19344 - Add Javadoc comment broken
Summary: Add Javadoc comment broken
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 major (vote)
Target Milestone: 2.0 F3   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-05 11:21 EDT by Dani Megert CLA
Modified: 2002-06-13 08:44 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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