Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 213608 Details for
Bug 372801
[formatter] 'Never join wrapped lines' inconsistent behavior, breaking other rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Changes in tests - fist approach
tests01.patch (text/plain), 13.35 KB, created by
Mateusz Matela
on 2012-04-04 17:45:28 EDT
(
hide
)
Description:
Changes in tests - fist approach
Filename:
MIME Type:
Creator:
Mateusz Matela
Created:
2012-04-04 17:45:28 EDT
Size:
13.35 KB
patch
obsolete
>diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java >index 029f794..88c174f 100644 >--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java >+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java >@@ -1243,8 +1243,7 @@ > "public class Test {\n" + > "\n" + > " String foo(boolean enabled) {\n" + >- " if (enabled)\n" + >- " {\n" + >+ " if (enabled) {\n" + > " // we need x\n" + > " // we need a select\n" + > " return \"select x \"\n" + >@@ -1274,8 +1273,7 @@ > "public class Test {\n" + > "\n" + > " String foo(boolean enabled) {\n" + >- " if (enabled)\n" + >- " {\n" + >+ " if (enabled) {\n" + > " // we need x\n" + > " // we need a select\n" + > " return \"select x \"\n" + >@@ -1370,6 +1368,7 @@ > // see also bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=287462 > public void testBug198074_dup201022() throws JavaModelException { > this.formatterPrefs.join_wrapped_lines = false; >+ this.formatterPrefs.alignment_for_assignment = Alignment.M_COMPACT_SPLIT; > String source = > "public class Test {\n" + > "\n" + >@@ -1886,6 +1885,8 @@ > */ > public void testBug281655() throws JavaModelException { > this.formatterPrefs.join_wrapped_lines = false; >+ this.formatterPrefs.alignment_for_arguments_in_annotation = Alignment.M_COMPACT_SPLIT; >+ this.formatterPrefs.insert_new_line_after_opening_brace_in_array_initializer = true; > String source = > "@MessageDriven(mappedName = \"filiality/SchedulerMQService\", \n" + > " activationConfig = { \n" + >@@ -1900,8 +1901,8 @@ > formatSource(source, > "@MessageDriven(mappedName = \"filiality/SchedulerMQService\",\n" + > " activationConfig = {\n" + >- " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" + >- " propertyValue = \"0/10 * * * * ?\")\n" + >+ " @ActivationConfigProperty(propertyName = \"cronTrigger\",\n" + >+ " propertyValue = \"0/10 * * * * ?\")\n" + > " })\n" + > "@RunAs(\"admin\")\n" + > "@ResourceAdapter(\"quartz-ra.rar\")\n" + >@@ -2612,6 +2613,9 @@ > */ > public void testBug286601() throws JavaModelException { > this.formatterPrefs.join_wrapped_lines = false; >+ this.formatterPrefs.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE; >+ this.formatterPrefs.brace_position_for_anonymous_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE; >+ this.formatterPrefs.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE; > String source = > "public class Test\n" + > "{\n" + >@@ -2679,6 +2683,8 @@ > public void testBug286601c() { > this.formatterPrefs.join_wrapped_lines = false; > this.formatterPrefs.brace_position_for_anonymous_type_declaration= DefaultCodeFormatterConstants.NEXT_LINE; >+ this.formatterPrefs.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE; >+ this.formatterPrefs.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE; > String source = > "public class Test\n" + > "{\n" + >@@ -2712,6 +2718,8 @@ > } > public void testBug286601d() { > this.formatterPrefs.join_wrapped_lines = false; >+ this.formatterPrefs.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE; >+ this.formatterPrefs.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE; > this.formatterPrefs.brace_position_for_anonymous_type_declaration= DefaultCodeFormatterConstants.NEXT_LINE; > String source = > "public class Test\n" + >@@ -2875,8 +2883,7 @@ > formatSource(source, > "package massive;\n" + > "\n" + >- "public class X03\n" + >- "{\n" + >+ "public class X03 {\n" + > "\n" + > " public void foo() throws NullPointerException {\n" + > "\n" + >@@ -7110,6 +7117,8 @@ > */ > public void testBug317039_njl() { > this.formatterPrefs.join_wrapped_lines = false; >+ this.formatterPrefs.brace_position_for_type_declaration = DefaultCodeFormatterConstants.NEXT_LINE; >+ this.formatterPrefs.brace_position_for_method_declaration = DefaultCodeFormatterConstants.NEXT_LINE; > String source = > "public class X01\n" + > " {\n" + >@@ -7754,9 +7763,7 @@ > "public class X02 {\n" + > " public void testMethod(String currentTokenVal,\n" + > " int[][] expectedTokenSequencesVal,\n" + >- " String[] tokenImageVal\n" + >- " )\n" + >- " {\n" + >+ " String[] tokenImageVal) {\n" + > " }\n" + > "}\n" > ); >@@ -8006,6 +8013,8 @@ > } > public void testBug330313_wksp1_07_njl() { > this.formatterPrefs.join_wrapped_lines = false; >+ this.formatterPrefs.insert_new_line_after_opening_brace_in_array_initializer = true; >+ this.formatterPrefs.insert_new_line_before_closing_brace_in_array_initializer = true; > String source = > "package wksp1;\n" + > "\n" + >@@ -8025,10 +8034,10 @@ > "public class X07 {\n" + > "\n" + > " static final long[] jjtoToken = {\n" + >- " 0x7fbfecffL,\n" + >+ " 0x7fbfecffL,\n" + > " };\n" + > " static final long[] jjtoSkip = {\n" + >- " 0x400000L,\n" + >+ " 0x400000L,\n" + > " };\n" + > "\n" + > "}\n" >@@ -8036,6 +8045,8 @@ > } > public void testBug330313_wksp1_07_njl_bnl() { > this.formatterPrefs.join_wrapped_lines = false; >+ this.formatterPrefs.insert_new_line_after_opening_brace_in_array_initializer = true; >+ this.formatterPrefs.insert_new_line_before_closing_brace_in_array_initializer = true; > setUpBracesPreferences(DefaultCodeFormatterConstants.NEXT_LINE); > String source = > "package wksp1;\n" + >@@ -8058,11 +8069,11 @@ > "\n" + > " static final long[] jjtoToken =\n" + > " {\n" + >- " 0x7fbfecffL,\n" + >+ " 0x7fbfecffL,\n" + > " };\n" + > " static final long[] jjtoSkip =\n" + > " {\n" + >- " 0x400000L,\n" + >+ " 0x400000L,\n" + > " };\n" + > "\n" + > "}\n" >@@ -8070,6 +8081,7 @@ > } > public void testBug330313_wksp1_08_njl() { > this.formatterPrefs.join_wrapped_lines = false; >+ this.formatterPrefs.alignment_for_assignment = Alignment.M_COMPACT_SPLIT; > String source = > "package wksp1;\n" + > "\n" + >@@ -8095,6 +8107,8 @@ > // testCompare1159_1: org.eclipse.debug.internal.ui.DebugUIPropertiesAdapterFactory > public void testBug330313_wksp1_09_njl() { > this.formatterPrefs.join_wrapped_lines = false; >+ this.formatterPrefs.insert_new_line_after_opening_brace_in_array_initializer = true; >+ this.formatterPrefs.insert_new_line_before_closing_brace_in_array_initializer = true; > String source = > "package wksp1;\n" + > "\n" + >@@ -8111,7 +8125,7 @@ > "public class X09 {\n" + > " public Class[] getAdapterList() {\n" + > " return new Class[] {\n" + >- " IWorkbenchAdapter.class\n" + >+ " IWorkbenchAdapter.class\n" + > " };\n" + > " }\n" + > "}\n" >@@ -8120,6 +8134,7 @@ > // testCompare1723_1: org.eclipse.jdt.internal.compiler.ast.DoubleLiteral > public void testBug330313_wksp1_10_njl() { > this.formatterPrefs.join_wrapped_lines = false; >+ this.formatterPrefs.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE; > String source = > "package wksp1;\n" + > "\n" + >@@ -8170,13 +8185,12 @@ > "\n" + > "public class X11 {\n" + > " X11() {\n" + >- " accessFlags &= ~(\n" + >- " AccStrictfp\n" + >- " | AccProtected\n" + >- " | AccPrivate\n" + >- " | AccStatic\n" + >- " | AccSynchronized\n" + >- " | AccNative);\n" + >+ " accessFlags &= ~(AccStrictfp\n" + >+ " | AccProtected\n" + >+ " | AccPrivate\n" + >+ " | AccStatic\n" + >+ " | AccSynchronized\n" + >+ " | AccNative);\n" + > " }\n" + > "}\n" > ); >@@ -8642,6 +8656,7 @@ > // Test case extracted from org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java > public void testBug330313_wksp1_20_njl() { > this.formatterPrefs.join_wrapped_lines = false; >+ this.formatterPrefs.alignment_for_assignment = Alignment.M_COMPACT_SPLIT; > String source = > "package wksp1;\n" + > "\n" + >@@ -9066,8 +9081,7 @@ > " void foo() {\n" + > " if (inMetaTag &&\n" + > " (t1.image.equalsIgnoreCase(\"name\") ||\n" + >- " t1.image.equalsIgnoreCase(\"HTTP-EQUIV\")\n" + >- " )\n" + >+ " t1.image.equalsIgnoreCase(\"HTTP-EQUIV\"))\n" + > " && t2 != null)\n" + > " {\n" + > " currentMetaTag = t2.image.toLowerCase();\n" + >@@ -9206,6 +9220,9 @@ > // Test case extracted from differences noticed with patch v33.txt > public void testBug330313_wksp1_38_njl() { > this.formatterPrefs.join_wrapped_lines = false; >+ this.formatterPrefs.brace_position_for_block = DefaultCodeFormatterConstants.NEXT_LINE; >+ this.formatterPrefs.keep_else_statement_on_same_line = false; >+ this.formatterPrefs.insert_new_line_before_else_in_if_statement = true; > String source = > "package wksp1;\n" + > "\n" + >@@ -9285,8 +9302,7 @@ > " /* INACTIVE */{ \"INACTIVE\", \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\" },\n" + > " /* PARTLY_ACTIVE */{ \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\",\n" + > " \"PARTLY_ACTIVE\" },\n" + >- " /* ACTIVE */{ \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\", \"ACTIVE\" }\n" + >- " };\n" + >+ " /* ACTIVE */{ \"PARTLY_ACTIVE\", \"PARTLY_ACTIVE\", \"ACTIVE\" } };\n" + > "}\n" > ); > } >@@ -9499,6 +9515,8 @@ > } > public void testBug330313_wksp1_46_njl() { > this.formatterPrefs.join_wrapped_lines = false; >+ this.formatterPrefs.insert_new_line_after_opening_brace_in_array_initializer = true; >+ this.formatterPrefs.insert_new_line_before_closing_brace_in_array_initializer = true; > String source = > "package wksp1;\n" + > "\n" + >@@ -9522,11 +9540,10 @@ > " void foo() {\n" + > " if (getActive() == StackPresentation.AS_ACTIVE_NOFOCUS) {\n" + > " drawGradient(\n" + >- " colorRegistry\n" + >- " .get(IWorkbenchThemeConstants.INACTIVE_TAB_TEXT_COLOR),\n" + >+ " colorRegistry.get(IWorkbenchThemeConstants.INACTIVE_TAB_TEXT_COLOR),\n" + > " new Color[] {\n" + >- " colorRegistry\n" + >- " .get(IWorkbenchThemeConstants.INACTIVE_TAB_BG_START)\n" + >+ " colorRegistry\n" + >+ " .get(IWorkbenchThemeConstants.INACTIVE_TAB_BG_START)\n" + > " },\n" + > " new int[0],\n" + > " true);\n" + >@@ -9656,6 +9673,8 @@ > } > public void testBug330313_wksp1_50_njl() { > this.formatterPrefs.join_wrapped_lines = false; >+ this.formatterPrefs.insert_new_line_after_opening_brace_in_array_initializer = true; >+ this.formatterPrefs.insert_new_line_before_closing_brace_in_array_initializer = true; > String source = > "package wksp1;\n" + > "\n" + >@@ -9687,15 +9706,15 @@ > " // Deploy CodeSnippet class (only once)\n" + > " requestor.acceptClassFiles(\n" + > " new ClassFile[] {\n" + >- " new ClassFile() {\n" + >- " public byte[] getBytes() {\n" + >- " return getCodeSnippetBytes();\n" + >- " }\n" + >+ " new ClassFile() {\n" + >+ " public byte[] getBytes() {\n" + >+ " return getCodeSnippetBytes();\n" + >+ " }\n" + > "\n" + >- " public char[][] getCompoundName() {\n" + >- " return EvaluationConstants.ROOT_COMPOUND_NAME;\n" + >+ " public char[][] getCompoundName() {\n" + >+ " return EvaluationConstants.ROOT_COMPOUND_NAME;\n" + >+ " }\n" + > " }\n" + >- " }\n" + > " },\n" + > " null);\n" + > " }\n" + >@@ -9947,8 +9966,7 @@ > " .equals(remote));\n" + > " }\n" + > " }\n" + >- " }\n" + >- " }),\n" + >+ " } })\n" + > " // Conflicts where the file type is binary will work but are not\n" + > " // merged\n" + > " // so they should be skipped\n" + >@@ -10032,8 +10050,7 @@ > " { 104, 20 },\n" + > " { 108, 21 },\n" + > " { 12, 1856 },\n" + >- " { 13, 1920 } },\n" + >- " };\n" + >+ " { 13, 1920 } }, };\n" + > "}\n" > ); > } >@@ -10167,7 +10184,7 @@ > " WRITE_POTENTIAL,\n" + > " WRITE_POTENTIAL,\n" + > " UNKNOWN },\n" + >- " /* UNKNOWN */{ UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN }\n" + >+ " /* UNKNOWN */{ UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN } };\n" + > // Should be slip but that has been broken since 3.4.2 (i.e. 3.3.2 is OK) > // " /* UNKNOWN */{\n" + > // " UNKNOWN,\n" + >@@ -10176,7 +10193,6 @@ > // " UNKNOWN,\n" + > // " UNKNOWN,\n" + > // " UNKNOWN }\n" + >- " };\n" + > "\n" + > "}\n" > ); >@@ -10221,8 +10237,7 @@ > " \"READ_POTENTIAL\",\n" + > " \"UNKNOWN\",\n" + > " \"UNKNOWN\",\n" + >- " \"UNKNOWN\" },\n" + >- " };\n" + >+ " \"UNKNOWN\" }, };\n" + > "\n" + > "}\n" > ); >@@ -10269,8 +10284,7 @@ > " \"READ_POTENTIAL\",\n" + > " \"UNKNOWN\",\n" + > " \"UNKNOWN\",\n" + >- " \"UNKNOWN\" },\n" + >- " };\n" + >+ " \"UNKNOWN\" }, };\n" + > "\n" + > "}\n" > ); >@@ -10310,8 +10324,7 @@ > " \"1234567890123456789012345678901234567890\" },\n" + > " /* Comment 3 */{\n" + > " \"ABCDEFGHIJKLMNOPQRSTUVWXYZ______________\",\n" + >- " \"ABCDEFGHIJKLMNOPQRSTUVWXYZ______________\" },\n" + >- " };\n" + >+ " \"ABCDEFGHIJKLMNOPQRSTUVWXYZ______________\" }, };\n" + > "\n" + > "}\n" > );
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 372801
:
211765
|
212440
| 213608