Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java')
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java602
1 files changed, 301 insertions, 301 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java
index fc6e52bb5d..eeae9ffec3 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java
@@ -35,13 +35,13 @@ public void test001() {
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
runNegativeTest(
// test directory preparation
- true /* flush output directory */,
+ true /* flush output directory */,
new String[] { /* test files */
"A.java",
- "public class A {\n" +
- " void foo() {\n" +
- " System.out.println(\"a\");\n" +
- " } //$NON-NLS-1$ \n" +
+ "public class A {\n" +
+ " void foo() {\n" +
+ " System.out.println(\"a\");\n" +
+ " } //$NON-NLS-1$ \n" +
"}"
},
// compiler options
@@ -49,18 +49,18 @@ public void test001() {
customOptions /* custom options */,
// compiler results
"----------\n" + /* expected compiler log */
- "1. ERROR in A.java (at line 3)\n" +
- " System.out.println(\"a\");\n" +
- " ^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "2. ERROR in A.java (at line 4)\n" +
- " } //$NON-NLS-1$ \n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
+ "1. ERROR in A.java (at line 3)\n" +
+ " System.out.println(\"a\");\n" +
+ " ^^^\n" +
+ "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
+ "----------\n" +
+ "2. ERROR in A.java (at line 4)\n" +
+ " } //$NON-NLS-1$ \n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
"----------\n",
// javac options
- JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
+ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
}
public void test002() {
@@ -68,7 +68,7 @@ public void test002() {
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
runNegativeTest(
// test directory preparation
- true /* flush output directory */,
+ true /* flush output directory */,
new String[] { /* test files */
"X.java",
"class X {\n" +
@@ -90,43 +90,43 @@ public void test002() {
customOptions /* custom options */,
// compiler results
"----------\n" + /* expected compiler log */
- "1. ERROR in X.java (at line 2)\n" +
- " String s = null; //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " String s3 = \"\"; //$NON-NLS-1$//$NON-NLS-2$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 7)\n" +
- " String s4 = null; //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 9)\n" +
- " String s6 = \"\"; //$NON-NLS-2$//$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "5. ERROR in X.java (at line 10)\n" +
- " System.out.println(\"foo\");//$NON-NLS-1$//$NON-NLS-2$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "6. ERROR in X.java (at line 11)\n" +
- " } //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "7. ERROR in X.java (at line 13)\n" +
- " }//$NON-NLS-3$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " String s = null; //$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " String s3 = \"\"; //$NON-NLS-1$//$NON-NLS-2$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 7)\n" +
+ " String s4 = null; //$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 9)\n" +
+ " String s6 = \"\"; //$NON-NLS-2$//$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "5. ERROR in X.java (at line 10)\n" +
+ " System.out.println(\"foo\");//$NON-NLS-1$//$NON-NLS-2$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "6. ERROR in X.java (at line 11)\n" +
+ " } //$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "7. ERROR in X.java (at line 13)\n" +
+ " }//$NON-NLS-3$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
"----------\n",
// javac options
- JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
+ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
}
public void test003() {
Map customOptions = getCompilerOptions();
@@ -134,27 +134,27 @@ public void test003() {
this.runNegativeTest(
new String[] {
"p/Foo.java",
- "package p;\n" +
- "public class Foo { \n" +
- " public void foo() {\n" +
- " System.out.println(\"string1\" + \"string2\" //$NON-NLS-1$\n" +
- " );\n" +
+ "package p;\n" +
+ "public class Foo { \n" +
+ " public void foo() {\n" +
+ " System.out.println(\"string1\" + \"string2\" //$NON-NLS-1$\n" +
+ " );\n" +
"}",
- },
- "----------\n" +
- "1. ERROR in p\\Foo.java (at line 4)\n" +
- " System.out.println(\"string1\" + \"string2\" //$NON-NLS-1$\n" +
- " ^^^^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "2. ERROR in p\\Foo.java (at line 6)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
+ },
+ "----------\n" +
+ "1. ERROR in p\\Foo.java (at line 4)\n" +
+ " System.out.println(\"string1\" + \"string2\" //$NON-NLS-1$\n" +
+ " ^^^^^^^^^\n" +
+ "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
+ "----------\n" +
+ "2. ERROR in p\\Foo.java (at line 6)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete ClassBody\n" +
"----------\n",
null,
true,
- customOptions);
+ customOptions);
}
public void test004() {
Map customOptions = getCompilerOptions();
@@ -162,32 +162,32 @@ public void test004() {
this.runConformTest(
new String[] {
"p/Foo.java",
- "package p;\n" +
- "public class Foo { \n" +
- " public void foo() {\n" +
- " //$NON-NLS-1$\n" +
- " };\n" +
+ "package p;\n" +
+ "public class Foo { \n" +
+ " public void foo() {\n" +
+ " //$NON-NLS-1$\n" +
+ " };\n" +
"}",
- },
+ },
"",
null,
true,
null,
customOptions,
- null);
+ null);
}
public void test005() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
runNegativeTest(
// test directory preparation
- true /* flush output directory */,
+ true /* flush output directory */,
new String[] { /* test files */
"X.java",
- "public class X {\r\n" +
- " public static void main(String[] args) {\r\n" +
- " String s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\r\n" +
- " }\r\n" +
+ "public class X {\r\n" +
+ " public static void main(String[] args) {\r\n" +
+ " String s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\r\n" +
+ " }\r\n" +
"}",
},
// compiler options
@@ -195,13 +195,13 @@ public void test005() {
customOptions /* custom options */,
// compiler results
"----------\n" + /* expected compiler log */
- "1. ERROR in X.java (at line 3)\n" +
- " String s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " String s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
"----------\n",
// javac options
- JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
+ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
}
public void test006() {
Map customOptions = getCompilerOptions();
@@ -209,38 +209,38 @@ public void test006() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\r\n" +
- " public static void main(String[] args) {\r\n" +
- " String s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\r\n" +
+ "public class X {\r\n" +
+ " public static void main(String[] args) {\r\n" +
+ " String s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\r\n" +
" }\r\n" +
"",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " String s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " }\n" +
- " ^\n" +
- "Syntax error, insert \"}\" to complete ClassBody\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " String s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " }\n" +
+ " ^\n" +
+ "Syntax error, insert \"}\" to complete ClassBody\n" +
"----------\n",
null,
true,
- customOptions);
+ customOptions);
}
public void test007() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
runNegativeTest(
// test directory preparation
- true /* flush output directory */,
+ true /* flush output directory */,
new String[] { /* test files */
"X.java",
- "public class X {\r\n" +
- " public static void main(String[] args) {\r\n" +
- " String s = null; //$NON-NLS-1$//$NON-NLS-1$\r\n" +
+ "public class X {\r\n" +
+ " public static void main(String[] args) {\r\n" +
+ " String s = null; //$NON-NLS-1$//$NON-NLS-1$\r\n" +
" }\r\n" +
"}",
},
@@ -249,30 +249,30 @@ public void test007() {
customOptions /* custom options */,
// compiler results
"----------\n" + /* expected compiler log */
- "1. ERROR in X.java (at line 3)\n" +
- " String s = null; //$NON-NLS-1$//$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " String s = null; //$NON-NLS-1$//$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " String s = null; //$NON-NLS-1$//$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " String s = null; //$NON-NLS-1$//$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
"----------\n",
// javac options
- JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
+ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
}
public void test008() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
runNegativeTest(
// test directory preparation
- true /* flush output directory */,
+ true /* flush output directory */,
new String[] { /* test files */
"X.java",
- "public class X {\r\n" +
- " public static void main(String[] args) {\r\n" +
- " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\r\n" +
+ "public class X {\r\n" +
+ " public static void main(String[] args) {\r\n" +
+ " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\r\n" +
" }\r\n" +
"}",
},
@@ -281,23 +281,23 @@ public void test008() {
customOptions /* custom options */,
// compiler results
"----------\n" + /* expected compiler log */
- "1. ERROR in X.java (at line 3)\n" +
- " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
+ " ^^^^^^\n" +
+ "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
"----------\n",
// javac options
- JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
+ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
}
public void test009() {
Map customOptions = getCompilerOptions();
@@ -305,19 +305,19 @@ public void test009() {
this.runConformTest(
new String[] {
"p/Foo.java",
- "package p;\n" +
- "public class Foo { \n" +
- " public void foo(int i) {\n" +
- " System.out.println(\"test1\" + i + \"test2\"); //$NON-NLS-2$//$NON-NLS-1$\r\n" +
- " };\n" +
+ "package p;\n" +
+ "public class Foo { \n" +
+ " public void foo(int i) {\n" +
+ " System.out.println(\"test1\" + i + \"test2\"); //$NON-NLS-2$//$NON-NLS-1$\r\n" +
+ " };\n" +
"}",
- },
+ },
"",
null,
true,
null,
customOptions,
- null);
+ null);
}
public void test010() {
Map customOptions = getCompilerOptions();
@@ -332,31 +332,31 @@ public void test010() {
" System.out.println(s);\n" +
" }\n" +
"}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 3)\n" +
- " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " int i = s;\n" +
- " ^\n" +
- "Type mismatch: cannot convert from String to int\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
+ " ^^^^^^\n" +
+ "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 3)\n" +
+ " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 4)\n" +
+ " int i = s;\n" +
+ " ^\n" +
+ "Type mismatch: cannot convert from String to int\n" +
"----------\n",
null,
true,
- customOptions);
+ customOptions);
}
public void test011() {
Map customOptions = getCompilerOptions();
@@ -371,31 +371,31 @@ public void test011() {
" System.out.println(s + i);\n" +
" }\n" +
"}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " int i = null;\n" +
- " ^^^^\n" +
- "Type mismatch: cannot convert from null to int\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "4. ERROR in X.java (at line 4)\n" +
- " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " int i = null;\n" +
+ " ^^^^\n" +
+ "Type mismatch: cannot convert from null to int\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
+ " ^^^^^^\n" +
+ "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "4. ERROR in X.java (at line 4)\n" +
+ " String s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
"----------\n",
null,
true,
- customOptions);
+ customOptions);
}
public void test012() {
Map customOptions = getCompilerOptions();
@@ -410,33 +410,33 @@ public void test012() {
" System.out.println(s + i);\n" +
" }\n" +
"}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " int i = null;\n" +
- " ^^^^\n" +
- "Type mismatch: cannot convert from null to int\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " String s = null; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "3. ERROR in X.java (at line 4)\n" +
- " String s = null; //$NON-NLS-2$//$NON-NLS-3$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " int i = null;\n" +
+ " ^^^^\n" +
+ "Type mismatch: cannot convert from null to int\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " String s = null; //$NON-NLS-2$//$NON-NLS-3$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "3. ERROR in X.java (at line 4)\n" +
+ " String s = null; //$NON-NLS-2$//$NON-NLS-3$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
"----------\n",
null,
true,
- customOptions);
+ customOptions);
}
public void test013() {
Map customOptions = getCompilerOptions();
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
runNegativeTest(
// test directory preparation
- true /* flush output directory */,
+ true /* flush output directory */,
new String[] { /* test files */
"X.java",
"public class X {\n" +
@@ -451,13 +451,13 @@ public void test013() {
customOptions /* custom options */,
// compiler results
"----------\n" + /* expected compiler log */
- "1. ERROR in X.java (at line 3)\n" +
- " String s = \"test1\";\n" +
- " ^^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " String s = \"test1\";\n" +
+ " ^^^^^^^\n" +
+ "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
"----------\n",
// javac options
- JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
+ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=112973
public void test014() {
@@ -465,7 +465,7 @@ public void test014() {
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
runNegativeTest(
// test directory preparation
- true /* flush output directory */,
+ true /* flush output directory */,
new String[] { /* test files */
"X.java",
"public class X {\n" +
@@ -480,18 +480,18 @@ public void test014() {
customOptions /* custom options */,
// compiler results
"----------\n" + /* expected compiler log */
- "1. ERROR in X.java (at line 3)\n" +
- " String s = \"test1\"; //$NON-NLS-?$\n" +
- " ^^^^^^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 3)\n" +
- " String s = \"test1\"; //$NON-NLS-?$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " String s = \"test1\"; //$NON-NLS-?$\n" +
+ " ^^^^^^^\n" +
+ "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 3)\n" +
+ " String s = \"test1\"; //$NON-NLS-?$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
"----------\n",
// javac options
- JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
+ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=114077
public void test015() {
@@ -499,7 +499,7 @@ public void test015() {
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
runNegativeTest(
// test directory preparation
- true /* flush output directory */,
+ true /* flush output directory */,
new String[] { /* test files */
"X.java",
"public class X {\n" +
@@ -514,18 +514,18 @@ public void test015() {
customOptions /* custom options */,
// compiler results
"----------\n" + /* expected compiler log */
- "1. ERROR in X.java (at line 3)\n" +
- " String s1= null; //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 4)\n" +
- " String s2= \"\";\n" +
- " ^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " String s1= null; //$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 4)\n" +
+ " String s2= \"\";\n" +
+ " ^^\n" +
+ "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
"----------\n",
// javac options
- JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
+ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=114077
public void test016() {
@@ -533,7 +533,7 @@ public void test016() {
customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
runNegativeTest(
// test directory preparation
- true /* flush output directory */,
+ true /* flush output directory */,
new String[] { /* test files */
"X.java",
"public class X {\n" +
@@ -549,18 +549,18 @@ public void test016() {
customOptions /* custom options */,
// compiler results
"----------\n" + /* expected compiler log */
- "1. ERROR in X.java (at line 2)\n" +
- " private String s1= null; //$NON-NLS-1$\n" +
- " ^^^^^^^^^^^^^\n" +
- "Unnecessary $NON-NLS$ tag\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " String s2= \"\";\n" +
- " ^^\n" +
- "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " private String s1= null; //$NON-NLS-1$\n" +
+ " ^^^^^^^^^^^^^\n" +
+ "Unnecessary $NON-NLS$ tag\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " String s2= \"\";\n" +
+ " ^^\n" +
+ "Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" +
"----------\n",
// javac options
- JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
+ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148352
public void test017() {
@@ -577,12 +577,12 @@ public void test017() {
" }\n" +
" }\n" +
"}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " enclosingType.toString()\n" +
- " ^\n" +
- "Syntax error, insert \";\" to complete BlockStatements\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " enclosingType.toString()\n" +
+ " ^\n" +
+ "Syntax error, insert \";\" to complete BlockStatements\n" +
"----------\n",
null,
true,
@@ -591,7 +591,7 @@ public void test017() {
false,
false,
false,
- true);
+ true);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=213692
public void test018() {
@@ -607,12 +607,12 @@ public void test018() {
" String s2= \"2\"; //$NON-NLS-1$\n" +
" }\n" +
"}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " #\n" +
+ " ^\n" +
+ "Syntax error on token \"Invalid Character\", delete this token\n" +
"----------\n",
null,
true,
@@ -621,7 +621,7 @@ public void test018() {
false,
false,
false,
- true);
+ true);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=213692
public void test019() {
@@ -637,12 +637,12 @@ public void test019() {
" String s2= \"2\"; //$NON-NLS-1$\n" +
" }\n" +
"}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 3)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 3)\n" +
+ " #\n" +
+ " ^\n" +
+ "Syntax error on token \"Invalid Character\", delete this token\n" +
"----------\n",
null,
true,
@@ -651,7 +651,7 @@ public void test019() {
false,
false,
false,
- true);
+ true);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=213692
public void test020() {
@@ -667,12 +667,12 @@ public void test020() {
" String s2= \"2\"; //$NON-NLS-1$\n" +
" }\n" +
"}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " #\n" +
+ " ^\n" +
+ "Syntax error on token \"Invalid Character\", delete this token\n" +
"----------\n",
null,
true,
@@ -681,7 +681,7 @@ public void test020() {
false,
false,
false,
- true);
+ true);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=213692
public void test021() {
@@ -697,12 +697,12 @@ public void test021() {
" #\n" +
" }\n" +
"}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 5)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 5)\n" +
+ " #\n" +
+ " ^\n" +
+ "Syntax error on token \"Invalid Character\", delete this token\n" +
"----------\n",
null,
true,
@@ -711,7 +711,7 @@ public void test021() {
false,
false,
false,
- true);
+ true);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=213692
public void test022() {
@@ -728,17 +728,17 @@ public void test022() {
" String s2= \"2\"; //$NON-NLS-1$\n" +
" }\n" +
"}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 2)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
- "----------\n" +
- "2. ERROR in X.java (at line 5)\n" +
- " #\n" +
- " ^\n" +
- "Syntax error on token \"Invalid Character\", delete this token\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 2)\n" +
+ " #\n" +
+ " ^\n" +
+ "Syntax error on token \"Invalid Character\", delete this token\n" +
+ "----------\n" +
+ "2. ERROR in X.java (at line 5)\n" +
+ " #\n" +
+ " ^\n" +
+ "Syntax error on token \"Invalid Character\", delete this token\n" +
"----------\n",
null,
true,
@@ -747,7 +747,7 @@ public void test022() {
false,
false,
false,
- true);
+ true);
}
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=213692
public void test023() {
@@ -756,20 +756,20 @@ public void test023() {
this.runNegativeTest(
new String[] {
"X.java",
- "public class X {\n" +
- " public String toString() {\n" +
- " StringBuffer output = new StringBuffer(10);\n" +
- " output.append(this != null) ? null : \"<no type>\"); //$NON-NLS-1$\n" +
- " output.append(\" \"); //$NON-NLS-1$\n" +
- " return output.toString();\n" +
- " } \n" +
+ "public class X {\n" +
+ " public String toString() {\n" +
+ " StringBuffer output = new StringBuffer(10);\n" +
+ " output.append(this != null) ? null : \"<no type>\"); //$NON-NLS-1$\n" +
+ " output.append(\" \"); //$NON-NLS-1$\n" +
+ " return output.toString();\n" +
+ " } \n" +
"}",
- },
- "----------\n" +
- "1. ERROR in X.java (at line 4)\n" +
- " output.append(this != null) ? null : \"<no type>\"); //$NON-NLS-1$\n" +
- " ^\n" +
- "Syntax error on token \")\", delete this token\n" +
+ },
+ "----------\n" +
+ "1. ERROR in X.java (at line 4)\n" +
+ " output.append(this != null) ? null : \"<no type>\"); //$NON-NLS-1$\n" +
+ " ^\n" +
+ "Syntax error on token \")\", delete this token\n" +
"----------\n",
null,
true,
@@ -778,7 +778,7 @@ public void test023() {
false,
false,
false,
- true);
+ true);
}
public static Class testClass() {
return ExternalizeStringLiteralsTest.class;

Back to the top