Index: src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java =================================================================== retrieving revision 1.52 diff -u -r1.52 FormatterRegressionTests.java --- src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java 8 Dec 2003 15:55:07 -0000 1.52 +++ src/org/eclipse/jdt/core/tests/formatter/FormatterRegressionTests.java 28 Dec 2003 02:15:45 -0000 @@ -4476,4 +4476,48 @@ DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences); runTest(codeFormatter, "test393", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$ } + + /** + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351 + */ + public void test394() { + Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings(); + DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); + preferences.use_tab = true; + preferences.page_width = 40; + preferences.block_brace_position = DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP; + DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences); + runTest(codeFormatter, "test394", "If.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$ + runTest(codeFormatter, "test394", "For.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$ + runTest(codeFormatter, "test394", "While.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$ + } + + /** + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351 + */ + public void test395() { + Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings(); + DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); + preferences.use_tab = true; + preferences.page_width = 40; + preferences.type_declaration_brace_position = DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP; + DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences); + runTest(codeFormatter, "test395", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$ + runTest(codeFormatter, "test395", "C.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$ + runTest(codeFormatter, "test395", "I.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$ + runTest(codeFormatter, "test395", "Inner.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$ + } + + /** + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=49351 + */ + public void test396() { + Map options = DefaultCodeFormatterConstants.getJavaConventionsSettings(); + DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); + preferences.use_tab = true; + preferences.page_width = 40; + preferences.method_declaration_brace_position = DefaultCodeFormatterConstants.NEXT_LINE_ON_WRAP; + DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences); + runTest(codeFormatter, "test396", "A.java", CodeFormatter.K_COMPILATION_UNIT);//$NON-NLS-1$ //$NON-NLS-2$ + } } Index: workspace/Formatter/test394/For_in.java =================================================================== RCS file: workspace/Formatter/test394/For_in.java diff -N workspace/Formatter/test394/For_in.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test394/For_in.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,14 @@ +class Example { + public void f() { + for (;;) { + i = 1; + } + for (; 1 == 2 && 2 == i++; i++) { + i = 1; + } + // a comment + for (;;) { + i = 1; + } + } +} Index: workspace/Formatter/test394/For_out.java =================================================================== RCS file: workspace/Formatter/test394/For_out.java diff -N workspace/Formatter/test394/For_out.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test394/For_out.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,15 @@ +class Example { + public void f() { + for (; ; ) { + i = 1; + } + for (; 1 == 2 && 2 == i++; i++) + { + i = 1; + } + // a comment + for (; ; ) { + i = 1; + } + } +} Index: workspace/Formatter/test394/If_in.java =================================================================== RCS file: workspace/Formatter/test394/If_in.java diff -N workspace/Formatter/test394/If_in.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test394/If_in.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,22 @@ +class Example { + public void f() { + if (1 == 2 && 2 == 3) { + i = 1; + } + if (1 == 2 && 2 == 3 && 2 == 3) { + i = 1; + } + if (1 == 2 && 2 == 3 && 2 == 3 && 2 == 3) + { + i = 1; + } + if (1 == 2 && 2 == 3 && 2 == 3 + && 2 == 3) { + i = 1; + } + /* a comment */ + if (1 == 2) { + i = 2; + } + } +} Index: workspace/Formatter/test394/If_out.java =================================================================== RCS file: workspace/Formatter/test394/If_out.java diff -N workspace/Formatter/test394/If_out.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test394/If_out.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,25 @@ +class Example { + public void f() { + if (1 == 2 && 2 == 3) { + i = 1; + } + if (1 == 2 && 2 == 3 && 2 == 3) + { + i = 1; + } + if (1 == 2 && 2 == 3 && 2 == 3 + && 2 == 3) + { + i = 1; + } + if (1 == 2 && 2 == 3 && 2 == 3 + && 2 == 3) + { + i = 1; + } + /* a comment */ + if (1 == 2) { + i = 2; + } + } +} Index: workspace/Formatter/test394/While_in.java =================================================================== RCS file: workspace/Formatter/test394/While_in.java diff -N workspace/Formatter/test394/While_in.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test394/While_in.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,14 @@ +class Example { + public void f() { + while (true) { + i = 1; + } + while (1 == 2 && 2 == i++ + 11) { + i = 1; + } + // a comment + while (true) { + i = 1; + } + } +} Index: workspace/Formatter/test394/While_out.java =================================================================== RCS file: workspace/Formatter/test394/While_out.java diff -N workspace/Formatter/test394/While_out.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test394/While_out.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,15 @@ +class Example { + public void f() { + while (true) { + i = 1; + } + while (1 == 2 && 2 == i++ + 11) + { + i = 1; + } + // a comment + while (true) { + i = 1; + } + } +} Index: workspace/Formatter/test395/A_in.java =================================================================== RCS file: workspace/Formatter/test395/A_in.java diff -N workspace/Formatter/test395/A_in.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test395/A_in.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,6 @@ +package test; +/** + * A comment + */ +class Example { +} Index: workspace/Formatter/test395/A_out.java =================================================================== RCS file: workspace/Formatter/test395/A_out.java diff -N workspace/Formatter/test395/A_out.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test395/A_out.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,7 @@ +package test; + +/** + * A comment + */ +class Example { +} Index: workspace/Formatter/test395/C_in.java =================================================================== RCS file: workspace/Formatter/test395/C_in.java diff -N workspace/Formatter/test395/C_in.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test395/C_in.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,2 @@ +class Example extends Aaaaaaaaaaaaaaaaaaaa { +} Index: workspace/Formatter/test395/C_out.java =================================================================== RCS file: workspace/Formatter/test395/C_out.java diff -N workspace/Formatter/test395/C_out.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test395/C_out.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,4 @@ +class Example extends + Aaaaaaaaaaaaaaaaaaaa +{ +} Index: workspace/Formatter/test395/I_in.java =================================================================== RCS file: workspace/Formatter/test395/I_in.java diff -N workspace/Formatter/test395/I_in.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test395/I_in.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,2 @@ +interface Example extends Aaaaaaaaaaaaa { +} Index: workspace/Formatter/test395/I_out.java =================================================================== RCS file: workspace/Formatter/test395/I_out.java diff -N workspace/Formatter/test395/I_out.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test395/I_out.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,3 @@ +interface Example extends Aaaaaaaaaaaaa +{ +} Index: workspace/Formatter/test395/Inner_in.java =================================================================== RCS file: workspace/Formatter/test395/Inner_in.java diff -N workspace/Formatter/test395/Inner_in.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test395/Inner_in.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,8 @@ +class Example { + class Inner { + } + class Innerrrrrrrrrrrrrrrrrrrrrrrrr { + } + class Innerrrrrrrrrrrrrrrrrrrrrrrrrrrr { + } +} Index: workspace/Formatter/test395/Inner_out.java =================================================================== RCS file: workspace/Formatter/test395/Inner_out.java diff -N workspace/Formatter/test395/Inner_out.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test395/Inner_out.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,12 @@ +class Example { + class Inner { + } + + class Innerrrrrrrrrrrrrrrrrrrrrrrrr + { + } + + class Innerrrrrrrrrrrrrrrrrrrrrrrrrrrr + { + } +} Index: workspace/Formatter/test396/A_in.java =================================================================== RCS file: workspace/Formatter/test396/A_in.java diff -N workspace/Formatter/test396/A_in.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test396/A_in.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,15 @@ +class Example { + public void test() throws Aaaaaa, Bbbbbbb { + } + void test2(int a, int b, int c, int d) { + } + /* simple comment */ + void comm() { + } + /** javadoc */ + void conn() { + } + // modifiers + private void mod() { + } +} Index: workspace/Formatter/test396/A_out.java =================================================================== RCS file: workspace/Formatter/test396/A_out.java diff -N workspace/Formatter/test396/A_out.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ workspace/Formatter/test396/A_out.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,23 @@ +class Example { + public void test() throws Aaaaaa, + Bbbbbbb + { + } + + void test2(int a, int b, int c, + int d) + { + } + + /* simple comment */ + void comm() { + } + + /** javadoc */ + void conn() { + } + + // modifiers + private void mod() { + } +}