Bug 196124 - Comment formatter does not preserve existing line breaks
Summary: Comment formatter does not preserve existing line breaks
Status: VERIFIED DUPLICATE of bug 239130
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M4   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-11 05:29 EDT by Benno Baumgartner CLA
Modified: 2008-12-09 14:07 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benno Baumgartner CLA 2007-07-11 05:29:17 EDT
N20070707-0010

Given:
package test;

public class E01 {

	/**
	 * The foo method.
	 * foo is a substitute for bar.
	 * 
	 * @param param1 The first parameter
	 * @param param2
	 *            The second parameter.
	 *            If <b>null</b>the first parameter is used
	 */
	public void foo(Object param1, Object param2) {
	}

}
1. Use Eclipse [built-in] profile for code formatting
2. Format the code
Is:
package test;

public class E01 {

	/**
	 * The foo method. foo is a substitute for bar.
	 * 
	 * @param param1
	 *            The first parameter
	 * @param param2
	 *            The second parameter. If <b>null</b>the first parameter is
	 *            used
	 */
	public void foo(Object param1, Object param2) {
	}

}
Should:
package test;

public class E01 {

	/**
	 * The foo method. 
         * foo is a substitute for bar.
	 * 
	 * @param param1
	 *            The first parameter
	 * @param param2
	 *            The second parameter. 
         *            If <b>null</b>the first parameter is used
	 */
	public void foo(Object param1, Object param2) {
	}

}
Hint that the line break is preserved in comment block for param2 and comment block above the @param section.
Either:
  If ToolFactory.M_FORMAT_EXISTING do not remove line breaks in comment blocks 
Or:
  Add option 'Wrap on maximum line width' if enabled then behavior as is (default) if disabled then line breaks are untouched in comment blocks.
Comment 1 Jerome Lanneluc CLA 2008-08-27 06:47:45 EDT

*** This bug has been marked as a duplicate of bug 198074 ***
Comment 2 Frederic Fusier CLA 2008-12-03 07:17:36 EST
Reopen to change duplicate bug...
Comment 3 Frederic Fusier CLA 2008-12-03 07:18:22 EST

*** This bug has been marked as a duplicate of bug 239130 ***
Comment 4 Kent Johnson CLA 2008-12-09 14:07:06 EST
Verified for 3.5M4 using I20081209-0100