### Eclipse Workspace Patch 1.0 #P org.eclipse.wst.jsdt.core.tests.compiler Index: src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/AnnotationTest.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/AnnotationTest.java,v retrieving revision 1.3 diff -u -r1.3 AnnotationTest.java --- src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/AnnotationTest.java 12 Mar 2009 05:49:09 -0000 1.3 +++ src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/AnnotationTest.java 13 Mar 2009 14:55:35 -0000 @@ -4776,25 +4776,6 @@ ""); } - //https://bugs.eclipse.org/bugs/show_bug.cgi?id=96974 - public void test147() { - Map options = this.getCompilerOptions(); - options.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); - this.runNegativeTest( - new String[] { - "X.java", - "@SuppressWarnings({\"nls\"})\n" + - "public class X {\n" + - " String test= \"\";\n" + - "}", - }, - "", - null, - true, - options - ); - } - //https://bugs.eclipse.org/bugs/show_bug.cgi?id=97466 public void test148() { this.runNegativeTest( @@ -5607,46 +5588,10 @@ }, expectedOutput); } - // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 - public void test169() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); - this.runNegativeTest( - new String[] { - "X.java", - "@SuppressWarnings(\"serial\")\n" + - "public class X extends Exception {\n" + - " String s = \"Hello\"; \n" + - "}" - }, - "----------\n" + - "1. WARNING in X.java (at line 3)\n" + - " String s = \"Hello\"; \n" + - " ^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n", - null, true, customOptions); - } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 - public void test170() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); - this.runConformTest( - new String[] { - "X.java", - "public class X extends Exception {\n" + - " @SuppressWarnings(\"nls\")\n" + - " String s = \"Hello\"; \n" + - "}" - }, - "", - null, true, null, customOptions, null); - } - // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 public void test171() { Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); this.runNegativeTest( new String[] { "X.java", @@ -5662,41 +5607,12 @@ " public class X extends Exception {\n" + " ^\n" + "The serializable class X does not declare a static final serialVersionUID field of type long\n" + - "----------\n" + - "2. WARNING in X.java (at line 5)\n" + - " String s2 = \"Hello2\"; \n" + - " ^^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n", - null, true, customOptions); - } - // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 - public void test172() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); - this.runNegativeTest( - new String[] { - "X.java", - "@SuppressWarnings(\"serial\")\n" + - "public class X extends Exception {\n" + - " @SuppressWarnings(\"nls\")\n" + - " String s = \"Hello\"; \n" + - " @SuppressWarnings(\"serial\")\n" + - " String s2 = \"Hello2\"; \n" + - "}" - }, - "----------\n" + - "1. WARNING in X.java (at line 6)\n" + - " String s2 = \"Hello2\"; \n" + - " ^^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + "----------\n", null, true, customOptions); } // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 public void test173() { Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); this.runNegativeTest( new String[] { "X.java", @@ -5716,105 +5632,6 @@ " public class X extends Exception {\n" + " ^\n" + "The serializable class X does not declare a static final serialVersionUID field of type long\n" + - "----------\n" + - "2. WARNING in X.java (at line 9)\n" + - " String s2 = \"Hello2\"; \n" + - " ^^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n", - null, true, customOptions); - } - // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 - public void test174() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); - final String source = "@interface Annot {\n" + - " int value() default 0;\n" + - "}\n" + - "@interface Annot2 {\n" + - " String value();\n" + - "}\n" + - "@Annot(value=5)\n" + - "public class X {\n" + - " @Annot2(value=\"nls\")\n" + - " String s = null; \n" + - " @SuppressWarnings(\"serial\")\n" + - " String s2 = \"Hello2\"; \n" + - "}"; - this.runNegativeTest( - new String[] { - "X.java", - source - }, - "----------\n" + - "1. WARNING in X.java (at line 12)\n" + - " String s2 = \"Hello2\"; \n" + - " ^^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n", - null, true, customOptions); - } - // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 - public void test175() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); - final String source = "@interface Annot {\n" + - " int value() default 0;\n" + - "}\n" + - "@interface Annot2 {\n" + - " String value();\n" + - "}\n" + - "@Annot(value=5)\n" + - "public class X {\n" + - " @Annot2(value=\"nls\") String s = \"value\"; \n" + - " @SuppressWarnings(\"serial\")\n" + - " String s2 = \"Hello2\"; \n" + - "}"; - this.runNegativeTest( - new String[] { - "X.java", - source - }, - "----------\n" + - "1. WARNING in X.java (at line 9)\n" + - " @Annot2(value=\"nls\") String s = \"value\"; \n" + - " ^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n" + - "2. WARNING in X.java (at line 11)\n" + - " String s2 = \"Hello2\"; \n" + - " ^^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n", - null, true, customOptions); - } - // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220 - public void test176() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); - final String source = "@interface Annot {\n" + - " int value() default 0;\n" + - "}\n" + - "@interface Annot2 {\n" + - " String value();\n" + - "}\n" + - "@Annot(value=5)\n" + - "public class X {\n" + - " @Annot2(value=\"nls\") String s = \"value\"; \n" + - " @SuppressWarnings({\"serial\", \"nls\"})\n" + - " String s2 = \"Hello2\"; \n" + - " @Annot(value=5) void foo() {}\n" + - "}"; - this.runNegativeTest( - new String[] { - "X.java", - source - }, - "----------\n" + - "1. WARNING in X.java (at line 9)\n" + - " @Annot2(value=\"nls\") String s = \"value\"; \n" + - " ^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + "----------\n", null, true, customOptions); } Index: src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/CastTest.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/CastTest.java,v retrieving revision 1.2 diff -u -r1.2 CastTest.java --- src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/CastTest.java 30 Apr 2008 21:31:32 -0000 1.2 +++ src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/CastTest.java 13 Mar 2009 14:55:35 -0000 @@ -10,15 +10,11 @@ *******************************************************************************/ package org.eclipse.wst.jsdt.core.tests.future.compiler.regression; -import java.io.File; -import java.io.IOException; import java.util.Map; import junit.framework.Test; -import org.eclipse.wst.jsdt.core.ToolFactory; import org.eclipse.wst.jsdt.core.tests.compiler.regression.AbstractRegressionTest; -import org.eclipse.wst.jsdt.core.tests.util.Util; import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants; import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions; Index: src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java =================================================================== RCS file: src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java diff -N src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java --- src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java 30 Apr 2008 21:31:29 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,227 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.jsdt.core.tests.compiler.regression; - -import java.util.Map; - -import junit.framework.Test; - -import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions; - -public class ExternalizeStringLiterals15Test extends AbstractRegressionTest { - -static { -// TESTS_NAMES = new String[] { "test000" }; -// TESTS_NUMBERS = new int[] { 6 }; -// TESTS_RANGE = new int[] { 11, -1 }; -} -public ExternalizeStringLiterals15Test(String name) { - super(name); -} -public static Test suite() { - return buildUniqueComplianceTestSuite(testClass(), COMPLIANCE_1_5); -} - -public void test001() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runConformTest( - new String[] { - "X.java", - "import static java.lang.annotation.ElementType.*;\n" + - "import static java.lang.annotation.RetentionPolicy.*;\n" + - "import java.lang.annotation.Retention;\n" + - "import java.lang.annotation.Target;\n" + - "@Target({TYPE, FIELD, METHOD,\r\n" + - " PARAMETER, CONSTRUCTOR,\r\n" + - " LOCAL_VARIABLE, PACKAGE})\r\n" + - "@Retention(CLASS)\r\n" + - "public @interface X\r\n" + - "{\r\n" + - " String[] value() default {};\r\n" + - " String justification() default \"\";\r\n" + - "}" - }, - "", - null, - true, - null, - customOptions, - null); -} -public void test002() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.java", - "class X {\n" + - " String s2 = \"test1\"; //$NON-NLS-1$\n" + - " String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" + - " \n" + - " @SuppressWarnings(\"nls\")\n" + - " void foo() {\n" + - " String s4 = null;\n" + - " String s5 = \"test3\";\n" + - " String s6 = \"test4\";\n" + - " System.out.println(\"test5\");\n" + - " }\n" + - "}", - }, - "----------\n" + - "1. ERROR in X.java (at line 3)\n" + - " String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n" + - "2. ERROR in X.java (at line 8)\n" + - " String s5 = \"test3\";\n" + - " ^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n" + - "3. ERROR in X.java (at line 9)\n" + - " String s6 = \"test4\";\n" + - " ^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n" + - "4. ERROR in X.java (at line 10)\n" + - " System.out.println(\"test5\");\n" + - " ^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n", - null, - true, - customOptions); -} -public void test003() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.java", - "class X {\n" + - " String s2 = \"test1\"; //$NON-NLS-1$\n" + - " String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" + - " \n" + - " @SuppressWarnings(\"nls\")\n" + - " void foo() {\n" + - " String s4 = null;\n" + - " String s5 = null;//$NON-NLS-1$\n" + - " String s6 = \"test4\";\n" + - " System.out.println(\"test5\");\n" + - " }\n" + - "}", - }, - "----------\n" + - "1. ERROR in X.java (at line 3)\n" + - " String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n" + - "2. ERROR in X.java (at line 8)\n" + - " String s5 = null;//$NON-NLS-1$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n" + - "3. ERROR in X.java (at line 9)\n" + - " String s6 = \"test4\";\n" + - " ^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n" + - "4. ERROR in X.java (at line 10)\n" + - " System.out.println(\"test5\");\n" + - " ^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n", - null, - true, - customOptions); -} -public void test004() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); - this.runNegativeTest( - new String[] { - "X.java", - "class X {\n" + - " String s2 = \"test1\"; //$NON-NLS-1$\n" + - " String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" + - " \n" + - " @SuppressWarnings(\"nls\")\n" + - " void foo() {\n" + - " String s4 = null;\n" + - " String s5 = null;//$NON-NLS-1$\n" + - " String s6 = \"test4\";\n" + - " System.out.println(\"test5\");\n" + - " }\n" + - "}", - }, - "----------\n" + - "1. WARNING in X.java (at line 3)\n" + - " String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n", - null, - true, - customOptions); -} -// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162903 -public void test005() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.java", - "class X {\n" + - " @SuppressWarnings(\"nls\")\n" + - " void foo() {\n" + - " String s6 = \"SUCCESS\";\n" + - " System.out.println(s6);\n" + - " }\n" + - "}", - }, - "----------\n" + - "1. ERROR in X.java (at line 4)\n" + - " String s6 = \"SUCCESS\";\n" + - " ^^^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n", - null, - true, - customOptions); -} -// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162903 -public void test006() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING); - this.runConformTest( - new String[] { - "X.java", - "public class X {\n" + - " @SuppressWarnings(\"nls\")\n" + - " public static void main(String[] args) {\n" + - " String s6 = \"SUCCESS\";\n" + - " System.out.println(s6);\n" + - " }\n" + - "}", - }, - "SUCCESS", - null, - true, - null, - customOptions, - null); -} -public static Class testClass() { - return ExternalizeStringLiterals15Test.class; -} -} Index: src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InnerEmulationTest.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InnerEmulationTest.java,v retrieving revision 1.3 diff -u -r1.3 InnerEmulationTest.java --- src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InnerEmulationTest.java 30 Apr 2008 21:31:29 -0000 1.3 +++ src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InnerEmulationTest.java 13 Mar 2009 14:55:35 -0000 @@ -11,12 +11,9 @@ package org.eclipse.wst.jsdt.core.tests.compiler.regression; import java.io.File; -import java.io.IOException; import junit.framework.Test; -import org.eclipse.wst.jsdt.core.ToolFactory; -import org.eclipse.wst.jsdt.core.tests.util.Util; import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants; import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions; Index: src/org/eclipse/wst/jsdt/core/tests/compiler/regression/TestAll.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/TestAll.java,v retrieving revision 1.4 diff -u -r1.4 TestAll.java --- src/org/eclipse/wst/jsdt/core/tests/compiler/regression/TestAll.java 30 Apr 2008 21:31:29 -0000 1.4 +++ src/org/eclipse/wst/jsdt/core/tests/compiler/regression/TestAll.java 13 Mar 2009 14:55:35 -0000 @@ -54,7 +54,6 @@ standardTests.add(XLargeTest.class); standardTests.add(InternalScannerTest.class); // standardTests.add(ConditionalExpressionTest.class); - standardTests.add(ExternalizeStringLiteralsTest.class); standardTests.add(NonFatalErrorTest.class); standardTests.add(FlowAnalysisTest.class); standardTests.add(CharOperationTest.class); @@ -86,7 +85,6 @@ since_1_5.add(InternalHexFloatTest.class); since_1_5.add(JavadocTest_1_5.class); // since_1_5.add(BatchCompilerTest.class); - since_1_5.add(ExternalizeStringLiterals15Test.class); // since_1_5.add(Deprecated15Test.class); // Tests to run when compliance is greater than 1.5 Index: src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ASTImplTests.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ASTImplTests.java,v retrieving revision 1.3 diff -u -r1.3 ASTImplTests.java --- src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ASTImplTests.java 30 Apr 2008 21:31:29 -0000 1.3 +++ src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ASTImplTests.java 13 Mar 2009 14:55:32 -0000 @@ -19,8 +19,8 @@ import org.eclipse.wst.jsdt.internal.compiler.ast.Argument; import org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression; import org.eclipse.wst.jsdt.internal.compiler.ast.CharLiteral; -import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration; import org.eclipse.wst.jsdt.internal.compiler.ast.CombinedBinaryExpression; +import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration; import org.eclipse.wst.jsdt.internal.compiler.ast.ExtendedStringLiteral; import org.eclipse.wst.jsdt.internal.compiler.ast.JavadocSingleTypeReference; import org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration; @@ -32,7 +32,6 @@ import org.eclipse.wst.jsdt.internal.compiler.ast.StringLiteral; import org.eclipse.wst.jsdt.internal.compiler.ast.StringLiteralConcatenation; import org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit; -import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants; import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions; import org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope; import org.eclipse.wst.jsdt.internal.compiler.lookup.ClassScope; Index: src/org/eclipse/wst/jsdt/core/tests/compiler/regression/SerialVersionUIDTests.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/SerialVersionUIDTests.java,v retrieving revision 1.3 diff -u -r1.3 SerialVersionUIDTests.java --- src/org/eclipse/wst/jsdt/core/tests/compiler/regression/SerialVersionUIDTests.java 30 Apr 2008 21:31:29 -0000 1.3 +++ src/org/eclipse/wst/jsdt/core/tests/compiler/regression/SerialVersionUIDTests.java 13 Mar 2009 14:55:35 -0000 @@ -16,8 +16,6 @@ import java.util.Map; -import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions; - import junit.framework.Test; public class SerialVersionUIDTests extends AbstractRegressionTest { Index: src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java =================================================================== RCS file: src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java diff -N src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java --- src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java 30 Apr 2008 21:31:29 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,515 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.jsdt.core.tests.compiler.regression; - -import java.util.Map; - -import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions; - -import junit.framework.Test; - -public class ExternalizeStringLiteralsTest extends AbstractRegressionTest { - -static { -// TESTS_NAMES = new String[] { "test000" }; -// TESTS_NUMBERS = new int[] { 16 }; -// TESTS_RANGE = new int[] { 11, -1 }; -} -public ExternalizeStringLiteralsTest(String name) { - super(name); -} -public static Test suite() { - return buildAllCompliancesTestSuite(testClass()); -} - -public void test001() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "A.js", - " function foo() {\n" + - " println(\"a\");\n" + - " } //$NON-NLS-1$ \n" + - "" - }, - "----------\n" + - "1. ERROR in A.js (at line 2)\n" + - " println(\"a\");\n" + - " ^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n" + - "2. ERROR in A.js (at line 3)\n" + - " } //$NON-NLS-1$ \n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n", - null, - true, - customOptions); -} - -public void test002() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.js", - " var s = null; //$NON-NLS-1$\n" + - " var s2 = \"\"; //$NON-NLS-1$\n" + - " var s3 = \"\"; //$NON-NLS-1$//$NON-NLS-2$\n" + - " \n" + - " function foo() {\n" + - " var s4 = null; //$NON-NLS-1$\n" + - " var s5 = \"\"; //$NON-NLS-1$\n" + - " var s6 = \"\"; //$NON-NLS-2$//$NON-NLS-1$\n" + - " println(\"foo\");//$NON-NLS-1$//$NON-NLS-2$\n" + - " } //$NON-NLS-1$\n" + - " //$NON-NLS-1$\n" + - "", - }, - "----------\n" + - "1. ERROR in X.js (at line 1)\n" + - " var s = null; //$NON-NLS-1$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n" + - "2. ERROR in X.js (at line 3)\n" + - " var s3 = \"\"; //$NON-NLS-1$//$NON-NLS-2$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n" + - "3. ERROR in X.js (at line 6)\n" + - " var s4 = null; //$NON-NLS-1$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n" + - "4. ERROR in X.js (at line 8)\n" + - " var s6 = \"\"; //$NON-NLS-2$//$NON-NLS-1$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n" + - "5. ERROR in X.js (at line 9)\n" + - " println(\"foo\");//$NON-NLS-1$//$NON-NLS-2$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n" + - "6. ERROR in X.js (at line 10)\n" + - " } //$NON-NLS-1$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n", - null, - true, - customOptions); -} -public void test003() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "Foo.js", - " function foo() {\n" + - " println(\"string1\" + \"string2\" //$NON-NLS-1$\n" + - " );\n" + - "", - }, - "----------\n" + - "1. ERROR in Foo.js (at line 2)\n" + - " println(\"string1\" + \"string2\" //$NON-NLS-1$\n" + - " ^^^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n" + - "2. ERROR in p\\Foo.js (at line 4)\n" + - " }\n" + - " ^\n" + - "Syntax error, insert \"}\" to complete ClassBody\n" + - "----------\n", - null, - true, - customOptions); -} -public void test004() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runConformTest( - new String[] { - "Foo.js", - " function foo() {\n" + - " //$NON-NLS-1$\n" + - " };\n" + - "", - }, - "", - null, - true, - null, - customOptions, - null); -} -public void test005() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.js", - " function main( args) {\r\n" + - " var s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\r\n" + - " }\r\n" + - "", - }, - "----------\n" + - "1. ERROR in X.js (at line 2)\n" + - " var s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n", - null, - true, - customOptions); -} -public void test006() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.js", - " public static function main(String[] args) {\r\n" + - " var s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\r\n" + - " \r\n" + - "", - }, - "----------\n" + - "1. ERROR in X.js (at line 2)\n" + - " var s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n" + - "2. ERROR in X.js (at line 3)\n" + - " }\n" + - " ^\n" + - "Syntax error, insert \"}\" to complete ClassBody\n" + - "----------\n", - null, - true, - customOptions); -} -public void test007() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.js", - " function main(args) {\r\n" + - " var s = null; //$NON-NLS-1$//$NON-NLS-1$\r\n" + - " }\r\n" + - "", - }, - "----------\n" + - "1. ERROR in X.js (at line 2)\n" + - " var s = null; //$NON-NLS-1$//$NON-NLS-1$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n" + - "2. ERROR in X.js (at line 2)\n" + - " var s = null; //$NON-NLS-1$//$NON-NLS-1$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n", - null, - true, - customOptions); -} -public void test008() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.js", - " function main(args) {\r\n" + - " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\r\n" + - " }\r\n" + - "", - }, - "----------\n" + - "1. ERROR in X.js (at line 2)\n" + - " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + - " ^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n" + - "2. ERROR in X.js (at line 2)\n" + - " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n" + - "3. ERROR in X.js (at line 2)\n" + - " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n", - null, - true, - customOptions); -} -public void test009() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runConformTest( - new String[] { - "Foo.js", - " function foo(i) {\n" + - " println(\"test1\" + i + \"test2\"); //$NON-NLS-2$//$NON-NLS-1$\r\n" + - " };\n" + - "", - }, - "", - null, - true, - null, - customOptions, - null); -} -public void test010() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.js", - " function main(args) {\n" + - " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + - " var i = s;\n" + - " println(s);\n" + - " }\n" + - "", - }, - "----------\n" + - "1. ERROR in X.js (at line 2)\n" + - " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + - " ^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n" + - "2. ERROR in X.js (at line 2)\n" + - " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n" + - "3. ERROR in X.js (at line 2)\n" + - " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n", - null, - true, - customOptions); -} -public void test011() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.js", - " function main(args) {\n" + - " var i = null;\n" + - " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + - " println(s + i);\n" + - " }\n" + - "", - }, - "----------\n" + - "2. ERROR in X.js (at line 3)\n" + - " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + - " ^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n" + - "3. ERROR in X.js (at line 3)\n" + - " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n" + - "4. ERROR in X.js (at line 3)\n" + - " var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n", - null, - true, - customOptions); -} -public void test012() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.js", - " function main(args) {\n" + - " var i = null;\n" + - " var s = null; //$NON-NLS-2$//$NON-NLS-3$\n" + - " println(s + i);\n" + - " }\n" + - "", - }, - "----------\n" + - "2. ERROR in X.js (at line 3)\n" + - " var s = null; //$NON-NLS-2$//$NON-NLS-3$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n" + - "3. ERROR in X.js (at line 3)\n" + - " var s = null; //$NON-NLS-2$//$NON-NLS-3$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n", - null, - true, - customOptions); -} -public void test013() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.js", - " function main(args) {\n" + - " var s = \"test1\";\n" + - " println(s);\n" + - " }\n" + - "", - }, - "----------\n" + - "1. ERROR in X.js (at line 2)\n" + - " var s = \"test1\";\n" + - " ^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n", - null, - true, - customOptions); -} -// https://bugs.eclipse.org/bugs/show_bug.cgi?id=112973 -public void test014() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.js", - " function main(args) {\n" + - " var s = \"test1\"; //$NON-NLS-?$\n" + - " println(s);\n" + - " }\n" + - "", - }, - "----------\n" + - "1. ERROR in X.js (at line 2)\n" + - " var s = \"test1\"; //$NON-NLS-?$\n" + - " ^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n" + - "2. ERROR in X.js (at line 2)\n" + - " var s = \"test1\"; //$NON-NLS-?$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n", - null, - true, - customOptions); -} -//https://bugs.eclipse.org/bugs/show_bug.cgi?id=114077 -public void test015() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.js", - " public function foo() {\n" + - " var s1= null; //$NON-NLS-1$\n" + - " var s2= \"\";\n" + - " }\n" + - "", - }, - "----------\n" + - "1. ERROR in X.js (at line 2)\n" + - " var s1= null; //$NON-NLS-1$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n" + - "2. ERROR in X.js (at line 3)\n" + - " var s2= \"\";\n" + - " ^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n", - null, - true, - customOptions); -} -//https://bugs.eclipse.org/bugs/show_bug.cgi?id=114077 -public void test016() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.js", - " var s1= null; //$NON-NLS-1$\n" + - " \n" + - " function foo() {\n" + - " var s2= \"\";\n" + - " }\n" + - "}", - }, - "----------\n" + - "1. ERROR in X.js (at line 1)\n" + - " private var s1= null; //$NON-NLS-1$\n" + - " ^^^^^^^^^^^^^\n" + - "Unnecessary $NON-NLS$ tag\n" + - "----------\n" + - "2. ERROR in X.js (at line 4)\n" + - " var s2= \"\";\n" + - " ^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n", - null, - true, - customOptions); -} -//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148352 -public void test017() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.js", - " function foo(locationInAST) {\n" + - " var enclosingType= \"\"; //$NON-NLS-1$\n" + - " if (locationInAST != null) {\n" + - " enclosingType.toString()\n" + - " }\n" + - " }\n" + - "", - }, - "----------\n" + - "1. ERROR in X.js (at line 5)\n" + - " enclosingType.toString()\n" + - " ^\n" + - "Syntax error, insert \";\" to complete BlockStatements\n" + - "----------\n", - null, - true, - customOptions, - false, - false, - false, - false, - true, - null); -} -public static Class testClass() { - return ExternalizeStringLiteralsTest.class; -} -} Index: src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicResolveTests.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicResolveTests.java,v retrieving revision 1.30 diff -u -r1.30 BasicResolveTests.java --- src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicResolveTests.java 28 Jan 2009 00:53:47 -0000 1.30 +++ src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicResolveTests.java 13 Mar 2009 14:55:32 -0000 @@ -1134,6 +1134,36 @@ "count.substring(4, 3);" }); } - - + + public void testbug234582() { + this.runNegativeTest( + new String[] { + "Z.js", + "function aaa() {\n" + + "var localvar = 1;\n" + + "function myclass() {\n" + + "myclass.prototype.mymethod = function() {\n" + + "if(localvar == 1) {\n" + + "}\n" + + "};\n" + + "}\n" + + "}" + }, + "" + ); + } + + public void testbug267133() { + this.runNegativeTest( + new String[] { + "Z.js", + "function cannot_convert_from_boolean_to_Boolean() {\n" + + "var returnValue = true;\n" + + "returnValue = false;\n" + + "return returnValue;\n" + + "}" + }, + "" + ); + } } \ No newline at end of file Index: src/org/eclipse/wst/jsdt/core/tests/compiler/regression/GenericTypeTest.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/GenericTypeTest.java,v retrieving revision 1.4 diff -u -r1.4 GenericTypeTest.java --- src/org/eclipse/wst/jsdt/core/tests/compiler/regression/GenericTypeTest.java 30 Apr 2008 21:31:29 -0000 1.4 +++ src/org/eclipse/wst/jsdt/core/tests/compiler/regression/GenericTypeTest.java 13 Mar 2009 14:55:34 -0000 @@ -10,15 +10,11 @@ *******************************************************************************/ package org.eclipse.wst.jsdt.core.tests.compiler.regression; -import java.io.File; -import java.io.IOException; import java.util.Map; import junit.framework.Test; -import org.eclipse.wst.jsdt.core.ToolFactory; import org.eclipse.wst.jsdt.core.tests.util.AbstractCompilerTest; -import org.eclipse.wst.jsdt.core.tests.util.Util; import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants; import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions; Index: src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NonFatalErrorTest.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NonFatalErrorTest.java,v retrieving revision 1.3 diff -u -r1.3 NonFatalErrorTest.java --- src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NonFatalErrorTest.java 12 Mar 2009 05:49:09 -0000 1.3 +++ src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NonFatalErrorTest.java 13 Mar 2009 14:55:35 -0000 @@ -94,33 +94,6 @@ null); } - public void test003() { - Map customOptions = getCompilerOptions(); - customOptions.put(CompilerOptions.OPTION_FatalOptionalError, CompilerOptions.DISABLED); - customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTestWithExecution( - new String[] { - "X.java", - "public class X {\n" + - " public static void main(String argv[]) {\n" + - " System.out.println(\"SUCCESS\");\n" + - " }\n" + - "}" - }, - "----------\n" + - "1. ERROR in X.java (at line 3)\n" + - " System.out.println(\"SUCCESS\");\n" + - " ^^^^^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n", - "SUCCESS", - null, - true, - null, - customOptions, - null); - } - public void test004() { Map customOptions = getCompilerOptions(); customOptions.put(CompilerOptions.OPTION_FatalOptionalError, CompilerOptions.DISABLED); Index: src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferTypesTests.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferTypesTests.java,v retrieving revision 1.22 diff -u -r1.22 InferTypesTests.java --- src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferTypesTests.java 1 Oct 2008 21:43:40 -0000 1.22 +++ src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferTypesTests.java 13 Mar 2009 14:55:34 -0000 @@ -730,6 +730,44 @@ ); } + public void testBugzilla236202() { + CompilationUnitDeclaration declaration = this.runInferTest( + "var Constants = {a:1, b:1};", + "X.js", + "class Constants extends Object{\n static Number a;\n static Number b;\n}\n", + getDefaultOptions() + + ); + } + + public void testBugzilla236202b() { + CompilationUnitDeclaration declaration = this.runInferTest( + "function Constants() {};\n" + + "Constants.prototype = {a:1, b:1};", + "X.js", + "class Constants extends Object{\n static Number a;\n static Number b;\n}\n", + getDefaultOptions() + + ); + } + + public void testBugzilla234582() { + CompilationUnitDeclaration declaration = this.runInferTest( + "function aaa() {\n" + + "var localvar = 1;\n" + + "globalvar = 2;\n" + + "function myclass() {\n" + + "myclass.prototype.mymethod = function() {\n" + + "}\n" + + "}\n" + + "}", + "X.js", + "class Constants extends Object{\n static Number a;\n static Number b;\n}\n", + getDefaultOptions() + + ); + } + } Index: src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ParserTest.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ParserTest.java,v retrieving revision 1.3 diff -u -r1.3 ParserTest.java --- src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ParserTest.java 30 Apr 2008 21:31:31 -0000 1.3 +++ src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ParserTest.java 13 Mar 2009 14:55:32 -0000 @@ -237,66 +237,6 @@ // ); //} /* - * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40681 - */ -public void test012() { - Hashtable nls = new Hashtable(); - nls.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.js", - " function foo() {\n" + - " \"foo\".equals(\"bar\");\n" + - " ;\n" + - "}\n" - }, - "----------\n" + - "1. ERROR in X.js (at line 2)\n" + - " \"foo\".equals(\"bar\");\n" + - " ^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n" + - "2. ERROR in X.js (at line 2)\n" + - " \"foo\".equals(\"bar\");\n" + - " ^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n", - null, // custom classpath - true, // flush previous output dir content - nls // custom options - ); -} -/* - * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40681 - */ -public void test013() { - Hashtable nls = new Hashtable(); - nls.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR); - this.runNegativeTest( - new String[] { - "X.js", - " function foo() {\n" + - " \"foo\".equals(\"bar\");\n" + - " //;\n" + - "}\n" - }, - "----------\n" + - "1. ERROR in X.js (at line 2)\n" + - " \"foo\".equals(\"bar\");\n" + - " ^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n" + - "2. ERROR in X.js (at line 2)\n" + - " \"foo\".equals(\"bar\");\n" + - " ^^^^^\n" + - "Non-externalized string literal; it should be followed by //$NON-NLS-$\n" + - "----------\n", - null, // custom classpath - true, // flush previous output dir content - nls // custom options - ); -} -/* * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47227 */ //public void test014() { Index: src/org/eclipse/wst/jsdt/core/tests/util/Util.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.compiler/src/org/eclipse/wst/jsdt/core/tests/util/Util.java,v retrieving revision 1.8 diff -u -r1.8 Util.java --- src/org/eclipse/wst/jsdt/core/tests/util/Util.java 30 Apr 2008 21:31:30 -0000 1.8 +++ src/org/eclipse/wst/jsdt/core/tests/util/Util.java 13 Mar 2009 14:55:35 -0000 @@ -10,20 +10,31 @@ *******************************************************************************/ package org.eclipse.wst.jsdt.core.tests.util; -import java.io.*; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.io.StringBufferInputStream; import java.net.ServerSocket; import java.net.URL; -import java.util.*; -import java.util.zip.*; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; -import org.eclipse.core.internal.resources.Resource; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.wst.jsdt.core.JavaScriptCore; import org.eclipse.wst.jsdt.core.compiler.CharOperation; import org.eclipse.wst.jsdt.core.compiler.IProblem; import org.eclipse.wst.jsdt.core.compiler.libraries.SystemLibraryLocation; #P org.eclipse.wst.jsdt.ui Index: src/org/eclipse/wst/jsdt/internal/corext/fix/CleanUpConstants.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/CleanUpConstants.java,v retrieving revision 1.5 diff -u -r1.5 CleanUpConstants.java --- src/org/eclipse/wst/jsdt/internal/corext/fix/CleanUpConstants.java 14 May 2008 15:44:23 -0000 1.5 +++ src/org/eclipse/wst/jsdt/internal/corext/fix/CleanUpConstants.java 13 Mar 2009 14:55:36 -0000 @@ -777,27 +777,6 @@ public static final String REMOVE_UNNECESSARY_CASTS= "cleanup.remove_unnecessary_casts"; //$NON-NLS-1$ /** - * Remove unnecessary '$NON-NLS$' tags. - *

