Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 447890

Summary: [formatter] New blank line added on each formatting attempt after <pre>
Product: [Eclipse Project] JDT Reporter: Mauro Molinari <mauromol>
Component: CoreAssignee: Mateusz Matela <mateusz.matela>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, mateusz.matela
Version: 4.4   
Target Milestone: 4.8 M5   
Hardware: PC   
OS: Windows 7   
Whiteboard: To be verified for 4.8 M5

Description Mauro Molinari CLA 2014-10-20 07:07:22 EDT
Create the following Java class:

package a;

/**
 * Test.
 *
 * <pre>
 * String handler = &quot;test&quot;;
 * </pre>
 */
public class JavaPre {
}

Then, try to format it repeatedly with Ctrl+Shift+F: on each format, a new blank line is added after <pre>. After the first Ctrl+Shift+F:

package a;

/**
 * Test.
 *
 * <pre>
 *
 * String handler = &quot;test&quot;;
 * </pre>
 */
public class JavaPre {
}

After the second Ctrl+Shift+F:

package a;

/**
 * Test.
 *
 * <pre>
 *
 *
 * String handler = &quot;test&quot;;
 * </pre>
 */
public class JavaPre {
}

And so on. It's extremely annoying, since it changes the source on each format attempt. If you have "format all lines" as a Save Action, it's detrimental.

Note: it might be somewhat related to bug #231845.
Comment 1 Mateusz Matela CLA 2018-01-06 20:54:37 EST
This problem no longer occurs after the formatter redesign

*** This bug has been marked as a duplicate of bug 303519 ***