View | Details | Raw Unified | Return to bug 298243
Collapse All | Expand All

(-)formatter/org/eclipse/jdt/internal/formatter/Scribe.java (-1 / +1 lines)
Lines 2263-2269 Link Here
2263
									preserveEmptyLines(lines - 1, whitespacesStartPosition);
2263
									preserveEmptyLines(lines - 1, whitespacesStartPosition);
2264
								}
2264
								}
2265
								addDeleteEdit(whitespacesStartPosition, whitespacesEndPosition);
2265
								addDeleteEdit(whitespacesStartPosition, whitespacesEndPosition);
2266
							} else if (lines != 0 && (!this.formatter.preferences.join_wrapped_lines || this.formatter.preferences.number_of_empty_lines_to_preserve != 0)) {
2266
							} else if (lines != 0 && (!this.formatter.preferences.join_wrapped_lines || this.formatter.preferences.number_of_empty_lines_to_preserve != 0 || this.blank_lines_between_import_groups > 0)) {
2267
								addReplaceEdit(whitespacesStartPosition, whitespacesEndPosition, getPreserveEmptyLines(lines-1));
2267
								addReplaceEdit(whitespacesStartPosition, whitespacesEndPosition, getPreserveEmptyLines(lines-1));
2268
							} else {
2268
							} else {
2269
								addDeleteEdit(whitespacesStartPosition, whitespacesEndPosition);
2269
								addDeleteEdit(whitespacesStartPosition, whitespacesEndPosition);
(-)src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java (+23 lines)
Lines 3576-3579 Link Here
3576
		"}\n"
3576
		"}\n"
3577
	);
3577
	);
3578
}
3578
}
3579
3580
/**
3581
 * @bug 298243: [formatter] Removing empty lines between import groups
3582
 * @test Verify that space after the @see tag is not removed while formatting
3583
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=298243"
3584
 */
3585
public void testBug298243() {
3586
	this.formatterPrefs.number_of_empty_lines_to_preserve = 0;
3587
	String source = 
3588
		"package test;\n" + 
3589
		"\n" + 
3590
		"import java.util.concurrent.atomic.AtomicInteger;\n" + 
3591
		"\n" + 
3592
		"import org.xml.sax.SAXException;\n" + 
3593
		"\n" + 
3594
		"public class Test {\n" + 
3595
		"	public static void main(String[] args) {\n" + 
3596
		"		SAXException e;\n" + 
3597
		"		AtomicInteger w;\n" + 
3598
		"	}\n" + 
3599
		"}\n";
3600
	formatSource(source);
3601
}
3579
}
3602
}

Return to bug 298243