- * i.e.: - * - *


-	 * String s; //$NON-NLS-1$ -> String s;
-	 * 
- * - *
- *
- * Possible values: {TRUE, FALSE}
- * Default value: Value returned by {@link #getEclipseDefaultSettings()}
- *
- * - * @see #TRUE - * @see #FALSE - * - */ - public static final String REMOVE_UNNECESSARY_NLS_TAGS= "cleanup.remove_unnecessary_nls_tags"; //$NON-NLS-1$ - - /** * Controls whether missing annotations should be added to the code. For * detailed settings use:
* {@link #ADD_MISSING_ANNOTATIONS_DEPRECATED}
@@ -917,27 +896,6 @@ public static final String ADD_MISSING_SERIAL_VERSION_ID_DEFAULT= "cleanup.add_default_serial_version_id"; //$NON-NLS-1$ /** - * Add '$NON-NLS$' tags to non externalized strings. - *

- * i.e.: - * - *


-	 *                   	 String s= ""; -> String s= ""; //$NON-NLS-1$
-	 * 
- * - *
- *
- * Possible values: {TRUE, FALSE}
- * Default value: Value returned by {@link #getEclipseDefaultSettings()}
- *
- * - * @see #TRUE - * @see #FALSE - * - */ - public static final String ADD_MISSING_NLS_TAGS= "cleanup.add_missing_nls_tags"; //$NON-NLS-1$ - - /** * If true the imports are organized while cleaning up code. * * Possible values: {TRUE, FALSE}
@@ -1125,7 +1083,6 @@ //Unnecessary Code result.put(REMOVE_UNNECESSARY_CASTS, TRUE); - result.put(REMOVE_UNNECESSARY_NLS_TAGS, TRUE); //Missing Code result.put(ADD_MISSING_ANNOTATIONS, TRUE); @@ -1136,8 +1093,6 @@ result.put(ADD_MISSING_SERIAL_VERSION_ID_GENERATED, FALSE); result.put(ADD_MISSING_SERIAL_VERSION_ID_DEFAULT, TRUE); - result.put(ADD_MISSING_NLS_TAGS, FALSE); - //Code Organising result.put(FORMAT_SOURCE_CODE, FALSE); @@ -1201,7 +1156,6 @@ //Unnecessary Code result.put(REMOVE_UNNECESSARY_CASTS, TRUE); - result.put(REMOVE_UNNECESSARY_NLS_TAGS, FALSE); //Missing Code result.put(ADD_MISSING_ANNOTATIONS, TRUE); @@ -1212,8 +1166,6 @@ result.put(ADD_MISSING_SERIAL_VERSION_ID_GENERATED, FALSE); result.put(ADD_MISSING_SERIAL_VERSION_ID_DEFAULT, TRUE); - result.put(ADD_MISSING_NLS_TAGS, FALSE); - //Code Organising result.put(FORMAT_SOURCE_CODE, FALSE); Index: src/org/eclipse/wst/jsdt/internal/corext/fix/CleanUpRefactoring.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/corext/fix/CleanUpRefactoring.java,v retrieving revision 1.8 diff -u -r1.8 CleanUpRefactoring.java --- src/org/eclipse/wst/jsdt/internal/corext/fix/CleanUpRefactoring.java 1 Oct 2008 21:43:34 -0000 1.8 +++ src/org/eclipse/wst/jsdt/internal/corext/fix/CleanUpRefactoring.java 13 Mar 2009 14:55:37 -0000 @@ -66,7 +66,6 @@ import org.eclipse.wst.jsdt.internal.ui.fix.ExpressionsCleanUp; import org.eclipse.wst.jsdt.internal.ui.fix.ICleanUp; import org.eclipse.wst.jsdt.internal.ui.fix.SortMembersCleanUp; -import org.eclipse.wst.jsdt.internal.ui.fix.StringCleanUp; import org.eclipse.wst.jsdt.internal.ui.fix.UnusedCodeCleanUp; import org.eclipse.wst.jsdt.internal.ui.javaeditor.ASTProvider; import org.eclipse.wst.jsdt.internal.ui.refactoring.IScheduledRefactoring; @@ -1036,7 +1035,6 @@ new UnusedCodeCleanUp(), // new Java50CleanUp(), // new UnnecessaryCodeCleanUp(), - new StringCleanUp(), new SortMembersCleanUp(), // new ImportsCleanUp(), new CodeFormatCleanUp(), @@ -1053,7 +1051,6 @@ new UnusedCodeCleanUp(settings), // new Java50CleanUp(settings), // new UnnecessaryCodeCleanUp(settings), - new StringCleanUp(settings), new SortMembersCleanUp(settings), // new ImportsCleanUp(settings), new CodeFormatCleanUp(settings), Index: src/org/eclipse/wst/jsdt/internal/corext/fix/StringFix.java =================================================================== RCS file: src/org/eclipse/wst/jsdt/internal/corext/fix/StringFix.java diff -N src/org/eclipse/wst/jsdt/internal/corext/fix/StringFix.java --- src/org/eclipse/wst/jsdt/internal/corext/fix/StringFix.java 30 Apr 2008 21:32:16 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,229 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.jsdt.internal.corext.fix; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.ltk.core.refactoring.CategorizedTextEditGroup; -import org.eclipse.ltk.core.refactoring.GroupCategory; -import org.eclipse.ltk.core.refactoring.GroupCategorySet; -import org.eclipse.ltk.core.refactoring.TextChange; -import org.eclipse.text.edits.ReplaceEdit; -import org.eclipse.text.edits.TextEdit; -import org.eclipse.text.edits.TextEditGroup; -import org.eclipse.wst.jsdt.core.IBuffer; -import org.eclipse.wst.jsdt.core.IJavaScriptUnit; -import org.eclipse.wst.jsdt.core.JavaScriptModelException; -import org.eclipse.wst.jsdt.core.compiler.IProblem; -import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit; -import org.eclipse.wst.jsdt.core.formatter.IndentManipulation; -import org.eclipse.wst.jsdt.internal.corext.refactoring.changes.CompilationUnitChange; -import org.eclipse.wst.jsdt.internal.corext.refactoring.changes.TextChangeCompatibility; -import org.eclipse.wst.jsdt.internal.corext.refactoring.nls.NLSUtil; -import org.eclipse.wst.jsdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.wst.jsdt.internal.ui.text.correction.ProblemLocation; -import org.eclipse.wst.jsdt.ui.text.java.IProblemLocation; - -/** - * Fix which solves various issues with strings. - * Supported: - * Add missing $NON-NLS$ tag - * Remove unnecessary $NON-NLS$ tag - * - */ -public class StringFix implements IFix { - - private final TextEditGroup[] fEditGroups; - private final String fName; - private final IJavaScriptUnit fCompilationUnit; - - public static StringFix createFix(JavaScriptUnit compilationUnit, IProblemLocation problem, boolean removeNLSTag, boolean addNLSTag) throws CoreException { - TextEdit addEdit= null; - IJavaScriptUnit cu= (IJavaScriptUnit)compilationUnit.getJavaElement(); - if (addNLSTag) { - addEdit= NLSUtil.createNLSEdit(cu, problem.getOffset()); - } - ReplaceEdit removeEdit= null; - if (removeNLSTag) { - IBuffer buffer= cu.getBuffer(); - if (buffer != null) { - removeEdit= getReplace(problem.getOffset(), problem.getLength(), buffer, true); - } - } - - if (addEdit != null && removeEdit != null) { - String label= FixMessages.StringFix_AddRemoveNonNls_description; - return new StringFix(label, compilationUnit, new TextEditGroup[] {new TextEditGroup(label, addEdit), new TextEditGroup(label, removeEdit)}); - } else if (addEdit != null) { - String label= FixMessages.StringFix_AddNonNls_description; - return new StringFix(label, compilationUnit, new TextEditGroup[] {new TextEditGroup(label, addEdit)}); - } else if (removeEdit != null) { - String label= FixMessages.StringFix_RemoveNonNls_description; - return new StringFix(label, compilationUnit, new TextEditGroup[] {new TextEditGroup(label, removeEdit)}); - } else { - return null; - } - } - - public static IFix createCleanUp(JavaScriptUnit compilationUnit, boolean addNLSTag, boolean removeNLSTag) throws CoreException, JavaScriptModelException { - if (!addNLSTag && !removeNLSTag) - return null; - - IProblem[] problems= compilationUnit.getProblems(); - IProblemLocation[] locations= new IProblemLocation[problems.length]; - for (int i= 0; i < problems.length; i++) { - locations[i]= new ProblemLocation(problems[i]); - } - return createCleanUp(compilationUnit, addNLSTag, removeNLSTag, locations); - } - - public static IFix createCleanUp(JavaScriptUnit compilationUnit, IProblemLocation[] problems, boolean addNLSTag, boolean removeNLSTag) throws CoreException, JavaScriptModelException { - if (!addNLSTag && !removeNLSTag) - return null; - - return createCleanUp(compilationUnit, addNLSTag, removeNLSTag, problems); - } - - private static IFix createCleanUp(JavaScriptUnit compilationUnit, boolean addNLSTag, boolean removeNLSTag, IProblemLocation[] problems) throws CoreException, JavaScriptModelException { - IJavaScriptUnit cu= (IJavaScriptUnit)compilationUnit.getJavaElement(); - List result= new ArrayList(); - - List missingNLSProblems= new ArrayList(); - for (int i= 0; i < problems.length; i++) { - IProblemLocation problem= problems[i]; - if (addNLSTag && problem.getProblemId() == IProblem.NonExternalizedStringLiteral) { - missingNLSProblems.add(problem); - } - if (removeNLSTag && problem.getProblemId() == IProblem.UnnecessaryNLSTag) { - IBuffer buffer= cu.getBuffer(); - if (buffer != null) { - TextEdit edit= StringFix.getReplace(problem.getOffset(), problem.getLength(), buffer, false); - if (edit != null) { - String label= FixMessages.StringFix_RemoveNonNls_description; - result.add(new CategorizedTextEditGroup(label, edit, new GroupCategorySet(new GroupCategory(label, label, label)))); - } - } - } - } - if (!missingNLSProblems.isEmpty()) { - int[] positions= new int[missingNLSProblems.size()]; - int i=0; - for (Iterator iter= missingNLSProblems.iterator(); iter.hasNext();) { - IProblemLocation problem= (IProblemLocation)iter.next(); - positions[i]= problem.getOffset(); - i++; - } - TextEdit[] edits= NLSUtil.createNLSEdits(cu, positions); - if (edits != null) { - for (int j= 0; j < edits.length; j++) { - String label= FixMessages.StringFix_AddNonNls_description; - result.add(new CategorizedTextEditGroup(label, edits[j], new GroupCategorySet(new GroupCategory(label, label, label)))); - } - } - } - if (result.isEmpty()) - return null; - - return new StringFix("", compilationUnit, (TextEditGroup[])result.toArray(new TextEditGroup[result.size()])); //$NON-NLS-1$ - } - - private static ReplaceEdit getReplace(int offset, int length, IBuffer buffer, boolean removeLeadingIndents) { - - String replaceString= new String(); - boolean hasMoreInComment= false; - - // look after the tag - int next= offset + length; - while (next < buffer.getLength()) { - char ch= buffer.getChar(next); - if (IndentManipulation.isIndentChar(ch)) { - next++; // remove all whitespace - } else if (IndentManipulation.isLineDelimiterChar(ch)) { - length= next - offset; - break; - } else if (ch == '/') { - next++; - if (next == buffer.getLength() || buffer.getChar(next) != '/') { - replaceString= "//"; //$NON-NLS-1$ - } else { - length= next - offset - 1; - } - hasMoreInComment= true; - break; - } else { - replaceString= "//"; //$NON-NLS-1$ - hasMoreInComment= true; - break; - } - } - if (!hasMoreInComment && removeLeadingIndents) { - while (offset > 0 && IndentManipulation.isIndentChar(buffer.getChar(offset - 1))) { - offset--; - length++; - } - } - if (length > 0) { - ReplaceEdit replaceEdit= new ReplaceEdit(offset, length, replaceString); - return replaceEdit; - } else { - return null; - } - } - - private StringFix(String name, JavaScriptUnit compilationUnit, TextEditGroup[] groups) { - fName= name; - fCompilationUnit= (IJavaScriptUnit)compilationUnit.getJavaElement(); - fEditGroups= groups; - } - - /* (non-Javadoc) - * @see org.eclipse.wst.jsdt.internal.corext.fix.AbstractFix#createChange() - */ - public TextChange createChange() throws CoreException { - if (fEditGroups == null || fEditGroups.length == 0) - return null; - - CompilationUnitChange result= new CompilationUnitChange(getDescription(), getCompilationUnit()); - for (int i= 0; i < fEditGroups.length; i++) { - TextEdit[] edits= fEditGroups[i].getTextEdits(); - String groupName= fEditGroups[i].getName(); - for (int j= 0; j < edits.length; j++) { - TextChangeCompatibility.addTextEdit(result, groupName, edits[j]); - } - } - return result; - } - - /* (non-Javadoc) - * @see org.eclipse.wst.jsdt.internal.corext.fix.IFix#getDescription() - */ - public String getDescription() { - return fName; - } - - /* (non-Javadoc) - * @see org.eclipse.wst.jsdt.internal.corext.fix.IFix#getCompilationUnit() - */ - public IJavaScriptUnit getCompilationUnit() { - return fCompilationUnit; - } - - /* (non-Javadoc) - * @see org.eclipse.wst.jsdt.internal.corext.fix.IFix#getStatus() - */ - public IStatus getStatus() { - return StatusInfo.OK_STATUS; - } -} Index: src/org/eclipse/wst/jsdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java,v retrieving revision 1.13 diff -u -r1.13 ProblemSeveritiesConfigurationBlock.java --- src/org/eclipse/wst/jsdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java 16 Feb 2009 23:55:52 -0000 1.13 +++ src/org/eclipse/wst/jsdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java 13 Mar 2009 14:55:37 -0000 @@ -50,7 +50,6 @@ private static final Key PREF_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE= getJDTCoreKey(JavaScriptCore.COMPILER_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE); private static final Key PREF_PB_SIGNAL_PARAMETER_IN_ABSTRACT= getJDTCoreKey(JavaScriptCore.COMPILER_PB_UNUSED_PARAMETER_WHEN_IMPLEMENTING_ABSTRACT); // private static final Key PREF_PB_SYNTHETIC_ACCESS_EMULATION= getJDTCoreKey(JavaScriptCore.COMPILER_PB_SYNTHETIC_ACCESS_EMULATION); - private static final Key PREF_PB_NON_EXTERNALIZED_STRINGS= getJDTCoreKey(JavaScriptCore.COMPILER_PB_NON_NLS_STRING_LITERAL); // private static final Key PREF_PB_UNUSED_IMPORT= getJDTCoreKey(JavaScriptCore.COMPILER_PB_UNUSED_IMPORT); private static final Key PREF_PB_UNUSED_PRIVATE= getJDTCoreKey(JavaScriptCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER); // private static final Key PREF_PB_STATIC_ACCESS_RECEIVER= getJDTCoreKey(JavaScriptCore.COMPILER_PB_STATIC_ACCESS_RECEIVER); @@ -141,7 +140,7 @@ PREF_PB_UNDEFINED_FIELD, /*PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME,*/ PREF_PB_DEPRECATION, PREF_PB_HIDDEN_CATCH_BLOCK, PREF_PB_UNUSED_LOCAL, PREF_PB_UNUSED_PARAMETER, PREF_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE, - /*PREF_PB_SYNTHETIC_ACCESS_EMULATION,*/ PREF_PB_NON_EXTERNALIZED_STRINGS, + /*PREF_PB_SYNTHETIC_ACCESS_EMULATION,*/ /*PREF_PB_UNUSED_IMPORT,*/ PREF_PB_UNUSED_LABEL, /*PREF_PB_STATIC_ACCESS_RECEIVER, */PREF_PB_DEPRECATION_IN_DEPRECATED_CODE, PREF_PB_NO_EFFECT_ASSIGNMENT, /*PREF_PB_INCOMPATIBLE_INTERFACE_METHOD,*/ @@ -275,9 +274,6 @@ label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_parameter_assignment; addComboBox(inner, label, PREF_PB_PARAMETER_ASSIGNMENT, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent); - - label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_non_externalized_strings_label; - addComboBox(inner, label, PREF_PB_NON_EXTERNALIZED_STRINGS, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent); // --- potential_programming_problems Index: src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.java,v retrieving revision 1.18 diff -u -r1.18 PreferencesMessages.java --- src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.java 27 Feb 2009 21:26:25 -0000 1.18 +++ src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.java 13 Mar 2009 14:55:37 -0000 @@ -417,7 +417,6 @@ public static String ProblemSeveritiesConfigurationBlock_pb_unused_parameter_label; public static String ProblemSeveritiesConfigurationBlock_pb_signal_param_in_overriding_label; public static String ProblemSeveritiesConfigurationBlock_pb_unused_private_label; - public static String ProblemSeveritiesConfigurationBlock_pb_non_externalized_strings_label; public static String ProblemSeveritiesConfigurationBlock_pb_deprecation_label; public static String ProblemSeveritiesConfigurationBlock_pb_deprecation_in_deprecation_label; public static String ProblemSeveritiesConfigurationBlock_pb_deprecation_when_overriding_label; Index: src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.properties =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.properties,v retrieving revision 1.25 diff -u -r1.25 PreferencesMessages.properties --- src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.properties 27 Feb 2009 21:26:25 -0000 1.25 +++ src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.properties 13 Mar 2009 14:55:37 -0000 @@ -453,7 +453,6 @@ ProblemSeveritiesConfigurationBlock_pb_unused_private_label=Unused local or private member: ProblemSeveritiesConfigurationBlock_pb_parameter_assignment=Parameter assignment: ProblemSeveritiesConfigurationBlock_pb_redundant_null_check=Redundant null check: -ProblemSeveritiesConfigurationBlock_pb_non_externalized_strings_label=Non-externalized strings (missing/unused $NON-NLS$ tag): ProblemSeveritiesConfigurationBlock_pb_deprecation_label=Deprecated API: ProblemSeveritiesConfigurationBlock_pb_deprecation_in_deprecation_label=Signal use of deprecated API inside deprecated code ProblemSeveritiesConfigurationBlock_pb_deprecation_when_overriding_label=Signal overriding or implementing deprecated function Index: src/org/eclipse/wst/jsdt/internal/ui/fix/StringCleanUp.java =================================================================== RCS file: src/org/eclipse/wst/jsdt/internal/ui/fix/StringCleanUp.java diff -N src/org/eclipse/wst/jsdt/internal/ui/fix/StringCleanUp.java --- src/org/eclipse/wst/jsdt/internal/ui/fix/StringCleanUp.java 30 Apr 2008 21:32:12 -0000 1.6 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,130 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.jsdt.internal.ui.fix; - -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.wst.jsdt.core.IJavaScriptUnit; -import org.eclipse.wst.jsdt.core.JavaScriptCore; -import org.eclipse.wst.jsdt.core.compiler.IProblem; -import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit; -import org.eclipse.wst.jsdt.internal.corext.fix.CleanUpConstants; -import org.eclipse.wst.jsdt.internal.corext.fix.IFix; -import org.eclipse.wst.jsdt.internal.corext.fix.StringFix; -import org.eclipse.wst.jsdt.ui.text.java.IProblemLocation; - -/** - * Create fixes which can solve problems in connection with Strings - * @see org.eclipse.wst.jsdt.internal.corext.fix.StringFix - * - */ -public class StringCleanUp extends AbstractCleanUp { - - public StringCleanUp(Map options) { - super(options); - } - - public StringCleanUp() { - super(); - } - - /** - * {@inheritDoc} - */ - public boolean requireAST(IJavaScriptUnit unit) throws CoreException { - return isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS) || - isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS); - } - - public IFix createFix(JavaScriptUnit compilationUnit) throws CoreException { - if (compilationUnit == null) - return null; - - return StringFix.createCleanUp(compilationUnit, - isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS), - isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)); - } - - /** - * {@inheritDoc} - */ - public IFix createFix(JavaScriptUnit compilationUnit, IProblemLocation[] problems) throws CoreException { - if (compilationUnit == null) - return null; - - return StringFix.createCleanUp(compilationUnit, problems, - isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS), - isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)); - } - - public Map getRequiredOptions() { - Map result= new Hashtable(); - - if (isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS) || isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)) - result.put(JavaScriptCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaScriptCore.WARNING); - - return result; - } - - /** - * {@inheritDoc} - */ - public String[] getDescriptions() { - List result= new ArrayList(); - if (isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS)) - result.add(MultiFixMessages.StringMultiFix_AddMissingNonNls_description); - if (isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)) - result.add(MultiFixMessages.StringMultiFix_RemoveUnnecessaryNonNls_description); - return (String[])result.toArray(new String[result.size()]); - } - - /** - * {@inheritDoc} - */ - public String getPreview() { - StringBuffer buf= new StringBuffer(); - - if (isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)) { - buf.append("var s=\"\";"); //$NON-NLS-1$ - } else { - buf.append("var s=\"\"; //$NON-NLS-1$"); //$NON-NLS-1$ - } - - return buf.toString(); - } - - /** - * {@inheritDoc} - * @throws CoreException - */ - public boolean canFix(JavaScriptUnit compilationUnit, IProblemLocation problem) throws CoreException { - return StringFix.createFix(compilationUnit, problem, isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS), isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS)) != null; - } - - /** - * {@inheritDoc} - */ - public int maximalNumberOfFixes(JavaScriptUnit compilationUnit) { - int result= 0; - IProblem[] problems= compilationUnit.getProblems(); - if (isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS)) - result+= getNumberOfProblems(problems, IProblem.NonExternalizedStringLiteral); - - if (isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)) - result+= getNumberOfProblems(problems, IProblem.UnnecessaryNLSTag); - - return result; - } -} Index: src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpMessages.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpMessages.java,v retrieving revision 1.6 diff -u -r1.6 CleanUpMessages.java --- src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpMessages.java 7 May 2008 21:23:39 -0000 1.6 +++ src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpMessages.java 13 Mar 2009 14:55:37 -0000 @@ -60,8 +60,6 @@ public static String CodeStyleTabPage_RadioName_UseBlocksSpecial; - - public static String UnnecessaryCodeTabPage_CheckboxName_UnnecessaryNLSTags; public static String UnnecessaryCodeTabPage_CheckboxName_UnusedFields; public static String UnnecessaryCodeTabPage_CheckboxName_UnusedLocalVariables; public static String UnnecessaryCodeTabPage_CheckboxName_UnusedMembers; Index: src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpMessages.properties =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpMessages.properties,v retrieving revision 1.7 diff -u -r1.7 CleanUpMessages.properties --- src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpMessages.properties 7 May 2008 21:23:39 -0000 1.7 +++ src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpMessages.properties 13 Mar 2009 14:55:37 -0000 @@ -51,5 +51,4 @@ UnnecessaryCodeTabPage_CheckboxName_UnusedFields=V&ars UnnecessaryCodeTabPage_CheckboxName_UnusedMethods=&Functions UnnecessaryCodeTabPage_CheckboxName_UnusedLocalVariables=Remove unused &local variables -UnnecessaryCodeTabPage_GroupName_UnnecessaryCode=Unnecessary code -UnnecessaryCodeTabPage_CheckboxName_UnnecessaryNLSTags=Remove unnecessary '$NON-NLS$' ta&gs \ No newline at end of file +UnnecessaryCodeTabPage_GroupName_UnnecessaryCode=Unnecessary code \ No newline at end of file Index: src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/UnnecessaryCodeTabPage.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/UnnecessaryCodeTabPage.java,v retrieving revision 1.4 diff -u -r1.4 UnnecessaryCodeTabPage.java --- src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/UnnecessaryCodeTabPage.java 25 Oct 2007 00:12:25 -0000 1.4 +++ src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/UnnecessaryCodeTabPage.java 13 Mar 2009 14:55:37 -0000 @@ -16,7 +16,6 @@ import org.eclipse.swt.widgets.Group; import org.eclipse.wst.jsdt.internal.corext.fix.CleanUpConstants; import org.eclipse.wst.jsdt.internal.ui.fix.ICleanUp; -import org.eclipse.wst.jsdt.internal.ui.fix.StringCleanUp; import org.eclipse.wst.jsdt.internal.ui.fix.UnnecessaryCodeCleanUp; import org.eclipse.wst.jsdt.internal.ui.fix.UnusedCodeCleanUp; import org.eclipse.wst.jsdt.internal.ui.preferences.formatter.ModifyDialog; @@ -34,8 +33,7 @@ protected ICleanUp[] createPreviewCleanUps(Map values) { return new ICleanUp[] { new UnusedCodeCleanUp(values), - new UnnecessaryCodeCleanUp(values), - new StringCleanUp(values) + new UnnecessaryCodeCleanUp(values) }; } @@ -62,8 +60,6 @@ // CheckboxPreference casts= createCheckboxPref(unnecessaryGroup, numColumns, CleanUpMessages.UnnecessaryCodeTabPage_CheckboxName_UnnecessaryCasts, CleanUpConstants.REMOVE_UNNECESSARY_CASTS, CleanUpModifyDialog.FALSE_TRUE); // registerPreference(casts); - CheckboxPreference nls= createCheckboxPref(unnecessaryGroup, numColumns, CleanUpMessages.UnnecessaryCodeTabPage_CheckboxName_UnnecessaryNLSTags, CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS, CleanUpModifyDialog.FALSE_TRUE); - registerPreference(nls); } } \ No newline at end of file Index: src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickFixProcessor.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickFixProcessor.java,v retrieving revision 1.11 diff -u -r1.11 QuickFixProcessor.java --- src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickFixProcessor.java 12 Mar 2009 05:01:07 -0000 1.11 +++ src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickFixProcessor.java 13 Mar 2009 14:55:37 -0000 @@ -175,7 +175,6 @@ case IProblem.MethodReturnsVoid: case IProblem.ForbiddenReference: case IProblem.DiscouragedReference: - case IProblem.UnnecessaryNLSTag: case IProblem.AssignmentHasNoEffect: case IProblem.UnsafeTypeConversion: case IProblem.UndefinedAnnotationMember: @@ -305,12 +304,6 @@ case IProblem.ShouldReturnValue: ReturnTypeSubProcessor.addMissingReturnStatementProposals(context, problem, proposals); break; - case IProblem.NonExternalizedStringLiteral: - LocalCorrectionsSubProcessor.addNLSProposals(context, problem, proposals); - break; - case IProblem.UnnecessaryNLSTag: - LocalCorrectionsSubProcessor.getUnnecessaryNLSTagProposals(context, problem, proposals); - break; case IProblem.NonStaticAccessToStaticField: case IProblem.NonStaticAccessToStaticMethod: case IProblem.IndirectAccessToStaticField: Index: src/org/eclipse/wst/jsdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java,v retrieving revision 1.7 diff -u -r1.7 LocalCorrectionsSubProcessor.java --- src/org/eclipse/wst/jsdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java 13 May 2008 22:03:02 -0000 1.7 +++ src/org/eclipse/wst/jsdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java 13 Mar 2009 14:55:37 -0000 @@ -33,7 +33,6 @@ import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.part.FileEditorInput; import org.eclipse.wst.jsdt.core.IJavaScriptUnit; -import org.eclipse.wst.jsdt.core.JavaScriptModelException; import org.eclipse.wst.jsdt.core.compiler.IProblem; import org.eclipse.wst.jsdt.core.dom.AST; import org.eclipse.wst.jsdt.core.dom.ASTNode; @@ -85,10 +84,8 @@ import org.eclipse.wst.jsdt.internal.corext.fix.CodeStyleFix; import org.eclipse.wst.jsdt.internal.corext.fix.IFix; import org.eclipse.wst.jsdt.internal.corext.fix.Java50Fix; -import org.eclipse.wst.jsdt.internal.corext.fix.StringFix; import org.eclipse.wst.jsdt.internal.corext.fix.UnusedCodeFix; import org.eclipse.wst.jsdt.internal.corext.refactoring.changes.CompilationUnitChange; -import org.eclipse.wst.jsdt.internal.corext.refactoring.nls.NLSRefactoring; import org.eclipse.wst.jsdt.internal.corext.refactoring.surround.ExceptionAnalyzer; import org.eclipse.wst.jsdt.internal.corext.refactoring.surround.SurroundWithTryCatchRefactoring; import org.eclipse.wst.jsdt.internal.corext.util.JavaModelUtil; @@ -97,12 +94,8 @@ import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin; import org.eclipse.wst.jsdt.internal.ui.fix.CodeStyleCleanUp; import org.eclipse.wst.jsdt.internal.ui.fix.Java50CleanUp; -import org.eclipse.wst.jsdt.internal.ui.fix.StringCleanUp; import org.eclipse.wst.jsdt.internal.ui.fix.UnnecessaryCodeCleanUp; import org.eclipse.wst.jsdt.internal.ui.javaeditor.JavaEditor; -import org.eclipse.wst.jsdt.internal.ui.refactoring.RefactoringSaveHelper; -import org.eclipse.wst.jsdt.internal.ui.refactoring.actions.RefactoringStarter; -import org.eclipse.wst.jsdt.internal.ui.refactoring.nls.ExternalizeWizard; import org.eclipse.wst.jsdt.internal.ui.text.correction.ChangeMethodSignatureProposal.ChangeDescription; import org.eclipse.wst.jsdt.internal.ui.text.correction.ChangeMethodSignatureProposal.InsertDescription; import org.eclipse.wst.jsdt.internal.ui.text.correction.ChangeMethodSignatureProposal.RemoveDescription; @@ -271,58 +264,7 @@ QuickAssistProcessor.getCatchClauseToThrowsProposals(context, selectedNode, proposals); } - - public static void addNLSProposals(IInvocationContext context, IProblemLocation problem, Collection proposals) throws CoreException { - final IJavaScriptUnit cu= context.getCompilationUnit(); - if (cu == null || !cu.exists()){ - return; - } - String name= CorrectionMessages.LocalCorrectionsSubProcessor_externalizestrings_description; - - ChangeCorrectionProposal proposal= new ChangeCorrectionProposal(name, null, 2, JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE)) { - public void apply(IDocument document) { - try { - NLSRefactoring refactoring= NLSRefactoring.create(cu); - if (refactoring == null) - return; - ExternalizeWizard wizard= new ExternalizeWizard(refactoring); - String dialogTitle= CorrectionMessages.LocalCorrectionsSubProcessor_externalizestrings_dialog_title; - new RefactoringStarter().activate(refactoring, wizard, JavaScriptPlugin.getActiveWorkbenchShell(), dialogTitle, RefactoringSaveHelper.SAVE_NON_JAVA_UPDATES); - } catch (JavaScriptModelException e) { - JavaScriptPlugin.log(e); - } - } - public String getAdditionalProposalInfo() { - return CorrectionMessages.LocalCorrectionsSubProcessor_externalizestrings_additional_info; - } - - }; - proposals.add(proposal); - - IFix fix= StringFix.createFix(context.getASTRoot(), problem, false, true); - if (fix != null) { - Image image= JavaPluginImages.get(JavaPluginImages.IMG_OBJS_NLS_NEVER_TRANSLATE); - Map options= new Hashtable(); - options.put(CleanUpConstants.ADD_MISSING_NLS_TAGS, CleanUpConstants.TRUE); - FixCorrectionProposal addNLS= new FixCorrectionProposal(fix, new StringCleanUp(options), 3, image, context); - addNLS.setCommandId(ADD_NON_NLS_ID); - proposals.add(addNLS); - } - } - public static void getUnnecessaryNLSTagProposals(IInvocationContext context, IProblemLocation problem, Collection proposals) throws CoreException { - IFix fix= StringFix.createFix(context.getASTRoot(), problem, true, false); - if (fix != null) { - Image image= JavaScriptPlugin.getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE); - Map options= new Hashtable(); - options.put(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS, CleanUpConstants.TRUE); - FixCorrectionProposal proposal= new FixCorrectionProposal(fix, new StringCleanUp(options), 6, image, context); - proposal.setCommandId(REMOVE_UNNECESSARY_NLS_TAG_ID); - proposals.add(proposal); - } - } - - /* * Fix instance accesses and indirect (static) accesses to static fields/methods */ #P org.eclipse.wst.jsdt.core.tests.model Index: src/org/eclipse/wst/jsdt/core/tests/model/ReconcilerTests.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ReconcilerTests.java,v retrieving revision 1.7 diff -u -r1.7 ReconcilerTests.java --- src/org/eclipse/wst/jsdt/core/tests/model/ReconcilerTests.java 13 May 2008 22:02:48 -0000 1.7 +++ src/org/eclipse/wst/jsdt/core/tests/model/ReconcilerTests.java 13 Mar 2009 14:55:40 -0000 @@ -11,25 +11,26 @@ package org.eclipse.wst.jsdt.core.tests.model; -import java.io.File; import java.io.IOException; import junit.framework.Test; -import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspaceRunnable; import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.ILogListener; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.wst.jsdt.core.*; +import org.eclipse.wst.jsdt.core.IBuffer; +import org.eclipse.wst.jsdt.core.IIncludePathEntry; +import org.eclipse.wst.jsdt.core.IJavaScriptElementDelta; +import org.eclipse.wst.jsdt.core.IJavaScriptProject; +import org.eclipse.wst.jsdt.core.IJavaScriptUnit; +import org.eclipse.wst.jsdt.core.JavaScriptCore; +import org.eclipse.wst.jsdt.core.JavaScriptModelException; +import org.eclipse.wst.jsdt.core.WorkingCopyOwner; import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem; -import org.eclipse.wst.jsdt.core.compiler.ValidationParticipant; import org.eclipse.wst.jsdt.core.compiler.IProblem; import org.eclipse.wst.jsdt.core.compiler.ReconcileContext; +import org.eclipse.wst.jsdt.core.compiler.ValidationParticipant; import org.eclipse.wst.jsdt.core.dom.AST; import org.eclipse.wst.jsdt.core.tests.util.Util; import org.eclipse.wst.jsdt.internal.core.CompilationUnit; @@ -213,9 +214,9 @@ // project15.setOption(JavaScriptCore.COMPILER_PB_UNUSED_LOCAL, JavaScriptCore.IGNORE); // project15.setOption(JavaScriptCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaScriptCore.IGNORE); } -private void setUp15WorkingCopy() throws JavaScriptModelException { +/*private void setUp15WorkingCopy() throws JavaScriptModelException { setUp15WorkingCopy("Reconciler15/src/p1/X.js", new WorkingCopyOwner() {}); -} +}*/ private void setUp15WorkingCopy(String path, WorkingCopyOwner owner) throws JavaScriptModelException { String contents = this.workingCopy.getSource(); setUpWorkingCopy(path, contents, owner); Index: src/org/eclipse/wst/jsdt/core/tests/model/ResolveTests.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/ResolveTests.java,v retrieving revision 1.4 diff -u -r1.4 ResolveTests.java --- src/org/eclipse/wst/jsdt/core/tests/model/ResolveTests.java 30 Apr 2008 21:30:55 -0000 1.4 +++ src/org/eclipse/wst/jsdt/core/tests/model/ResolveTests.java 13 Mar 2009 14:55:40 -0000 @@ -10,12 +10,13 @@ *******************************************************************************/ package org.eclipse.wst.jsdt.core.tests.model; -import java.io.IOException; +import junit.framework.Test; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.wst.jsdt.core.*; - -import junit.framework.*; +import org.eclipse.wst.jsdt.core.IJavaScriptElement; +import org.eclipse.wst.jsdt.core.IJavaScriptUnit; +import org.eclipse.wst.jsdt.core.ILocalVariable; +import org.eclipse.wst.jsdt.core.JavaScriptModelException; +import org.eclipse.wst.jsdt.core.WorkingCopyOwner; public class ResolveTests extends AbstractJavaModelTests { IJavaScriptUnit wc = null; @@ -34,13 +35,13 @@ public IJavaScriptUnit getWorkingCopy(String path, String source) throws JavaScriptModelException { return super.getWorkingCopy(path, source, this.owner, null); } -private IJavaScriptElement[] select(String path, String source, String selection) throws JavaScriptModelException { +/*private IJavaScriptElement[] select(String path, String source, String selection) throws JavaScriptModelException { this.wc = getWorkingCopy(path, source); String str = wc.getSource(); int start = str.lastIndexOf(selection); int length = selection.length(); return wc.codeSelect(start, length, this.owner); -} +}*/ public void setUpSuite() throws Exception { super.setUpSuite(); Index: src/org/eclipse/wst/jsdt/core/tests/model/CodeCorrectionTests.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CodeCorrectionTests.java,v retrieving revision 1.5 diff -u -r1.5 CodeCorrectionTests.java --- src/org/eclipse/wst/jsdt/core/tests/model/CodeCorrectionTests.java 12 Mar 2009 05:47:35 -0000 1.5 +++ src/org/eclipse/wst/jsdt/core/tests/model/CodeCorrectionTests.java 13 Mar 2009 14:55:39 -0000 @@ -779,7 +779,6 @@ assertEquals("wrong token", "hiding", CorrectionEngine.getWarningToken(IProblem.ArgumentHidingField)); assertEquals("wrong token", "hiding", CorrectionEngine.getWarningToken(IProblem.MaskedCatch)); assertEquals("wrong token", "hiding", CorrectionEngine.getWarningToken(IProblem.TypeParameterHidingType)); - assertEquals("wrong token", "nls", CorrectionEngine.getWarningToken(IProblem.NonExternalizedStringLiteral)); assertEquals("wrong token", "incomplete-switch", CorrectionEngine.getWarningToken(IProblem.MissingEnumConstantCase)); assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.LocalVariableIsNeverUsed)); assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.ArgumentIsNeverUsed)); Index: src/org/eclipse/wst/jsdt/core/tests/model/JavaConventionTests.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/JavaConventionTests.java,v retrieving revision 1.5 diff -u -r1.5 JavaConventionTests.java --- src/org/eclipse/wst/jsdt/core/tests/model/JavaConventionTests.java 13 May 2008 22:02:48 -0000 1.5 +++ src/org/eclipse/wst/jsdt/core/tests/model/JavaConventionTests.java 13 Mar 2009 14:55:39 -0000 @@ -10,11 +10,13 @@ *******************************************************************************/ package org.eclipse.wst.jsdt.core.tests.model; -import java.util.*; +import java.util.ArrayList; +import java.util.List; + import junit.framework.Test; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.*; -import org.eclipse.wst.jsdt.core.*; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.wst.jsdt.core.JavaScriptConventions; import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions; public class JavaConventionTests extends AbstractJavaModelTests { Index: src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests2.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests2.java,v retrieving revision 1.10 diff -u -r1.10 CompletionTests2.java --- src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests2.java 30 Apr 2008 21:30:55 -0000 1.10 +++ src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests2.java 13 Mar 2009 14:55:39 -0000 @@ -14,13 +14,14 @@ import java.io.FileOutputStream; import java.io.IOException; import java.util.HashMap; -import java.util.Hashtable; import java.util.Map; import java.util.StringTokenizer; +import junit.framework.ComparisonFailure; +import junit.framework.Test; + import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspaceRunnable; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; @@ -28,15 +29,12 @@ import org.eclipse.core.runtime.Path; import org.eclipse.wst.jsdt.core.IAccessRule; import org.eclipse.wst.jsdt.core.IIncludePathAttribute; -import org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer; import org.eclipse.wst.jsdt.core.IIncludePathEntry; -import org.eclipse.wst.jsdt.core.IJavaScriptUnit; import org.eclipse.wst.jsdt.core.IJavaScriptProject; +import org.eclipse.wst.jsdt.core.IJavaScriptUnit; +import org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer; import org.eclipse.wst.jsdt.core.JavaScriptCore; import org.eclipse.wst.jsdt.internal.codeassist.RelevanceConstants; -import org.eclipse.wst.jsdt.internal.core.JavaModelManager; - -import junit.framework.*; public class CompletionTests2 extends ModifyingResourceTests implements RelevanceConstants { Index: src/org/eclipse/wst/jsdt/core/tests/model/CompilationUnitTests.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompilationUnitTests.java,v retrieving revision 1.4 diff -u -r1.4 CompilationUnitTests.java --- src/org/eclipse/wst/jsdt/core/tests/model/CompilationUnitTests.java 30 Apr 2008 21:30:55 -0000 1.4 +++ src/org/eclipse/wst/jsdt/core/tests/model/CompilationUnitTests.java 13 Mar 2009 14:55:39 -0000 @@ -81,12 +81,12 @@ super.tearDownSuite(); } -private IJavaScriptUnit createWorkingCopy(String source) throws JavaScriptModelException { +/*private IJavaScriptUnit createWorkingCopy(String source) throws JavaScriptModelException { this.workingCopy = getCompilationUnit("/P/src/p/Y.js").getWorkingCopy(new WorkingCopyOwner(){}, null, null); this.workingCopy.getBuffer().setContents(source); this.workingCopy.makeConsistent(null); return workingCopy; -} +}*/ /** * Create working copy and compute problems. * Index: src/org/eclipse/wst/jsdt/core/tests/model/WorkingCopyTests.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/WorkingCopyTests.java,v retrieving revision 1.4 diff -u -r1.4 WorkingCopyTests.java --- src/org/eclipse/wst/jsdt/core/tests/model/WorkingCopyTests.java 30 Apr 2008 21:30:55 -0000 1.4 +++ src/org/eclipse/wst/jsdt/core/tests/model/WorkingCopyTests.java 13 Mar 2009 14:55:40 -0000 @@ -10,18 +10,29 @@ *******************************************************************************/ package org.eclipse.wst.jsdt.core.tests.model; -import java.io.IOException; -import java.util.Vector; - import junit.framework.Test; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.runtime.*; -import org.eclipse.wst.jsdt.core.*; -import org.eclipse.wst.jsdt.internal.core.util.Util; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.core.runtime.Path; import org.eclipse.team.core.RepositoryProvider; +import org.eclipse.wst.jsdt.core.IBuffer; +import org.eclipse.wst.jsdt.core.IField; +import org.eclipse.wst.jsdt.core.IFunction; +import org.eclipse.wst.jsdt.core.IJavaScriptElement; +import org.eclipse.wst.jsdt.core.IJavaScriptModelStatusConstants; +import org.eclipse.wst.jsdt.core.IJavaScriptUnit; +import org.eclipse.wst.jsdt.core.IOpenable; +import org.eclipse.wst.jsdt.core.IPackageFragment; +import org.eclipse.wst.jsdt.core.JavaScriptCore; +import org.eclipse.wst.jsdt.core.JavaScriptModelException; +import org.eclipse.wst.jsdt.core.WorkingCopyOwner; +import org.eclipse.wst.jsdt.internal.core.util.Util; Index: src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingExpressionsTest.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingExpressionsTest.java,v retrieving revision 1.5 diff -u -r1.5 ASTRewritingExpressionsTest.java --- src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingExpressionsTest.java 30 Apr 2008 21:30:54 -0000 1.5 +++ src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingExpressionsTest.java 13 Mar 2009 14:55:40 -0000 @@ -16,10 +16,32 @@ import org.eclipse.wst.jsdt.core.IJavaScriptUnit; import org.eclipse.wst.jsdt.core.IPackageFragment; - -import org.eclipse.wst.jsdt.core.dom.*; +import org.eclipse.wst.jsdt.core.dom.AST; +import org.eclipse.wst.jsdt.core.dom.ASTNode; +import org.eclipse.wst.jsdt.core.dom.ArrayAccess; +import org.eclipse.wst.jsdt.core.dom.Assignment; +import org.eclipse.wst.jsdt.core.dom.Block; +import org.eclipse.wst.jsdt.core.dom.BooleanLiteral; +import org.eclipse.wst.jsdt.core.dom.CatchClause; +import org.eclipse.wst.jsdt.core.dom.CharacterLiteral; +import org.eclipse.wst.jsdt.core.dom.ConditionalExpression; +import org.eclipse.wst.jsdt.core.dom.ExpressionStatement; +import org.eclipse.wst.jsdt.core.dom.FieldAccess; +import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration; +import org.eclipse.wst.jsdt.core.dom.FunctionInvocation; +import org.eclipse.wst.jsdt.core.dom.InfixExpression; +import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit; +import org.eclipse.wst.jsdt.core.dom.NumberLiteral; +import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression; +import org.eclipse.wst.jsdt.core.dom.PostfixExpression; +import org.eclipse.wst.jsdt.core.dom.PrefixExpression; +import org.eclipse.wst.jsdt.core.dom.ReturnStatement; +import org.eclipse.wst.jsdt.core.dom.SimpleName; +import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration; +import org.eclipse.wst.jsdt.core.dom.StringLiteral; +import org.eclipse.wst.jsdt.core.dom.ThisExpression; +import org.eclipse.wst.jsdt.core.dom.TryStatement; import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite; -import org.eclipse.wst.jsdt.core.dom.rewrite.ListRewrite; public class ASTRewritingExpressionsTest extends ASTRewritingTest { private static final Class THIS= ASTRewritingExpressionsTest.class; Index: src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingGroupNodeTest.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingGroupNodeTest.java,v retrieving revision 1.5 diff -u -r1.5 ASTRewritingGroupNodeTest.java --- src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingGroupNodeTest.java 30 Apr 2008 21:30:54 -0000 1.5 +++ src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingGroupNodeTest.java 13 Mar 2009 14:55:40 -0000 @@ -15,17 +15,15 @@ import org.eclipse.wst.jsdt.core.IJavaScriptUnit; import org.eclipse.wst.jsdt.core.IPackageFragment; - import org.eclipse.wst.jsdt.core.dom.AST; import org.eclipse.wst.jsdt.core.dom.ASTNode; import org.eclipse.wst.jsdt.core.dom.Block; -import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit; import org.eclipse.wst.jsdt.core.dom.ExpressionStatement; import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration; import org.eclipse.wst.jsdt.core.dom.FunctionInvocation; +import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit; import org.eclipse.wst.jsdt.core.dom.ReturnStatement; import org.eclipse.wst.jsdt.core.dom.Statement; -import org.eclipse.wst.jsdt.core.dom.TypeDeclaration; import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite; public class ASTRewritingGroupNodeTest extends ASTRewritingTest { Index: src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingInsertBoundTest.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingInsertBoundTest.java,v retrieving revision 1.6 diff -u -r1.6 ASTRewritingInsertBoundTest.java --- src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingInsertBoundTest.java 30 Apr 2008 21:30:54 -0000 1.6 +++ src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingInsertBoundTest.java 13 Mar 2009 14:55:40 -0000 @@ -19,14 +19,11 @@ import org.eclipse.wst.jsdt.core.IJavaScriptUnit; import org.eclipse.wst.jsdt.core.IPackageFragment; - import org.eclipse.wst.jsdt.core.dom.AST; import org.eclipse.wst.jsdt.core.dom.ASTNode; -import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit; import org.eclipse.wst.jsdt.core.dom.FieldDeclaration; import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration; -import org.eclipse.wst.jsdt.core.dom.PrimitiveType; -import org.eclipse.wst.jsdt.core.dom.TypeDeclaration; +import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit; import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment; import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement; import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite; Index: src/org/eclipse/wst/jsdt/core/tests/formatter/FormatterRegressionTests.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/formatter/FormatterRegressionTests.java,v retrieving revision 1.4 diff -u -r1.4 FormatterRegressionTests.java --- src/org/eclipse/wst/jsdt/core/tests/formatter/FormatterRegressionTests.java 30 Apr 2008 21:30:57 -0000 1.4 +++ src/org/eclipse/wst/jsdt/core/tests/formatter/FormatterRegressionTests.java 13 Mar 2009 14:55:39 -0000 @@ -6449,7 +6449,6 @@ String resourcePath = getResource("test492", "core_formatting.xml"); Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "core"); assertNotNull("No preferences", options); - options.put(JavaScriptCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaScriptCore.ERROR); DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, options); runTest(codeFormatter, "test492", "Main.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$ @@ -6820,7 +6819,6 @@ String resourcePath = getResource("test514", "formatter.xml"); Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "core"); assertNotNull("No preferences", options); - options.put(JavaScriptCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaScriptCore.ERROR); DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options); DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, options); runTest(codeFormatter, "test514", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$ #P org.eclipse.wst.jsdt.core Index: src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java,v retrieving revision 1.32 diff -u -r1.32 ProblemReporter.java --- src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java 12 Mar 2009 05:00:40 -0000 1.32 +++ src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java 13 Mar 2009 14:55:44 -0000 @@ -167,10 +167,6 @@ case IProblem.NeedToEmulateConstructorAccess : return CompilerOptions.AccessEmulation; - case IProblem.NonExternalizedStringLiteral : - case IProblem.UnnecessaryNLSTag : - return CompilerOptions.NonExternalizedString; - case IProblem.UseAssertAsAnIdentifier : return CompilerOptions.AssertUsedAsAnIdentifier; @@ -443,9 +439,6 @@ case (int)CompilerOptions.UsingDeprecatedAPI: return CategorizedProblem.CAT_DEPRECATION; - case (int)CompilerOptions.NonExternalizedString: - return CategorizedProblem.CAT_NLS; - case (int)CompilerOptions.Task: return CategorizedProblem.CAT_UNSPECIFIED; // TODO may want to improve @@ -5055,15 +5048,6 @@ typeDeclaration.sourceStart, typeDeclaration.sourceEnd); } - -public void nonExternalizedStringLiteral(ASTNode location) { - this.handle( - IProblem.NonExternalizedStringLiteral, - NoArgument, - NoArgument, - location.sourceStart, - location.sourceEnd); -} public void nonGenericTypeCannotBeParameterized(ASTNode location, TypeBinding type, TypeBinding[] argumentTypes) { this.nonGenericTypeCannotBeParameterized(0, location, type, argumentTypes); } @@ -6381,14 +6365,6 @@ instanceofExpression.sourceStart, instanceofExpression.sourceEnd); } -public void unnecessaryNLSTags(int sourceStart, int sourceEnd) { - this.handle( - IProblem.UnnecessaryNLSTag, - NoArgument, - NoArgument, - sourceStart, - sourceEnd); -} public void unqualifiedFieldAccess(NameReference reference, FieldBinding field) { int sourceStart = reference.sourceStart; int sourceEnd = reference.sourceEnd; Index: src/org/eclipse/wst/jsdt/internal/compiler/problem/DefaultProblem.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/problem/DefaultProblem.java,v retrieving revision 1.6 diff -u -r1.6 DefaultProblem.java --- src/org/eclipse/wst/jsdt/internal/compiler/problem/DefaultProblem.java 30 Apr 2008 21:32:41 -0000 1.6 +++ src/org/eclipse/wst/jsdt/internal/compiler/problem/DefaultProblem.java 13 Mar 2009 14:55:43 -0000 @@ -163,8 +163,6 @@ return "unnecessary code"; //$NON-NLS-1$ case CAT_UNCHECKED_RAW: return "unchecked/raw"; //$NON-NLS-1$ - case CAT_NLS: - return "nls"; //$NON-NLS-1$ case CAT_RESTRICTION: return "restriction"; //$NON-NLS-1$ } Index: src/org/eclipse/wst/jsdt/internal/compiler/batch/Main.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/batch/Main.java,v retrieving revision 1.15 diff -u -r1.15 Main.java --- src/org/eclipse/wst/jsdt/internal/compiler/batch/Main.java 12 Mar 2009 05:00:39 -0000 1.15 +++ src/org/eclipse/wst/jsdt/internal/compiler/batch/Main.java 13 Mar 2009 14:55:42 -0000 @@ -1720,10 +1720,6 @@ // this.options.put( // CompilerOptions.OPTION_ReportSyntheticAccessEmulation, // isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); - } else if (token.equals("nls")) { //$NON-NLS-1$ - this.options.put( - CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, - isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE); } else if (token.equals("staticReceiver")) { //$NON-NLS-1$ this.options.put( CompilerOptions.OPTION_ReportNonStaticAccessToStatic, Index: src/org/eclipse/wst/jsdt/core/compiler/IProblem.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/IProblem.java,v retrieving revision 1.13 diff -u -r1.13 IProblem.java --- src/org/eclipse/wst/jsdt/core/compiler/IProblem.java 12 Mar 2009 05:00:40 -0000 1.13 +++ src/org/eclipse/wst/jsdt/core/compiler/IProblem.java 13 Mar 2009 14:55:42 -0000 @@ -515,11 +515,9 @@ int NullSourceString = Syntax + Internal + 258; int UnterminatedString = Syntax + Internal + 259; int UnterminatedComment = Syntax + Internal + 260; - int NonExternalizedStringLiteral = Internal + 261; int InvalidDigit = Syntax + Internal + 262; int InvalidLowSurrogate = Syntax + Internal + 263; int InvalidHighSurrogate = Syntax + Internal + 264; - int UnnecessaryNLSTag = Internal + 265; // type related problems int DiscouragedReference = TypeRelated + 280; Index: src/org/eclipse/wst/jsdt/core/compiler/CategorizedProblem.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/compiler/CategorizedProblem.java,v retrieving revision 1.7 diff -u -r1.7 CategorizedProblem.java --- src/org/eclipse/wst/jsdt/core/compiler/CategorizedProblem.java 13 May 2008 20:45:38 -0000 1.7 +++ src/org/eclipse/wst/jsdt/core/compiler/CategorizedProblem.java 13 Mar 2009 14:55:41 -0000 @@ -92,8 +92,6 @@ public static final int CAT_UNNECESSARY_CODE = 120; /** Category for optional problems related to type safety in generics */ public static final int CAT_UNCHECKED_RAW = 130; - /** Category for optional problems related to internationalization of String literals */ - public static final int CAT_NLS = 140; /** Category for optional problems related to access restrictions */ public static final int CAT_RESTRICTION = 150; Index: src/org/eclipse/wst/jsdt/internal/core/util/CommentRecorderParser.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/util/CommentRecorderParser.java,v retrieving revision 1.3 diff -u -r1.3 CommentRecorderParser.java --- src/org/eclipse/wst/jsdt/internal/core/util/CommentRecorderParser.java 25 Oct 2007 00:09:38 -0000 1.3 +++ src/org/eclipse/wst/jsdt/internal/core/util/CommentRecorderParser.java 13 Mar 2009 14:55:44 -0000 @@ -12,10 +12,8 @@ import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration; import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants; -import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions; import org.eclipse.wst.jsdt.internal.compiler.parser.Parser; import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter; -import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemSeverities; /** * Internal parser used for parsing source to create DOM AST nodes. @@ -238,7 +236,7 @@ this.scanner = new CommentRecorderScanner( false /*comment*/, false /*whitespace*/, - this.options.getSeverity(CompilerOptions.NonExternalizedString) != ProblemSeverities.Ignore /*nls*/, + false /*externalized strings*/, this.options.sourceLevel /*sourceLevel*/, this.options.taskTags/*taskTags*/, this.options.taskPriorites/*taskPriorities*/, Index: src/org/eclipse/wst/jsdt/internal/compiler/parser/Parser.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/Parser.java,v retrieving revision 1.55 diff -u -r1.55 Parser.java --- src/org/eclipse/wst/jsdt/internal/compiler/parser/Parser.java 3 Dec 2008 22:14:05 -0000 1.55 +++ src/org/eclipse/wst/jsdt/internal/compiler/parser/Parser.java 13 Mar 2009 14:55:43 -0000 @@ -146,7 +146,6 @@ import org.eclipse.wst.jsdt.internal.compiler.problem.AbortCompilation; import org.eclipse.wst.jsdt.internal.compiler.problem.AbortCompilationUnit; import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter; -import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemSeverities; import org.eclipse.wst.jsdt.internal.compiler.util.Messages; import org.eclipse.wst.jsdt.internal.compiler.util.Util; @@ -8515,7 +8514,7 @@ this.scanner.foundTaskCount = 0; this.scanner.eofPosition = Integer.MAX_VALUE; this.recordStringLiterals = true; - final boolean checkNLS = this.options.getSeverity(CompilerOptions.NonExternalizedString) != ProblemSeverities.Ignore; + final boolean checkNLS = false; this.checkExternalizeStrings = checkNLS; this.scanner.checkNonExternalizedStringLiterals = initializeNLS && checkNLS; Index: src/org/eclipse/wst/jsdt/core/JavaScriptCore.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/core/JavaScriptCore.java,v retrieving revision 1.8 diff -u -r1.8 JavaScriptCore.java --- src/org/eclipse/wst/jsdt/core/JavaScriptCore.java 3 Dec 2008 22:14:09 -0000 1.8 +++ src/org/eclipse/wst/jsdt/core/JavaScriptCore.java 13 Mar 2009 14:55:41 -0000 @@ -318,11 +318,6 @@ * Possible configurable option ID. * @see #getDefaultOptions() */ - public static final String COMPILER_PB_NON_NLS_STRING_LITERAL = PLUGIN_ID + ".compiler.problem.nonExternalizedStringLiteral"; //$NON-NLS-1$ - /** - * Possible configurable option ID. - * @see #getDefaultOptions() - */ public static final String COMPILER_PB_ASSERT_IDENTIFIER = PLUGIN_ID + ".compiler.problem.assertIdentifier"; //$NON-NLS-1$ /** * Possible configurable option ID. Index: src/org/eclipse/wst/jsdt/internal/compiler/ast/Annotation.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/Annotation.java,v retrieving revision 1.6 diff -u -r1.6 Annotation.java --- src/org/eclipse/wst/jsdt/internal/compiler/ast/Annotation.java 30 Apr 2008 21:32:18 -0000 1.6 +++ src/org/eclipse/wst/jsdt/internal/compiler/ast/Annotation.java 13 Mar 2009 14:55:42 -0000 @@ -319,7 +319,6 @@ long tagBits = detectStandardAnnotation(scope, annotationType, valueAttribute); // record annotation positions in the compilation result - scope.referenceCompilationUnit().compilationResult.recordSuppressWarnings(CompilerOptions.NonExternalizedString, this.sourceStart, this.declarationSourceEnd); if (this.recipient != null) { if (tagBits != 0) { // tag bits onto recipient Index: src/org/eclipse/wst/jsdt/internal/compiler/ast/CompilationUnitDeclaration.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/CompilationUnitDeclaration.java,v retrieving revision 1.30 diff -u -r1.30 CompilationUnitDeclaration.java --- src/org/eclipse/wst/jsdt/internal/compiler/ast/CompilationUnitDeclaration.java 12 Mar 2009 05:00:39 -0000 1.30 +++ src/org/eclipse/wst/jsdt/internal/compiler/ast/CompilationUnitDeclaration.java 13 Mar 2009 14:55:42 -0000 @@ -10,7 +10,6 @@ *******************************************************************************/ package org.eclipse.wst.jsdt.internal.compiler.ast; -import java.util.Arrays; import java.util.Comparator; import java.util.Iterator; @@ -407,7 +406,6 @@ statements[i].resolve(scope); } } - reportNLSProblems(); } catch (AbortCompilationUnit e) { this.ignoreFurtherInvestigation = true; return; @@ -435,113 +433,12 @@ programElement.resolve(scope); } } - reportNLSProblems(); } catch (AbortCompilationUnit e) { this.ignoreFurtherInvestigation = true; return; } } - - private void reportNLSProblems() { - if (this.nlsTags != null || this.stringLiterals != null) { - final int stringLiteralsLength = this.stringLiteralsPtr; - final int nlsTagsLength = this.nlsTags == null ? 0 : this.nlsTags.length; - if (stringLiteralsLength == 0) { - if (nlsTagsLength != 0) { - for (int i = 0; i < nlsTagsLength; i++) { - NLSTag tag = this.nlsTags[i]; - if (tag != null) { - scope.problemReporter().unnecessaryNLSTags(tag.start, tag.end); - } - } - } - } else if (nlsTagsLength == 0) { - // resize string literals - if (this.stringLiterals.length != stringLiteralsLength) { - System.arraycopy(this.stringLiterals, 0, (stringLiterals = new StringLiteral[stringLiteralsLength]), 0, stringLiteralsLength); - } - Arrays.sort(this.stringLiterals, STRING_LITERAL_COMPARATOR); - for (int i = 0; i < stringLiteralsLength; i++) { - scope.problemReporter().nonExternalizedStringLiteral(this.stringLiterals[i]); - } - } else { - // need to iterate both arrays to find non matching elements - if (this.stringLiterals.length != stringLiteralsLength) { - System.arraycopy(this.stringLiterals, 0, (stringLiterals = new StringLiteral[stringLiteralsLength]), 0, stringLiteralsLength); - } - Arrays.sort(this.stringLiterals, STRING_LITERAL_COMPARATOR); - int indexInLine = 1; - int lastLineNumber = -1; - StringLiteral literal = null; - int index = 0; - int i = 0; - stringLiteralsLoop: for (; i < stringLiteralsLength; i++) { - literal = this.stringLiterals[i]; - final int literalLineNumber = literal.lineNumber; - if (lastLineNumber != literalLineNumber) { - indexInLine = 1; - lastLineNumber = literalLineNumber; - } else { - indexInLine++; - } - if (index < nlsTagsLength) { - nlsTagsLoop: for (; index < nlsTagsLength; index++) { - NLSTag tag = this.nlsTags[index]; - if (tag == null) continue nlsTagsLoop; - int tagLineNumber = tag.lineNumber; - if (literalLineNumber < tagLineNumber) { - scope.problemReporter().nonExternalizedStringLiteral(literal); - continue stringLiteralsLoop; - } else if (literalLineNumber == tagLineNumber) { - if (tag.index == indexInLine) { - this.nlsTags[index] = null; - index++; - continue stringLiteralsLoop; - } else { - nlsTagsLoop2: for (int index2 = index + 1; index2 < nlsTagsLength; index2++) { - NLSTag tag2 = this.nlsTags[index2]; - if (tag2 == null) continue nlsTagsLoop2; - int tagLineNumber2 = tag2.lineNumber; - if (literalLineNumber == tagLineNumber2) { - if (tag2.index == indexInLine) { - this.nlsTags[index2] = null; - continue stringLiteralsLoop; - } else { - continue nlsTagsLoop2; - } - } else { - scope.problemReporter().nonExternalizedStringLiteral(literal); - continue stringLiteralsLoop; - } - } - scope.problemReporter().nonExternalizedStringLiteral(literal); - continue stringLiteralsLoop; - } - } else { - scope.problemReporter().unnecessaryNLSTags(tag.start, tag.end); - continue nlsTagsLoop; - } - } - } - // all nls tags have been processed, so remaining string literals are not externalized - break stringLiteralsLoop; - } - for (; i < stringLiteralsLength; i++) { - scope.problemReporter().nonExternalizedStringLiteral(this.stringLiterals[i]); - } - if (index < nlsTagsLength) { - for (; index < nlsTagsLength; index++) { - NLSTag tag = this.nlsTags[index]; - if (tag != null) { - scope.problemReporter().unnecessaryNLSTags(tag.start, tag.end); - } - } - } - } - } - } - public void tagAsHavingErrors() { ignoreFurtherInvestigation = true; } Index: src/org/eclipse/wst/jsdt/internal/compiler/impl/CompilerOptions.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/impl/CompilerOptions.java,v retrieving revision 1.16 diff -u -r1.16 CompilerOptions.java --- src/org/eclipse/wst/jsdt/internal/compiler/impl/CompilerOptions.java 12 Mar 2009 05:00:40 -0000 1.16 +++ src/org/eclipse/wst/jsdt/internal/compiler/impl/CompilerOptions.java 13 Mar 2009 14:55:42 -0000 @@ -54,7 +54,6 @@ public static final String OPTION_ReportFieldHiding = "org.eclipse.wst.jsdt.core.compiler.problem.fieldHiding"; //$NON-NLS-1$ public static final String OPTION_ReportTypeParameterHiding = "org.eclipse.wst.jsdt.core.compiler.problem.typeParameterHiding"; //$NON-NLS-1$ public static final String OPTION_ReportPossibleAccidentalBooleanAssignment = "org.eclipse.wst.jsdt.core.compiler.problem.possibleAccidentalBooleanAssignment"; //$NON-NLS-1$ - public static final String OPTION_ReportNonExternalizedStringLiteral = "org.eclipse.wst.jsdt.core.compiler.problem.nonExternalizedStringLiteral"; //$NON-NLS-1$ public static final String OPTION_ReportIncompatibleNonInheritedInterfaceMethod = "org.eclipse.wst.jsdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod"; //$NON-NLS-1$ public static final String OPTION_ReportUnusedPrivateMember = "org.eclipse.wst.jsdt.core.compiler.problem.unusedPrivateMember"; //$NON-NLS-1$ public static final String OPTION_ReportNoImplicitStringConversion = "org.eclipse.wst.jsdt.core.compiler.problem.noImplicitStringConversion"; //$NON-NLS-1$ @@ -172,7 +171,6 @@ //TODO: remove AccessEmulation public static final long AccessEmulation = ASTNode.Bit8; public static final long WrongNumberOfArguments = ASTNode.Bit8; - public static final long NonExternalizedString = ASTNode.Bit9; public static final long AssertUsedAsAnIdentifier = ASTNode.Bit10; public static final long NonStaticAccessToStatic = ASTNode.Bit12; public static final long Task = ASTNode.Bit13; @@ -407,7 +405,6 @@ optionsMap.put(OPTION_ReportUnusedParameter, getSeverityString(UnusedArgument)); optionsMap.put(OPTION_ReportWrongNumberOfArguments, getSeverityString(WrongNumberOfArguments)); optionsMap.put(OPTION_ReportNoEffectAssignment, getSeverityString(NoEffectAssignment)); - optionsMap.put(OPTION_ReportNonExternalizedStringLiteral, getSeverityString(NonExternalizedString)); optionsMap.put(OPTION_ReportNoImplicitStringConversion, getSeverityString(NoImplicitStringConversion)); optionsMap.put(OPTION_ReportNonStaticAccessToStatic, getSeverityString(NonStaticAccessToStatic)); optionsMap.put(OPTION_ReportIndirectStaticAccess, getSeverityString(IndirectStaticAccess)); @@ -525,8 +522,6 @@ return OPTION_ReportNoImplicitStringConversion; case (int) WrongNumberOfArguments : return OPTION_ReportWrongNumberOfArguments; - case (int) NonExternalizedString : - return OPTION_ReportNonExternalizedStringLiteral; case (int) AssertUsedAsAnIdentifier : return OPTION_ReportAssertIdentifier; case (int) NonStaticAccessToStatic : @@ -881,7 +876,6 @@ if ((optionValue = optionsMap.get(OPTION_ReportTypeParameterHiding)) != null) updateSeverity(TypeHiding, optionValue); if ((optionValue = optionsMap.get(OPTION_ReportPossibleAccidentalBooleanAssignment)) != null) updateSeverity(AccidentalBooleanAssign, optionValue); if ((optionValue = optionsMap.get(OPTION_ReportEmptyStatement)) != null) updateSeverity(EmptyStatement, optionValue); - if ((optionValue = optionsMap.get(OPTION_ReportNonExternalizedStringLiteral)) != null) updateSeverity(NonExternalizedString, optionValue); if ((optionValue = optionsMap.get(OPTION_ReportAssertIdentifier)) != null) updateSeverity(AssertUsedAsAnIdentifier, optionValue); if ((optionValue = optionsMap.get(OPTION_ReportEnumIdentifier)) != null) updateSeverity(EnumUsedAsAnIdentifier, optionValue); if ((optionValue = optionsMap.get(OPTION_ReportNonStaticAccessToStatic)) != null) updateSeverity(NonStaticAccessToStatic, optionValue); @@ -1052,7 +1046,6 @@ buf.append("\n\t- unused parameter: ").append(getSeverityString(UnusedArgument)); //$NON-NLS-1$ buf.append("\n\t- synthetic access emulation: ").append(getSeverityString(AccessEmulation)); //$NON-NLS-1$ buf.append("\n\t- assignment with no effect: ").append(getSeverityString(NoEffectAssignment)); //$NON-NLS-1$ - buf.append("\n\t- non externalized string: ").append(getSeverityString(NonExternalizedString)); //$NON-NLS-1$ buf.append("\n\t- static access receiver: ").append(getSeverityString(NonStaticAccessToStatic)); //$NON-NLS-1$ buf.append("\n\t- indirect static access: ").append(getSeverityString(IndirectStaticAccess)); //$NON-NLS-1$ buf.append("\n\t- incompatible non inherited interface method: ").append(getSeverityString(IncompatibleNonInheritedInterfaceMethod)); //$NON-NLS-1$ @@ -1232,7 +1225,6 @@ OPTION_ReportSwitchCaseShouldBeConstant, OPTION_ReportNoEffectAssignment, OPTION_ReportNoImplicitStringConversion, - OPTION_ReportNonExternalizedStringLiteral, OPTION_ReportNonStaticAccessToStatic, OPTION_ReportNullReference, OPTION_ReportPotentialNullReference, @@ -1273,8 +1265,6 @@ case (int) LocalVariableHiding : case (int) MaskedCatchBlock : return "hiding"; //$NON-NLS-1$ - case (int) NonExternalizedString : - return "nls"; //$NON-NLS-1$ case (int) UnnecessaryTypeCheck : return "cast"; //$NON-NLS-1$ case (int) UnusedLocalVariable : @@ -1382,8 +1372,6 @@ return IncompleteEnumSwitch; break; case 'n' : - if ("nls".equals(warningToken)) //$NON-NLS-1$ - return NonExternalizedString; if ("null".equals(warningToken)) //$NON-NLS-1$ return NullReference | PotentialNullReference | RedundantNullCheck; break; Index: src/org/eclipse/wst/jsdt/internal/formatter/DefaultCodeFormatter.java =================================================================== RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/formatter/DefaultCodeFormatter.java,v retrieving revision 1.8 diff -u -r1.8 DefaultCodeFormatter.java --- src/org/eclipse/wst/jsdt/internal/formatter/DefaultCodeFormatter.java 12 Mar 2009 05:00:39 -0000 1.8 +++ src/org/eclipse/wst/jsdt/internal/formatter/DefaultCodeFormatter.java 13 Mar 2009 14:55:44 -0000 @@ -280,7 +280,6 @@ optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE); optionsMap.put(CompilerOptions.OPTION_ReportWrongNumberOfArguments, CompilerOptions.IGNORE); optionsMap.put(CompilerOptions.OPTION_ReportNoEffectAssignment, CompilerOptions.IGNORE); - optionsMap.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.IGNORE); optionsMap.put(CompilerOptions.OPTION_ReportNoImplicitStringConversion, CompilerOptions.IGNORE); optionsMap.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, CompilerOptions.IGNORE); optionsMap.put(CompilerOptions.OPTION_ReportIndirectStaticAccess, CompilerOptions.IGNORE);