Community
Participate
Working Groups
private long time;
static {
// TESTS_NUMBERS = new int[] { 667 };
// TESTS_NUMBERS = new int[] { 668 };
// TESTS_RANGE = new int[] { 658, -1 };
}
public static Test suite() {
JavaCore.setOptions(javaCoreOptions);
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=169934
public void test668() {
final Map options = DefaultCodeFormatterConstants.getEclipseDefaultSettings();
DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
preferences.comment_format_block_comment = true;
preferences.insert_space_after_opening_paren_in_constructor_declaration = true;
preferences.insert_space_before_closing_paren_in_constructor_declaration = true;
preferences.insert_space_after_opening_paren_in_method_declaration = true;
preferences.insert_space_before_closing_paren_in_method_declaration = true;
preferences.insert_space_after_opening_paren_in_method_invocation = true;
preferences.insert_space_before_closing_paren_in_method_invocation = true;
DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences);
runTest(codeFormatter, "test668", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
public class FormatTest {
public double test( int a, int /**/b/**/ ) {
return a + /**/b/**/ * 2;
/**/public/**/ void foo() {
public /**/void/**/ bar() {
/**/public/**/ /**/void/**/ baz() {
/*
* A normal block comment.
*/
if (this.pendingSpace) {
this.addInsertEdit(currentTokenStartPosition, " "); //$NON-NLS-1$
else if (this.needSpace && currentTokenStartPosition > 0 && this.scanner.source[ currentTokenStartPosition - 1 ] == ' ') {
this.needSpace = false;
final boolean neededSpace = this.needSpace;
this.pendingSpace = false;
this.scanner.currentPosition = nextCharacterStart;
this.lastNumberOfNewLines = 0;
needSpace = false;
this.needSpace = neededSpace;
this.scanner.resetTo(currentTokenEndPosition, this.scannerEndPosition - 1);
if (isJavadoc) {
printNewLine();