View | Details | Raw Unified | Return to bug 268542 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/AnnotationTest.java (-185 lines)
Lines 4776-4800 Link Here
4776
			"");
4776
			"");
4777
    }
4777
    }
4778
    
4778
    
4779
    //https://bugs.eclipse.org/bugs/show_bug.cgi?id=96974
4780
    public void test147() {
4781
		Map options = this.getCompilerOptions();
4782
		options.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING);
4783
        this.runNegativeTest(
4784
            new String[] {
4785
                "X.java",
4786
				"@SuppressWarnings({\"nls\"})\n" +
4787
				"public class X<T> {\n" +
4788
				"	 String test= \"\";\n" +
4789
				"}",
4790
            },
4791
			"",
4792
			null,
4793
			true,
4794
			options
4795
		);
4796
    }
4797
    
4798
    //https://bugs.eclipse.org/bugs/show_bug.cgi?id=97466
4779
    //https://bugs.eclipse.org/bugs/show_bug.cgi?id=97466
4799
    public void test148() {
4780
    public void test148() {
4800
        this.runNegativeTest(
4781
        this.runNegativeTest(
Lines 5177-5185 Link Here
5177
    public void test163() {
5158
    public void test163() {
5178
		Map options = this.getCompilerOptions();
5159
		Map options = this.getCompilerOptions();
5179
		options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
5160
		options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.WARNING);
5180
		options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.WARNING);
5181
		options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING);
5161
		options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.WARNING);
5182
		options.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, CompilerOptions.WARNING);
5183
        this.runNegativeTest(
5162
        this.runNegativeTest(
5184
            new String[] {
5163
            new String[] {
5185
                "X.java",
5164
                "X.java",
Lines 5607-5652 Link Here
5607
           },
5586
           },
5608
           expectedOutput);
5587
           expectedOutput);
5609
    }
5588
    }
5610
    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220
5611
    public void test169() {
5612
    	Map customOptions = getCompilerOptions();
5613
    	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING);
5614
        this.runNegativeTest(
5615
            new String[] {
5616
                "X.java",
5617
    			"@SuppressWarnings(\"serial\")\n" + 
5618
    			"public class X extends Exception {\n" +
5619
    			"	String s = \"Hello\"; \n" +
5620
    			"}"
5621
            },
5622
            "----------\n" + 
5623
    		"1. WARNING in X.java (at line 3)\n" + 
5624
    		"	String s = \"Hello\"; \n" + 
5625
    		"	           ^^^^^^^\n" + 
5626
    		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
5627
    		"----------\n",
5628
			null, true, customOptions);
5629
    }
5630
    
5589
    
5631
    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220
5590
    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220
5632
    public void test170() {
5633
    	Map customOptions = getCompilerOptions();
5634
    	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING);
5635
        this.runConformTest(
5636
            new String[] {
5637
                "X.java",
5638
    			"public class X extends Exception {\n" +
5639
    			"   @SuppressWarnings(\"nls\")\n" + 
5640
    			"	String s = \"Hello\"; \n" +
5641
    			"}"
5642
            },
5643
    		"",
5644
			null, true, null, customOptions, null);
5645
    }
5646
    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220
5647
    public void test171() {
5591
    public void test171() {
5648
    	Map customOptions = getCompilerOptions();
5592
    	Map customOptions = getCompilerOptions();
5649
    	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING);
5650
        this.runNegativeTest(
5593
        this.runNegativeTest(
5651
            new String[] {
5594
            new String[] {
5652
                "X.java",
5595
                "X.java",
Lines 5662-5702 Link Here
5662
    		"	public class X extends Exception {\n" + 
5605
    		"	public class X extends Exception {\n" + 
5663
    		"	             ^\n" + 
5606
    		"	             ^\n" + 
5664
    		"The serializable class X does not declare a static final serialVersionUID field of type long\n" + 
5607
    		"The serializable class X does not declare a static final serialVersionUID field of type long\n" + 
5665
    		"----------\n" + 
5666
    		"2. WARNING in X.java (at line 5)\n" + 
5667
    		"	String s2 = \"Hello2\"; \n" + 
5668
    		"	            ^^^^^^^^\n" + 
5669
    		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
5670
    		"----------\n",
5671
			null, true, customOptions);
5672
    }
5673
    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220
5674
    public void test172() {
5675
    	Map customOptions = getCompilerOptions();
5676
    	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING);
5677
        this.runNegativeTest(
5678
            new String[] {
5679
                "X.java",
5680
    			"@SuppressWarnings(\"serial\")\n" + 
5681
    			"public class X extends Exception {\n" +
5682
    			"   @SuppressWarnings(\"nls\")\n" + 
5683
    			"	String s = \"Hello\"; \n" +
5684
    			"   @SuppressWarnings(\"serial\")\n" + 
5685
    			"	String s2 = \"Hello2\"; \n" +
5686
    			"}"
5687
            },
5688
    		"----------\n" + 
5689
    		"1. WARNING in X.java (at line 6)\n" + 
5690
    		"	String s2 = \"Hello2\"; \n" + 
5691
    		"	            ^^^^^^^^\n" + 
5692
    		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
5693
    		"----------\n",
5608
    		"----------\n",
5694
			null, true, customOptions);
5609
			null, true, customOptions);
5695
    }
5610
    }
5696
    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220
5611
    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220
5697
    public void test173() {
5612
    public void test173() {
5698
    	Map customOptions = getCompilerOptions();
5613
    	Map customOptions = getCompilerOptions();
5699
    	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING);
5700
        this.runNegativeTest(
5614
        this.runNegativeTest(
5701
            new String[] {
5615
            new String[] {
5702
                "X.java",
5616
                "X.java",
Lines 5716-5820 Link Here
5716
    		"	public class X extends Exception {\n" + 
5630
    		"	public class X extends Exception {\n" + 
5717
    		"	             ^\n" + 
5631
    		"	             ^\n" + 
5718
    		"The serializable class X does not declare a static final serialVersionUID field of type long\n" + 
5632
    		"The serializable class X does not declare a static final serialVersionUID field of type long\n" + 
5719
    		"----------\n" + 
5720
    		"2. WARNING in X.java (at line 9)\n" + 
5721
    		"	String s2 = \"Hello2\"; \n" + 
5722
    		"	            ^^^^^^^^\n" + 
5723
    		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
5724
    		"----------\n",
5725
			null, true, customOptions);
5726
    }
5727
    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220
5728
    public void test174() {
5729
    	Map customOptions = getCompilerOptions();
5730
    	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING);
5731
        final String source = "@interface Annot {\n" +
5732
    			"    int value() default 0;\n" +
5733
    			"}\n" +
5734
    			"@interface Annot2 {\n" +
5735
    			"    String value();\n" +
5736
    			"}\n" +
5737
    			"@Annot(value=5)\n" + 
5738
    			"public class X {\n" +
5739
    			"   @Annot2(value=\"nls\")\n" + 
5740
    			"	String s = null; \n" +
5741
    			"   @SuppressWarnings(\"serial\")\n" + 
5742
    			"	String s2 = \"Hello2\"; \n" +
5743
    			"}";
5744
		this.runNegativeTest(
5745
            new String[] {
5746
                "X.java",
5747
    			source
5748
            },
5749
            "----------\n" + 
5750
    		"1. WARNING in X.java (at line 12)\n" + 
5751
    		"	String s2 = \"Hello2\"; \n" + 
5752
    		"	            ^^^^^^^^\n" + 
5753
    		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
5754
    		"----------\n",
5755
			null, true, customOptions);
5756
    }
5757
    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220
5758
    public void test175() {
5759
    	Map customOptions = getCompilerOptions();
5760
    	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING);
5761
        final String source = "@interface Annot {\n" +
5762
    			"    int value() default 0;\n" +
5763
    			"}\n" +
5764
    			"@interface Annot2 {\n" +
5765
    			"    String value();\n" +
5766
    			"}\n" +
5767
    			"@Annot(value=5)\n" + 
5768
    			"public class X {\n" +
5769
    			"   @Annot2(value=\"nls\") String s = \"value\"; \n" +
5770
    			"   @SuppressWarnings(\"serial\")\n" + 
5771
    			"	String s2 = \"Hello2\"; \n" +
5772
    			"}";
5773
		this.runNegativeTest(
5774
            new String[] {
5775
                "X.java",
5776
    			source
5777
            },
5778
            "----------\n" + 
5779
    		"1. WARNING in X.java (at line 9)\n" + 
5780
    		"	@Annot2(value=\"nls\") String s = \"value\"; \n" + 
5781
    		"	                                ^^^^^^^\n" + 
5782
    		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
5783
    		"----------\n" + 
5784
    		"2. WARNING in X.java (at line 11)\n" + 
5785
    		"	String s2 = \"Hello2\"; \n" + 
5786
    		"	            ^^^^^^^^\n" + 
5787
    		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
5788
    		"----------\n",
5789
			null, true, customOptions);
5790
    }
5791
    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97220
5792
    public void test176() {
5793
    	Map customOptions = getCompilerOptions();
5794
    	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING);
5795
        final String source = "@interface Annot {\n" +
5796
    			"    int value() default 0;\n" +
5797
    			"}\n" +
5798
    			"@interface Annot2 {\n" +
5799
    			"    String value();\n" +
5800
    			"}\n" +
5801
    			"@Annot(value=5)\n" + 
5802
    			"public class X {\n" +
5803
    			"   @Annot2(value=\"nls\") String s = \"value\"; \n" +
5804
    			"   @SuppressWarnings({\"serial\", \"nls\"})\n" + 
5805
    			"	String s2 = \"Hello2\"; \n" +
5806
    			"	@Annot(value=5) void foo() {}\n" + 
5807
    			"}";
5808
		this.runNegativeTest(
5809
            new String[] {
5810
                "X.java",
5811
    			source
5812
            },
5813
            "----------\n" + 
5814
    		"1. WARNING in X.java (at line 9)\n" + 
5815
    		"	@Annot2(value=\"nls\") String s = \"value\"; \n" + 
5816
    		"	                                ^^^^^^^\n" + 
5817
    		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
5818
    		"----------\n",
5633
    		"----------\n",
5819
			null, true, customOptions);
5634
			null, true, customOptions);
5820
    }
5635
    }
(-)src/org/eclipse/wst/jsdt/core/tests/future/compiler/regression/CastTest.java (-4 lines)
Lines 10-24 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.wst.jsdt.core.tests.future.compiler.regression;
11
package org.eclipse.wst.jsdt.core.tests.future.compiler.regression;
12
12
13
import java.io.File;
14
import java.io.IOException;
15
import java.util.Map;
13
import java.util.Map;
16
14
17
import junit.framework.Test;
15
import junit.framework.Test;
18
16
19
import org.eclipse.wst.jsdt.core.ToolFactory;
20
import org.eclipse.wst.jsdt.core.tests.compiler.regression.AbstractRegressionTest;
17
import org.eclipse.wst.jsdt.core.tests.compiler.regression.AbstractRegressionTest;
21
import org.eclipse.wst.jsdt.core.tests.util.Util;
22
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
18
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
23
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
19
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
24
20
(-)src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiterals15Test.java (-227 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2003, 2007 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.wst.jsdt.core.tests.compiler.regression;
12
13
import java.util.Map;
14
15
import junit.framework.Test;
16
17
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
18
19
public class ExternalizeStringLiterals15Test extends AbstractRegressionTest {
20
21
static {
22
//	TESTS_NAMES = new String[] { "test000" };
23
//	TESTS_NUMBERS = new int[] { 6 };
24
//	TESTS_RANGE = new int[] { 11, -1 };
25
}
26
public ExternalizeStringLiterals15Test(String name) {
27
	super(name);
28
}
29
public static Test suite() {
30
	return buildUniqueComplianceTestSuite(testClass(), COMPLIANCE_1_5);
31
}
32
33
public void test001() {
34
	Map customOptions = getCompilerOptions();
35
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
36
	this.runConformTest(
37
		new String[] {
38
			"X.java",
39
			"import static java.lang.annotation.ElementType.*;\n" +
40
			"import static java.lang.annotation.RetentionPolicy.*;\n" +
41
			"import java.lang.annotation.Retention;\n" +
42
			"import java.lang.annotation.Target;\n" +
43
			"@Target({TYPE, FIELD, METHOD,\r\n" + 
44
			"         PARAMETER, CONSTRUCTOR,\r\n" + 
45
			"         LOCAL_VARIABLE, PACKAGE})\r\n" + 
46
			"@Retention(CLASS)\r\n" + 
47
			"public @interface X\r\n" + 
48
			"{\r\n" + 
49
			"    String[] value() default {};\r\n" + 
50
			"    String justification() default \"\";\r\n" + 
51
			"}"
52
		},
53
		"",
54
		null,
55
		true,
56
		null,
57
		customOptions,
58
		null);
59
}
60
public void test002() {
61
	Map customOptions = getCompilerOptions();
62
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
63
	this.runNegativeTest(
64
		new String[] {
65
			"X.java",
66
			"class X {\n" +
67
			"	String s2 = \"test1\"; //$NON-NLS-1$\n" +
68
			"	String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" +
69
			"	\n" +
70
			"	@SuppressWarnings(\"nls\")\n" +
71
			"	void foo() {\n" +
72
			"		String s4 = null;\n" +
73
			"		String s5 = \"test3\";\n" +
74
			"		String s6 = \"test4\";\n" +
75
			"		System.out.println(\"test5\");\n" +
76
			"	}\n" +
77
			"}",
78
		},
79
		"----------\n" + 
80
		"1. ERROR in X.java (at line 3)\n" + 
81
		"	String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" + 
82
		"	                                  ^^^^^^^^^^^^^\n" + 
83
		"Unnecessary $NON-NLS$ tag\n" + 
84
		"----------\n" + 
85
		"2. ERROR in X.java (at line 8)\n" + 
86
		"	String s5 = \"test3\";\n" + 
87
		"	            ^^^^^^^\n" + 
88
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
89
		"----------\n" + 
90
		"3. ERROR in X.java (at line 9)\n" + 
91
		"	String s6 = \"test4\";\n" + 
92
		"	            ^^^^^^^\n" + 
93
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
94
		"----------\n" + 
95
		"4. ERROR in X.java (at line 10)\n" + 
96
		"	System.out.println(\"test5\");\n" + 
97
		"	                   ^^^^^^^\n" + 
98
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
99
		"----------\n",
100
		null,
101
		true,
102
		customOptions);
103
}
104
public void test003() {
105
	Map customOptions = getCompilerOptions();
106
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
107
	this.runNegativeTest(
108
		new String[] {
109
			"X.java",
110
			"class X {\n" +
111
			"	String s2 = \"test1\"; //$NON-NLS-1$\n" +
112
			"	String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" +
113
			"	\n" +
114
			"	@SuppressWarnings(\"nls\")\n" +
115
			"	void foo() {\n" +
116
			"		String s4 = null;\n" +
117
			"		String s5 = null;//$NON-NLS-1$\n" +
118
			"		String s6 = \"test4\";\n" +
119
			"		System.out.println(\"test5\");\n" +
120
			"	}\n" +
121
			"}",
122
		},
123
		"----------\n" + 
124
		"1. ERROR in X.java (at line 3)\n" + 
125
		"	String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" + 
126
		"	                                  ^^^^^^^^^^^^^\n" + 
127
		"Unnecessary $NON-NLS$ tag\n" + 
128
		"----------\n" + 
129
		"2. ERROR in X.java (at line 8)\n" + 
130
		"	String s5 = null;//$NON-NLS-1$\n" + 
131
		"	                 ^^^^^^^^^^^^^\n" + 
132
		"Unnecessary $NON-NLS$ tag\n" + 
133
		"----------\n" + 
134
		"3. ERROR in X.java (at line 9)\n" + 
135
		"	String s6 = \"test4\";\n" + 
136
		"	            ^^^^^^^\n" + 
137
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
138
		"----------\n" + 
139
		"4. ERROR in X.java (at line 10)\n" + 
140
		"	System.out.println(\"test5\");\n" + 
141
		"	                   ^^^^^^^\n" + 
142
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
143
		"----------\n",
144
		null,
145
		true,
146
		customOptions);
147
}
148
public void test004() {
149
	Map customOptions = getCompilerOptions();
150
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING);
151
	this.runNegativeTest(
152
		new String[] {
153
			"X.java",
154
			"class X {\n" +
155
			"	String s2 = \"test1\"; //$NON-NLS-1$\n" +
156
			"	String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" +
157
			"	\n" +
158
			"	@SuppressWarnings(\"nls\")\n" +
159
			"	void foo() {\n" +
160
			"		String s4 = null;\n" +
161
			"		String s5 = null;//$NON-NLS-1$\n" +
162
			"		String s6 = \"test4\";\n" +
163
			"		System.out.println(\"test5\");\n" +
164
			"	}\n" +
165
			"}",
166
		},
167
		"----------\n" + 
168
		"1. WARNING in X.java (at line 3)\n" + 
169
		"	String s3 = \"test2\"; //$NON-NLS-1$//$NON-NLS-2$\n" + 
170
		"	                                  ^^^^^^^^^^^^^\n" + 
171
		"Unnecessary $NON-NLS$ tag\n" + 
172
		"----------\n",
173
		null,
174
		true,
175
		customOptions);
176
}
177
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162903
178
public void test005() {
179
	Map customOptions = getCompilerOptions();
180
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
181
	this.runNegativeTest(
182
		new String[] {
183
			"X.java",
184
			"class X {\n" +
185
			"	@SuppressWarnings(\"nls\")\n" +
186
			"	void foo() {\n" +
187
			"		String s6 = \"SUCCESS\";\n" +
188
			"		System.out.println(s6);\n" +
189
			"	}\n" +
190
			"}",
191
		},
192
		"----------\n" + 
193
		"1. ERROR in X.java (at line 4)\n" + 
194
		"	String s6 = \"SUCCESS\";\n" + 
195
		"	            ^^^^^^^^^\n" + 
196
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
197
		"----------\n",
198
		null,
199
		true,
200
		customOptions);
201
}
202
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162903
203
public void test006() {
204
	Map customOptions = getCompilerOptions();
205
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.WARNING);
206
	this.runConformTest(
207
		new String[] {
208
			"X.java",
209
			"public class X {\n" +
210
			"	@SuppressWarnings(\"nls\")\n" +
211
			"	public static void main(String[] args) {\n" +
212
			"		String s6 = \"SUCCESS\";\n" +
213
			"		System.out.println(s6);\n" +
214
			"	}\n" +
215
			"}",
216
		},
217
		"SUCCESS",
218
		null,
219
		true,
220
		null,
221
		customOptions,
222
		null);
223
}
224
public static Class testClass() {
225
	return ExternalizeStringLiterals15Test.class;
226
}
227
}
(-)src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InnerEmulationTest.java (-3 lines)
Lines 11-22 Link Here
11
package org.eclipse.wst.jsdt.core.tests.compiler.regression;
11
package org.eclipse.wst.jsdt.core.tests.compiler.regression;
12
12
13
import java.io.File;
13
import java.io.File;
14
import java.io.IOException;
15
14
16
import junit.framework.Test;
15
import junit.framework.Test;
17
16
18
import org.eclipse.wst.jsdt.core.ToolFactory;
19
import org.eclipse.wst.jsdt.core.tests.util.Util;
20
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
17
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
21
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
18
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
22
19
(-)src/org/eclipse/wst/jsdt/core/tests/compiler/regression/TestAll.java (-2 lines)
Lines 54-60 Link Here
54
	standardTests.add(XLargeTest.class);
54
	standardTests.add(XLargeTest.class);
55
	standardTests.add(InternalScannerTest.class);
55
	standardTests.add(InternalScannerTest.class);
56
//	standardTests.add(ConditionalExpressionTest.class);
56
//	standardTests.add(ConditionalExpressionTest.class);
57
	standardTests.add(ExternalizeStringLiteralsTest.class);
58
	standardTests.add(NonFatalErrorTest.class);
57
	standardTests.add(NonFatalErrorTest.class);
59
	standardTests.add(FlowAnalysisTest.class);
58
	standardTests.add(FlowAnalysisTest.class);
60
	standardTests.add(CharOperationTest.class);
59
	standardTests.add(CharOperationTest.class);
Lines 86-92 Link Here
86
	since_1_5.add(InternalHexFloatTest.class);
85
	since_1_5.add(InternalHexFloatTest.class);
87
	since_1_5.add(JavadocTest_1_5.class);
86
	since_1_5.add(JavadocTest_1_5.class);
88
//	since_1_5.add(BatchCompilerTest.class);
87
//	since_1_5.add(BatchCompilerTest.class);
89
	since_1_5.add(ExternalizeStringLiterals15Test.class);
90
//	since_1_5.add(Deprecated15Test.class);
88
//	since_1_5.add(Deprecated15Test.class);
91
89
92
	// Tests to run when compliance is greater than 1.5
90
	// Tests to run when compliance is greater than 1.5
(-)src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ASTImplTests.java (-2 / +1 lines)
Lines 19-26 Link Here
19
import org.eclipse.wst.jsdt.internal.compiler.ast.Argument;
19
import org.eclipse.wst.jsdt.internal.compiler.ast.Argument;
20
import org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression;
20
import org.eclipse.wst.jsdt.internal.compiler.ast.BinaryExpression;
21
import org.eclipse.wst.jsdt.internal.compiler.ast.CharLiteral;
21
import org.eclipse.wst.jsdt.internal.compiler.ast.CharLiteral;
22
import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration;
23
import org.eclipse.wst.jsdt.internal.compiler.ast.CombinedBinaryExpression;
22
import org.eclipse.wst.jsdt.internal.compiler.ast.CombinedBinaryExpression;
23
import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration;
24
import org.eclipse.wst.jsdt.internal.compiler.ast.ExtendedStringLiteral;
24
import org.eclipse.wst.jsdt.internal.compiler.ast.ExtendedStringLiteral;
25
import org.eclipse.wst.jsdt.internal.compiler.ast.JavadocSingleTypeReference;
25
import org.eclipse.wst.jsdt.internal.compiler.ast.JavadocSingleTypeReference;
26
import org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration;
26
import org.eclipse.wst.jsdt.internal.compiler.ast.LocalDeclaration;
Lines 32-38 Link Here
32
import org.eclipse.wst.jsdt.internal.compiler.ast.StringLiteral;
32
import org.eclipse.wst.jsdt.internal.compiler.ast.StringLiteral;
33
import org.eclipse.wst.jsdt.internal.compiler.ast.StringLiteralConcatenation;
33
import org.eclipse.wst.jsdt.internal.compiler.ast.StringLiteralConcatenation;
34
import org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit;
34
import org.eclipse.wst.jsdt.internal.compiler.batch.CompilationUnit;
35
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
36
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
35
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
37
import org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope;
36
import org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope;
38
import org.eclipse.wst.jsdt.internal.compiler.lookup.ClassScope;
37
import org.eclipse.wst.jsdt.internal.compiler.lookup.ClassScope;
(-)src/org/eclipse/wst/jsdt/core/tests/compiler/regression/SerialVersionUIDTests.java (-2 lines)
Lines 16-23 Link Here
16
16
17
import java.util.Map;
17
import java.util.Map;
18
18
19
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
20
21
import junit.framework.Test;
19
import junit.framework.Test;
22
20
23
public class SerialVersionUIDTests extends AbstractRegressionTest {
21
public class SerialVersionUIDTests extends AbstractRegressionTest {
(-)src/org/eclipse/wst/jsdt/core/tests/compiler/regression/ExternalizeStringLiteralsTest.java (-515 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2003, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.wst.jsdt.core.tests.compiler.regression;
12
13
import java.util.Map;
14
15
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
16
17
import junit.framework.Test;
18
19
public class ExternalizeStringLiteralsTest extends AbstractRegressionTest {
20
21
static {
22
//	TESTS_NAMES = new String[] { "test000" };
23
//	TESTS_NUMBERS = new int[] { 16 };
24
//	TESTS_RANGE = new int[] { 11, -1 };
25
}
26
public ExternalizeStringLiteralsTest(String name) {
27
	super(name);
28
}
29
public static Test suite() {
30
	return buildAllCompliancesTestSuite(testClass());
31
}
32
33
public void test001() {
34
	Map customOptions = getCompilerOptions();
35
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
36
	this.runNegativeTest(
37
		new String[] {
38
			"A.js",
39
			"	function foo() {\n" + 
40
			"		println(\"a\");\n" + 
41
			"	} //$NON-NLS-1$	\n" + 
42
			""
43
		},
44
		"----------\n" + 
45
		"1. ERROR in A.js (at line 2)\n" + 
46
		"	println(\"a\");\n" + 
47
		"	                   ^^^\n" + 
48
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
49
		"----------\n" + 
50
		"2. ERROR in A.js (at line 3)\n" + 
51
		"	} //$NON-NLS-1$	\n" + 
52
		"	  ^^^^^^^^^^^^^\n" + 
53
		"Unnecessary $NON-NLS$ tag\n" + 
54
		"----------\n",
55
		null,
56
		true,
57
		customOptions);
58
}
59
60
public void test002() {
61
	Map customOptions = getCompilerOptions();
62
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
63
	this.runNegativeTest(
64
		new String[] {
65
			"X.js",
66
			"	var s = null; //$NON-NLS-1$\n" +
67
			"	var s2 = \"\"; //$NON-NLS-1$\n" +
68
			"	var s3 = \"\"; //$NON-NLS-1$//$NON-NLS-2$\n" +
69
			"	\n" +
70
			"	function foo() {\n" +
71
			"		var s4 = null; //$NON-NLS-1$\n" +
72
			"		var s5 = \"\"; //$NON-NLS-1$\n" +
73
			"		var s6 = \"\"; //$NON-NLS-2$//$NON-NLS-1$\n" +
74
			"		println(\"foo\");//$NON-NLS-1$//$NON-NLS-2$\n" +
75
			"	} //$NON-NLS-1$\n" +
76
			"	//$NON-NLS-1$\n" +
77
			"",
78
		}, 
79
		"----------\n" + 
80
		"1. ERROR in X.js (at line 1)\n" + 
81
		"	var s = null; //$NON-NLS-1$\n" + 
82
		"	                 ^^^^^^^^^^^^^\n" + 
83
		"Unnecessary $NON-NLS$ tag\n" + 
84
		"----------\n" + 
85
		"2. ERROR in X.js (at line 3)\n" + 
86
		"	var s3 = \"\"; //$NON-NLS-1$//$NON-NLS-2$\n" + 
87
		"	                             ^^^^^^^^^^^^^\n" + 
88
		"Unnecessary $NON-NLS$ tag\n" + 
89
		"----------\n" + 
90
		"3. ERROR in X.js (at line 6)\n" + 
91
		"	var s4 = null; //$NON-NLS-1$\n" + 
92
		"	                  ^^^^^^^^^^^^^\n" + 
93
		"Unnecessary $NON-NLS$ tag\n" + 
94
		"----------\n" + 
95
		"4. ERROR in X.js (at line 8)\n" + 
96
		"	var s6 = \"\"; //$NON-NLS-2$//$NON-NLS-1$\n" + 
97
		"	                ^^^^^^^^^^^^^\n" + 
98
		"Unnecessary $NON-NLS$ tag\n" + 
99
		"----------\n" + 
100
		"5. ERROR in X.js (at line 9)\n" + 
101
		"	println(\"foo\");//$NON-NLS-1$//$NON-NLS-2$\n" + 
102
		"	                                       ^^^^^^^^^^^^^\n" + 
103
		"Unnecessary $NON-NLS$ tag\n" + 
104
		"----------\n" + 
105
		"6. ERROR in X.js (at line 10)\n" + 
106
		"	} //$NON-NLS-1$\n" + 
107
		"	  ^^^^^^^^^^^^^\n" + 
108
		"Unnecessary $NON-NLS$ tag\n" + 
109
		"----------\n",
110
		null,
111
		true,
112
		customOptions);
113
}
114
public void test003() {
115
	Map customOptions = getCompilerOptions();
116
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
117
	this.runNegativeTest(
118
		new String[] {
119
			"Foo.js",
120
			"    function foo() {\n" + 
121
			"		println(\"string1\" + \"string2\" //$NON-NLS-1$\n" + 
122
			"		);\n" + 
123
			"",
124
		}, 
125
		"----------\n" + 
126
		"1. ERROR in Foo.js (at line 2)\n" + 
127
		"	println(\"string1\" + \"string2\" //$NON-NLS-1$\n" + 
128
		"	                               ^^^^^^^^^\n" + 
129
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
130
		"----------\n" + 
131
		"2. ERROR in p\\Foo.js (at line 4)\n" + 
132
		"	}\n" + 
133
		"	^\n" + 
134
		"Syntax error, insert \"}\" to complete ClassBody\n" + 
135
		"----------\n",
136
		null,
137
		true,
138
		customOptions);	
139
}
140
public void test004() {
141
	Map customOptions = getCompilerOptions();
142
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
143
	this.runConformTest(
144
		new String[] {
145
			"Foo.js",
146
			"    function foo() {\n" + 
147
			"		//$NON-NLS-1$\n" + 
148
			"	 };\n" + 
149
			"",
150
		}, 
151
		"",
152
		null,
153
		true,
154
		null,
155
		customOptions,
156
		null);	
157
}
158
public void test005() {
159
	Map customOptions = getCompilerOptions();
160
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
161
	this.runNegativeTest(
162
		new String[] {
163
			"X.js",
164
			"	function main( args) {\r\n" + 
165
			"		var s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\r\n" + 
166
			"    }\r\n" + 
167
			"",
168
		}, 
169
		"----------\n" + 
170
		"1. ERROR in X.js (at line 2)\n" + 
171
		"	var s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\n" + 
172
		"	                            ^^^^^^^^^^^^^\n" + 
173
		"Unnecessary $NON-NLS$ tag\n" + 
174
		"----------\n",
175
		null,
176
		true,
177
		customOptions);	
178
}
179
public void test006() {
180
	Map customOptions = getCompilerOptions();
181
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
182
	this.runNegativeTest(
183
		new String[] {
184
			"X.js",
185
			"	public static function main(String[] args) {\r\n" + 
186
			"		var s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\r\n" + 
187
			"    \r\n" +
188
			"",
189
		}, 
190
		"----------\n" + 
191
		"1. ERROR in X.js (at line 2)\n" + 
192
		"	var s = \"\"; //$NON-NLS-1$//$NON-NLS-1$\n" + 
193
		"	                            ^^^^^^^^^^^^^\n" + 
194
		"Unnecessary $NON-NLS$ tag\n" + 
195
		"----------\n" + 
196
		"2. ERROR in X.js (at line 3)\n" + 
197
		"	}\n" + 
198
		"	^\n" + 
199
		"Syntax error, insert \"}\" to complete ClassBody\n" + 
200
		"----------\n",
201
		null,
202
		true,
203
		customOptions);	
204
}
205
public void test007() {
206
	Map customOptions = getCompilerOptions();
207
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
208
	this.runNegativeTest(
209
		new String[] {
210
			"X.js",
211
			"	function main(args) {\r\n" + 
212
			"		var s = null; //$NON-NLS-1$//$NON-NLS-1$\r\n" + 
213
			"    }\r\n" +
214
			"",
215
		}, 
216
		"----------\n" + 
217
		"1. ERROR in X.js (at line 2)\n" + 
218
		"	var s = null; //$NON-NLS-1$//$NON-NLS-1$\n" + 
219
		"	                 ^^^^^^^^^^^^^\n" + 
220
		"Unnecessary $NON-NLS$ tag\n" + 
221
		"----------\n" + 
222
		"2. ERROR in X.js (at line 2)\n" + 
223
		"	var s = null; //$NON-NLS-1$//$NON-NLS-1$\n" + 
224
		"	                              ^^^^^^^^^^^^^\n" + 
225
		"Unnecessary $NON-NLS$ tag\n" + 
226
		"----------\n",
227
		null,
228
		true,
229
		customOptions);	
230
}
231
public void test008() {
232
	Map customOptions = getCompilerOptions();
233
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
234
	this.runNegativeTest(
235
		new String[] {
236
			"X.js",
237
			"	function main(args) {\r\n" + 
238
			"		var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\r\n" + 
239
			"    }\r\n" +
240
			"",
241
		}, 
242
		"----------\n" + 
243
		"1. ERROR in X.js (at line 2)\n" + 
244
		"	var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + 
245
		"	           ^^^^^^\n" + 
246
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
247
		"----------\n" + 
248
		"2. ERROR in X.js (at line 2)\n" + 
249
		"	var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + 
250
		"	                   ^^^^^^^^^^^^^\n" + 
251
		"Unnecessary $NON-NLS$ tag\n" + 
252
		"----------\n" + 
253
		"3. ERROR in X.js (at line 2)\n" + 
254
		"	var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + 
255
		"	                                ^^^^^^^^^^^^^\n" + 
256
		"Unnecessary $NON-NLS$ tag\n" + 
257
		"----------\n",
258
		null,
259
		true,
260
		customOptions);	
261
}
262
public void test009() {
263
	Map customOptions = getCompilerOptions();
264
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
265
	this.runConformTest(
266
		new String[] {
267
			"Foo.js",
268
			"    function foo(i) {\n" + 
269
			"		println(\"test1\" + i + \"test2\"); //$NON-NLS-2$//$NON-NLS-1$\r\n" + 
270
			"	 };\n" + 
271
			"",
272
		}, 
273
		"",
274
		null,
275
		true,
276
		null,
277
		customOptions,
278
		null);	
279
}
280
public void test010() {
281
	Map customOptions = getCompilerOptions();
282
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
283
	this.runNegativeTest(
284
		new String[] {
285
			"X.js",
286
			"	function main(args) {\n" +
287
			"		var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
288
			"		var i = s;\n" +
289
			"		println(s);\n" +
290
			"    }\n" +
291
			"",
292
		}, 
293
		"----------\n" + 
294
		"1. ERROR in X.js (at line 2)\n" + 
295
		"	var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + 
296
		"	           ^^^^^^\n" + 
297
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
298
		"----------\n" + 
299
		"2. ERROR in X.js (at line 2)\n" + 
300
		"	var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + 
301
		"	                   ^^^^^^^^^^^^^\n" + 
302
		"Unnecessary $NON-NLS$ tag\n" + 
303
		"----------\n" + 
304
		"3. ERROR in X.js (at line 2)\n" + 
305
		"	var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + 
306
		"	                                ^^^^^^^^^^^^^\n" + 
307
		"Unnecessary $NON-NLS$ tag\n" + 
308
		"----------\n",
309
		null,
310
		true,
311
		customOptions);	
312
}
313
public void test011() {
314
	Map customOptions = getCompilerOptions();
315
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
316
	this.runNegativeTest(
317
		new String[] {
318
			"X.js",
319
			"	function main(args) {\n" +
320
			"		var i = null;\n" +
321
			"		var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" +
322
			"		println(s + i);\n" +
323
			"    }\n" +
324
			"",
325
		}, 
326
		"----------\n" + 
327
		"2. ERROR in X.js (at line 3)\n" + 
328
		"	var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + 
329
		"	           ^^^^^^\n" + 
330
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
331
		"----------\n" + 
332
		"3. ERROR in X.js (at line 3)\n" + 
333
		"	var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + 
334
		"	                   ^^^^^^^^^^^^^\n" + 
335
		"Unnecessary $NON-NLS$ tag\n" + 
336
		"----------\n" + 
337
		"4. ERROR in X.js (at line 3)\n" + 
338
		"	var s = \"test\"; //$NON-NLS-2$//$NON-NLS-3$\n" + 
339
		"	                                ^^^^^^^^^^^^^\n" + 
340
		"Unnecessary $NON-NLS$ tag\n" + 
341
		"----------\n",
342
		null,
343
		true,
344
		customOptions);	
345
}
346
public void test012() {
347
	Map customOptions = getCompilerOptions();
348
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
349
	this.runNegativeTest(
350
		new String[] {
351
			"X.js",
352
			"	function main(args) {\n" +
353
			"		var i = null;\n" +
354
			"		var s = null; //$NON-NLS-2$//$NON-NLS-3$\n" +
355
			"		println(s + i);\n" +
356
			"    }\n" +
357
			"",
358
		}, 
359
		"----------\n" + 
360
		"2. ERROR in X.js (at line 3)\n" + 
361
		"	var s = null; //$NON-NLS-2$//$NON-NLS-3$\n" + 
362
		"	                 ^^^^^^^^^^^^^\n" + 
363
		"Unnecessary $NON-NLS$ tag\n" + 
364
		"----------\n" + 
365
		"3. ERROR in X.js (at line 3)\n" + 
366
		"	var s = null; //$NON-NLS-2$//$NON-NLS-3$\n" + 
367
		"	                              ^^^^^^^^^^^^^\n" + 
368
		"Unnecessary $NON-NLS$ tag\n" + 
369
		"----------\n",
370
		null,
371
		true,
372
		customOptions);	
373
}
374
public void test013() {
375
	Map customOptions = getCompilerOptions();
376
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
377
	this.runNegativeTest(
378
		new String[] {
379
			"X.js",
380
			"	function main(args) {\n" +
381
			"		var s = \"test1\";\n" +
382
			"		println(s);\n" +
383
			"    }\n" +
384
			"",
385
		}, 
386
		"----------\n" + 
387
		"1. ERROR in X.js (at line 2)\n" + 
388
		"	var s = \"test1\";\n" + 
389
		"	           ^^^^^^^\n" + 
390
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
391
		"----------\n",
392
		null,
393
		true,
394
		customOptions);	
395
}
396
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=112973
397
public void test014() {
398
	Map customOptions = getCompilerOptions();
399
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
400
	this.runNegativeTest(
401
		new String[] {
402
			"X.js",
403
			"	function main(args) {\n" +
404
			"		var s = \"test1\"; //$NON-NLS-?$\n" +
405
			"		println(s);\n" +
406
			"    }\n" +
407
			"",
408
		}, 
409
		"----------\n" + 
410
		"1. ERROR in X.js (at line 2)\n" + 
411
		"	var s = \"test1\"; //$NON-NLS-?$\n" + 
412
		"	           ^^^^^^^\n" + 
413
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
414
		"----------\n" + 
415
		"2. ERROR in X.js (at line 2)\n" + 
416
		"	var s = \"test1\"; //$NON-NLS-?$\n" + 
417
		"	                    ^^^^^^^^^^^^^\n" + 
418
		"Unnecessary $NON-NLS$ tag\n" + 
419
		"----------\n",
420
		null,
421
		true,
422
		customOptions);	
423
}
424
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=114077
425
public void test015() {
426
	Map customOptions = getCompilerOptions();
427
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
428
	this.runNegativeTest(
429
		new String[] {
430
			"X.js",
431
			"	public function foo() {\n" +
432
			"		var s1= null; //$NON-NLS-1$\n" +
433
			"		var s2= \"\";\n" +
434
			"	}\n" +
435
			"",
436
		}, 
437
		"----------\n" + 
438
		"1. ERROR in X.js (at line 2)\n" + 
439
		"	var s1= null; //$NON-NLS-1$\n" + 
440
		"	                 ^^^^^^^^^^^^^\n" + 
441
		"Unnecessary $NON-NLS$ tag\n" + 
442
		"----------\n" + 
443
		"2. ERROR in X.js (at line 3)\n" + 
444
		"	var s2= \"\";\n" + 
445
		"	           ^^\n" + 
446
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
447
		"----------\n",
448
		null,
449
		true,
450
		customOptions);	
451
}
452
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=114077
453
public void test016() {
454
	Map customOptions = getCompilerOptions();
455
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
456
	this.runNegativeTest(
457
		new String[] {
458
			"X.js",
459
			"	var s1= null; //$NON-NLS-1$\n" +
460
			"	\n" +
461
			"	function foo() {\n" +
462
			"		var s2= \"\";\n" +
463
			"	}\n" +
464
			"}",
465
		}, 
466
		"----------\n" + 
467
		"1. ERROR in X.js (at line 1)\n" + 
468
		"	private var s1= null; //$NON-NLS-1$\n" + 
469
		"	                         ^^^^^^^^^^^^^\n" + 
470
		"Unnecessary $NON-NLS$ tag\n" + 
471
		"----------\n" + 
472
		"2. ERROR in X.js (at line 4)\n" + 
473
		"	var s2= \"\";\n" + 
474
		"	           ^^\n" + 
475
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
476
		"----------\n",
477
		null,
478
		true,
479
		customOptions);	
480
}
481
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=148352
482
public void test017() {
483
	Map customOptions = getCompilerOptions();
484
	customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
485
	this.runNegativeTest(
486
		new String[] {
487
			"X.js",
488
			"	function foo(locationInAST) {\n" +
489
			"		var enclosingType= \"\"; //$NON-NLS-1$\n" +
490
			"		if (locationInAST != null) {\n" +
491
			"			enclosingType.toString()\n" +
492
			"		}\n" +
493
			"	}\n" +
494
			"",
495
		}, 
496
		"----------\n" + 
497
		"1. ERROR in X.js (at line 5)\n" + 
498
		"	enclosingType.toString()\n" + 
499
		"	                       ^\n" + 
500
		"Syntax error, insert \";\" to complete BlockStatements\n" + 
501
		"----------\n",
502
		null,
503
		true,
504
		customOptions,
505
		false,
506
		false,
507
		false,
508
		false,
509
		true,
510
		null);	
511
}
512
public static Class testClass() {
513
	return ExternalizeStringLiteralsTest.class;
514
}
515
}
(-)src/org/eclipse/wst/jsdt/core/tests/compiler/regression/BasicResolveTests.java (-2 / +32 lines)
Lines 1134-1139 Link Here
1134
			"count.substring(4, 3);" 
1134
			"count.substring(4, 3);" 
1135
		});
1135
		});
1136
	}
1136
	}
1137
1137
	
1138
1138
	public void testbug234582() {
1139
		this.runNegativeTest(
1140
					new String[] {
1141
							"Z.js",
1142
							"function aaa() {\n" +
1143
								"var localvar = 1;\n" +
1144
								"function myclass() {\n" +
1145
									"myclass.prototype.mymethod = function() {\n" +
1146
										"if(localvar == 1) {\n" +
1147
										"}\n" +
1148
									"};\n" +
1149
								"}\n" +
1150
							"}" 
1151
					},
1152
					""
1153
			);
1154
	}
1155
	
1156
	public void testbug267133() {
1157
		this.runNegativeTest(
1158
					new String[] {
1159
							"Z.js",
1160
							"function cannot_convert_from_boolean_to_Boolean() {\n" +	
1161
								"var returnValue = true;\n" +
1162
								"returnValue = false;\n" +
1163
								"return returnValue;\n" +
1164
							"}"
1165
					},
1166
					""
1167
			);
1168
	}
1139
}
1169
}
(-)src/org/eclipse/wst/jsdt/core/tests/compiler/regression/GenericTypeTest.java (-4 lines)
Lines 10-24 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.wst.jsdt.core.tests.compiler.regression;
11
package org.eclipse.wst.jsdt.core.tests.compiler.regression;
12
12
13
import java.io.File;
14
import java.io.IOException;
15
import java.util.Map;
13
import java.util.Map;
16
14
17
import junit.framework.Test;
15
import junit.framework.Test;
18
16
19
import org.eclipse.wst.jsdt.core.ToolFactory;
20
import org.eclipse.wst.jsdt.core.tests.util.AbstractCompilerTest;
17
import org.eclipse.wst.jsdt.core.tests.util.AbstractCompilerTest;
21
import org.eclipse.wst.jsdt.core.tests.util.Util;
22
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
18
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
23
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
19
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
24
20
(-)src/org/eclipse/wst/jsdt/core/tests/compiler/regression/NonFatalErrorTest.java (-27 lines)
Lines 94-126 Link Here
94
			null);
94
			null);
95
	}
95
	}
96
	
96
	
97
	public void test003() {
98
		Map customOptions = getCompilerOptions();
99
		customOptions.put(CompilerOptions.OPTION_FatalOptionalError, CompilerOptions.DISABLED);
100
		customOptions.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
101
		this.runNegativeTestWithExecution(
102
			new String[] {
103
				"X.java",
104
				"public class X {\n" +
105
				"		 public static void main(String argv[]) {\n" +
106
				"				 System.out.println(\"SUCCESS\");\n" +
107
				"		 }\n" +
108
				"}"
109
			},
110
			"----------\n" + 
111
			"1. ERROR in X.java (at line 3)\n" + 
112
			"	System.out.println(\"SUCCESS\");\n" + 
113
			"	                   ^^^^^^^^^\n" + 
114
			"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
115
			"----------\n",
116
			"SUCCESS",
117
			null,
118
			true,
119
			null,
120
			customOptions,
121
			null);
122
	}
123
	
124
	public void test004() {
97
	public void test004() {
125
		Map customOptions = getCompilerOptions();
98
		Map customOptions = getCompilerOptions();
126
		customOptions.put(CompilerOptions.OPTION_FatalOptionalError, CompilerOptions.DISABLED);
99
		customOptions.put(CompilerOptions.OPTION_FatalOptionalError, CompilerOptions.DISABLED);
(-)src/org/eclipse/wst/jsdt/core/tests/compiler/regression/InferTypesTests.java (+38 lines)
Lines 730-735 Link Here
730
			 );
730
			 );
731
		}
731
		}
732
		
732
		
733
		public void testBugzilla236202() {
734
			CompilationUnitDeclaration declaration = this.runInferTest(
735
				"var Constants = {a:1, b:1};",
736
				"X.js",
737
				"class Constants extends Object{\n  static Number a;\n  static Number b;\n}\n",
738
				getDefaultOptions()
739
				
740
			 );
741
		}
742
		
743
		public void testBugzilla236202b() {
744
			CompilationUnitDeclaration declaration = this.runInferTest(
745
				"function Constants() {};\n" +
746
				"Constants.prototype = {a:1, b:1};",
747
				"X.js",
748
				"class Constants extends Object{\n  static Number a;\n  static Number b;\n}\n",
749
				getDefaultOptions()
750
				
751
			 );
752
		}
753
		
754
		public void testBugzilla234582() {
755
			CompilationUnitDeclaration declaration = this.runInferTest(
756
				"function aaa() {\n" +
757
					"var localvar = 1;\n" +
758
					"globalvar = 2;\n" +
759
					"function myclass() {\n" +
760
						"myclass.prototype.mymethod = function() {\n" +
761
						"}\n" +
762
					"}\n" +
763
				"}",
764
				"X.js",
765
				"class Constants extends Object{\n  static Number a;\n  static Number b;\n}\n",
766
				getDefaultOptions()
767
				
768
			 );
769
		}
770
		
733
771
734
772
735
}
773
}
(-)src/org/eclipse/wst/jsdt/core/tests/compiler/parser/ParserTest.java (-60 lines)
Lines 237-302 Link Here
237
//	);
237
//	);
238
//}
238
//}
239
/*
239
/*
240
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40681
241
 */
242
public void test012() {
243
	Hashtable nls = new Hashtable();
244
	nls.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
245
	this.runNegativeTest(
246
		new String[] {
247
			"X.js",
248
			"	function foo() {\n" +
249
			"		\"foo\".equals(\"bar\");\n" +
250
			"		;\n" +
251
			"}\n"
252
		},
253
		"----------\n" + 
254
		"1. ERROR in X.js (at line 2)\n" + 
255
		"	\"foo\".equals(\"bar\");\n" + 
256
		"	^^^^^\n" + 
257
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
258
		"----------\n" + 
259
		"2. ERROR in X.js (at line 2)\n" + 
260
		"	\"foo\".equals(\"bar\");\n" + 
261
		"	             ^^^^^\n" + 
262
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
263
		"----------\n",
264
		null, // custom classpath
265
		true, // flush previous output dir content
266
		nls // custom options
267
	);
268
}
269
/*
270
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=40681
271
 */
272
public void test013() {
273
	Hashtable nls = new Hashtable();
274
	nls.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.ERROR);
275
	this.runNegativeTest(
276
		new String[] {
277
			"X.js",
278
			"	function foo() {\n" +
279
			"		\"foo\".equals(\"bar\");\n" +
280
			"		//;\n" +
281
			"}\n"
282
		},
283
		"----------\n" + 
284
		"1. ERROR in X.js (at line 2)\n" + 
285
		"	\"foo\".equals(\"bar\");\n" + 
286
		"	^^^^^\n" + 
287
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
288
		"----------\n" + 
289
		"2. ERROR in X.js (at line 2)\n" + 
290
		"	\"foo\".equals(\"bar\");\n" + 
291
		"	             ^^^^^\n" + 
292
		"Non-externalized string literal; it should be followed by //$NON-NLS-<n>$\n" + 
293
		"----------\n",
294
		null, // custom classpath
295
		true, // flush previous output dir content
296
		nls // custom options
297
	);
298
}
299
/*
300
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47227
240
 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=47227
301
 */
241
 */
302
//public void test014() {
242
//public void test014() {
(-)src/org/eclipse/wst/jsdt/core/tests/util/Util.java (-6 / +17 lines)
Lines 10-29 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.wst.jsdt.core.tests.util;
11
package org.eclipse.wst.jsdt.core.tests.util;
12
12
13
import java.io.*;
13
import java.io.BufferedInputStream;
14
import java.io.BufferedOutputStream;
15
import java.io.File;
16
import java.io.FileInputStream;
17
import java.io.FileNotFoundException;
18
import java.io.FileOutputStream;
19
import java.io.IOException;
20
import java.io.InputStream;
21
import java.io.OutputStream;
22
import java.io.PrintWriter;
23
import java.io.StringBufferInputStream;
14
import java.net.ServerSocket;
24
import java.net.ServerSocket;
15
import java.net.URL;
25
import java.net.URL;
16
import java.util.*;
26
import java.util.HashMap;
17
import java.util.zip.*;
27
import java.util.Locale;
28
import java.util.Map;
29
import java.util.zip.ZipEntry;
30
import java.util.zip.ZipInputStream;
31
import java.util.zip.ZipOutputStream;
18
32
19
import org.eclipse.core.internal.resources.Resource;
20
import org.eclipse.core.resources.IContainer;
33
import org.eclipse.core.resources.IContainer;
21
import org.eclipse.core.resources.IResource;
34
import org.eclipse.core.resources.IResource;
22
import org.eclipse.core.runtime.CoreException;
35
import org.eclipse.core.runtime.CoreException;
23
import org.eclipse.core.runtime.IPath;
36
import org.eclipse.core.runtime.IPath;
24
import org.eclipse.core.runtime.Path;
37
import org.eclipse.core.runtime.Path;
25
import org.eclipse.core.runtime.Platform;
26
import org.eclipse.wst.jsdt.core.JavaScriptCore;
27
import org.eclipse.wst.jsdt.core.compiler.CharOperation;
38
import org.eclipse.wst.jsdt.core.compiler.CharOperation;
28
import org.eclipse.wst.jsdt.core.compiler.IProblem;
39
import org.eclipse.wst.jsdt.core.compiler.IProblem;
29
import org.eclipse.wst.jsdt.core.compiler.libraries.SystemLibraryLocation;
40
import org.eclipse.wst.jsdt.core.compiler.libraries.SystemLibraryLocation;
(-)src/org/eclipse/wst/jsdt/internal/compiler/problem/ProblemReporter.java (-245 lines)
Lines 155-163 Link Here
155
		case IProblem.LocalVariableIsNeverUsed :
155
		case IProblem.LocalVariableIsNeverUsed :
156
			return CompilerOptions.UnusedLocalVariable;
156
			return CompilerOptions.UnusedLocalVariable;
157
157
158
		case IProblem.ArgumentIsNeverUsed :
159
			return CompilerOptions.UnusedArgument;
160
161
		case IProblem.NoImplicitStringConversionForCharArrayExpression :
158
		case IProblem.NoImplicitStringConversionForCharArrayExpression :
162
			return CompilerOptions.NoImplicitStringConversion;
159
			return CompilerOptions.NoImplicitStringConversion;
163
160
Lines 167-176 Link Here
167
		case IProblem.NeedToEmulateConstructorAccess :
164
		case IProblem.NeedToEmulateConstructorAccess :
168
			return CompilerOptions.AccessEmulation;
165
			return CompilerOptions.AccessEmulation;
169
166
170
		case IProblem.NonExternalizedStringLiteral :
171
		case IProblem.UnnecessaryNLSTag :
172
			return CompilerOptions.NonExternalizedString;
173
174
		case IProblem.UseAssertAsAnIdentifier :
167
		case IProblem.UseAssertAsAnIdentifier :
175
			return CompilerOptions.AssertUsedAsAnIdentifier;
168
			return CompilerOptions.AssertUsedAsAnIdentifier;
176
169
Lines 228-237 Link Here
228
		case IProblem.FinallyMustCompleteNormally:
221
		case IProblem.FinallyMustCompleteNormally:
229
			return CompilerOptions.FinallyBlockNotCompleting;
222
			return CompilerOptions.FinallyBlockNotCompleting;
230
223
231
		case IProblem.UnusedMethodDeclaredThrownException:
232
		case IProblem.UnusedConstructorDeclaredThrownException:
233
			return CompilerOptions.UnusedDeclaredThrownException;
234
235
		case IProblem.UnqualifiedFieldAccess:
224
		case IProblem.UnqualifiedFieldAccess:
236
			return CompilerOptions.UnqualifiedFieldAccess;
225
			return CompilerOptions.UnqualifiedFieldAccess;
237
226
Lines 243-256 Link Here
243
		case IProblem.UnsafeReturnTypeOverride:
232
		case IProblem.UnsafeReturnTypeOverride:
244
			return CompilerOptions.UncheckedTypeOperation;
233
			return CompilerOptions.UncheckedTypeOperation;
245
234
246
		case IProblem.MissingOverrideAnnotation:
247
			return CompilerOptions.MissingOverrideAnnotation;
248
249
		case IProblem.FieldMissingDeprecatedAnnotation:
250
		case IProblem.MethodMissingDeprecatedAnnotation:
251
		case IProblem.TypeMissingDeprecatedAnnotation:
252
			return CompilerOptions.MissingDeprecatedAnnotation;
253
254
		case IProblem.FinalBoundForTypeVariable:
235
		case IProblem.FinalBoundForTypeVariable:
255
		    return CompilerOptions.FinalParameterBound;
236
		    return CompilerOptions.FinalParameterBound;
256
237
Lines 335-341 Link Here
335
		case IProblem.JavadocParameterMismatch:
316
		case IProblem.JavadocParameterMismatch:
336
		case IProblem.JavadocUndefinedType:
317
		case IProblem.JavadocUndefinedType:
337
		case IProblem.JavadocAmbiguousType:
318
		case IProblem.JavadocAmbiguousType:
338
		case IProblem.JavadocInternalTypeNameProvided:
339
		case IProblem.JavadocNoMessageSendOnArrayType:
319
		case IProblem.JavadocNoMessageSendOnArrayType:
340
		case IProblem.JavadocNoMessageSendOnBaseType:
320
		case IProblem.JavadocNoMessageSendOnBaseType:
341
		case IProblem.JavadocInheritedMethodHidesEnclosingName:
321
		case IProblem.JavadocInheritedMethodHidesEnclosingName:
Lines 351-357 Link Here
351
		case IProblem.JavadocNonGenericConstructor:
331
		case IProblem.JavadocNonGenericConstructor:
352
		case IProblem.JavadocIncorrectArityForParameterizedConstructor:
332
		case IProblem.JavadocIncorrectArityForParameterizedConstructor:
353
		case IProblem.JavadocParameterizedConstructorArgumentTypeMismatch:
333
		case IProblem.JavadocParameterizedConstructorArgumentTypeMismatch:
354
		case IProblem.JavadocTypeArgumentsForRawGenericConstructor:
355
		case IProblem.JavadocNotVisibleField:
334
		case IProblem.JavadocNotVisibleField:
356
		case IProblem.JavadocNotVisibleConstructor:
335
		case IProblem.JavadocNotVisibleConstructor:
357
		case IProblem.JavadocNotVisibleMethod:
336
		case IProblem.JavadocNotVisibleMethod:
Lines 433-441 Link Here
433
					return CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT;
412
					return CategorizedProblem.CAT_NAME_SHADOWING_CONFLICT;
434
413
435
				case (int)CompilerOptions.UnusedLocalVariable:
414
				case (int)CompilerOptions.UnusedLocalVariable:
436
				case (int)CompilerOptions.UnusedArgument:
437
				case (int)CompilerOptions.UnusedPrivateMember:
415
				case (int)CompilerOptions.UnusedPrivateMember:
438
				case (int)CompilerOptions.UnusedDeclaredThrownException:
439
				case (int)CompilerOptions.UnnecessaryTypeCheck:
416
				case (int)CompilerOptions.UnnecessaryTypeCheck:
440
				case (int)CompilerOptions.UnnecessaryElse:
417
				case (int)CompilerOptions.UnnecessaryElse:
441
					return CategorizedProblem.CAT_UNNECESSARY_CODE;
418
					return CategorizedProblem.CAT_UNNECESSARY_CODE;
Lines 443-451 Link Here
443
				case (int)CompilerOptions.UsingDeprecatedAPI:
420
				case (int)CompilerOptions.UsingDeprecatedAPI:
444
					return CategorizedProblem.CAT_DEPRECATION;
421
					return CategorizedProblem.CAT_DEPRECATION;
445
422
446
				case (int)CompilerOptions.NonExternalizedString:
447
					return CategorizedProblem.CAT_NLS;
448
449
				case (int)CompilerOptions.Task:
423
				case (int)CompilerOptions.Task:
450
					return CategorizedProblem.CAT_UNSPECIFIED; // TODO may want to improve
424
					return CategorizedProblem.CAT_UNSPECIFIED; // TODO may want to improve
451
425
Lines 506-512 Link Here
506
	// categorize fatal problems per ID
480
	// categorize fatal problems per ID
507
	switch (problemID) {
481
	switch (problemID) {
508
		case IProblem.IsClassPathCorrect :
482
		case IProblem.IsClassPathCorrect :
509
		case IProblem.CorruptedSignature :
510
			return CategorizedProblem.CAT_BUILDPATH;
483
			return CategorizedProblem.CAT_BUILDPATH;
511
484
512
		default :
485
		default :
Lines 1019-1032 Link Here
1019
		start,
992
		start,
1020
		end);
993
		end);
1021
}
994
}
1022
public void cannotUseSuperInJavaLangObject(ASTNode reference) {
1023
	this.handle(
1024
		IProblem.ObjectHasNoSuperclass,
1025
		NoArgument,
1026
		NoArgument,
1027
		reference.sourceStart,
1028
		reference.sourceEnd);
1029
}
1030
public void caseExpressionMustBeConstant(Expression expression) {
995
public void caseExpressionMustBeConstant(Expression expression) {
1031
	this.handle(
996
	this.handle(
1032
		IProblem.NonConstantExpression,
997
		IProblem.NonConstantExpression,
Lines 1129-1135 Link Here
1129
		case IProblem.JavadocParameterMismatch:
1094
		case IProblem.JavadocParameterMismatch:
1130
		case IProblem.JavadocUndefinedType:
1095
		case IProblem.JavadocUndefinedType:
1131
		case IProblem.JavadocAmbiguousType:
1096
		case IProblem.JavadocAmbiguousType:
1132
		case IProblem.JavadocInternalTypeNameProvided:
1133
		case IProblem.JavadocNoMessageSendOnArrayType:
1097
		case IProblem.JavadocNoMessageSendOnArrayType:
1134
		case IProblem.JavadocNoMessageSendOnBaseType:
1098
		case IProblem.JavadocNoMessageSendOnBaseType:
1135
		case IProblem.JavadocInheritedMethodHidesEnclosingName:
1099
		case IProblem.JavadocInheritedMethodHidesEnclosingName:
Lines 1145-1151 Link Here
1145
		case IProblem.JavadocNonGenericConstructor:
1109
		case IProblem.JavadocNonGenericConstructor:
1146
		case IProblem.JavadocIncorrectArityForParameterizedConstructor:
1110
		case IProblem.JavadocIncorrectArityForParameterizedConstructor:
1147
		case IProblem.JavadocParameterizedConstructorArgumentTypeMismatch:
1111
		case IProblem.JavadocParameterizedConstructorArgumentTypeMismatch:
1148
		case IProblem.JavadocTypeArgumentsForRawGenericConstructor:
1149
		case IProblem.JavadocEmptyReturnTag:
1112
		case IProblem.JavadocEmptyReturnTag:
1150
			if (!this.options.reportInvalidJavadocTags) {
1113
			if (!this.options.reportInvalidJavadocTags) {
1151
				return ProblemSeverities.Ignore;
1114
				return ProblemSeverities.Ignore;
Lines 1254-1268 Link Here
1254
		literal.sourceStart,
1217
		literal.sourceStart,
1255
		literal.sourceEnd);
1218
		literal.sourceEnd);
1256
}
1219
}
1257
public void corruptedSignature(TypeBinding enclosingType, char[] signature, int position) {
1258
	this.handle(
1259
		IProblem.CorruptedSignature,
1260
		new String[] { new String(enclosingType.readableName()), new String(signature), String.valueOf(position) },
1261
		new String[] { new String(enclosingType.shortReadableName()), new String(signature), String.valueOf(position) },
1262
		ProblemSeverities.Error | ProblemSeverities.Abort | ProblemSeverities.Fatal,
1263
		0,
1264
		0);
1265
}
1266
public void deprecatedField(FieldBinding field, ASTNode location) {
1220
public void deprecatedField(FieldBinding field, ASTNode location) {
1267
	int severity = computeSeverity(IProblem.UsingDeprecatedField);
1221
	int severity = computeSeverity(IProblem.UsingDeprecatedField);
1268
	if (severity == ProblemSeverities.Ignore) return;
1222
	if (severity == ProblemSeverities.Ignore) return;
Lines 2399-2415 Link Here
2399
		        (int) importRef.sourcePositions[tokens.length - 1]);
2353
		        (int) importRef.sourcePositions[tokens.length - 1]);
2400
		return;
2354
		return;
2401
	}
2355
	}
2402
	if (expectedImport.problemId() == ProblemReasons.InvalidTypeForStaticImport) {
2403
		char[][] tokens = importRef.tokens;
2404
		String[] arguments = new String[]{CharOperation.toString(tokens)};
2405
		this.handle(
2406
		        IProblem.InvalidTypeForStaticImport,
2407
		        arguments,
2408
		        arguments,
2409
		        importRef.sourceStart,
2410
		        (int) importRef.sourcePositions[tokens.length - 1]);
2411
		return;
2412
	}
2413
	invalidType(importRef, (TypeBinding)expectedImport);
2356
	invalidType(importRef, (TypeBinding)expectedImport);
2414
}
2357
}
2415
public void incompatibleExceptionInThrowsClause(SourceTypeBinding type, MethodBinding currentMethod, MethodBinding inheritedMethod, ReferenceBinding exceptionType) {
2358
public void incompatibleExceptionInThrowsClause(SourceTypeBinding type, MethodBinding currentMethod, MethodBinding inheritedMethod, ReferenceBinding exceptionType) {
Lines 2940-2948 Link Here
2940
		case ProblemReasons.Ambiguous : // 3
2883
		case ProblemReasons.Ambiguous : // 3
2941
			flag = IProblem.AmbiguousType;
2884
			flag = IProblem.AmbiguousType;
2942
			break;
2885
			break;
2943
		case ProblemReasons.InternalNameProvided :
2944
			flag = IProblem.InternalTypeNameProvided;
2945
			break;
2946
		case ProblemReasons.NoError : // 0
2886
		case ProblemReasons.NoError : // 0
2947
		default :
2887
		default :
2948
			needImplementation(); // want to fail to see why we were here...
2888
			needImplementation(); // want to fail to see why we were here...
Lines 3498-3506 Link Here
3498
		case ProblemReasons.Ambiguous :
3438
		case ProblemReasons.Ambiguous :
3499
			id = IProblem.AmbiguousType;
3439
			id = IProblem.AmbiguousType;
3500
			break;
3440
			break;
3501
		case ProblemReasons.InternalNameProvided :
3502
			id = IProblem.InternalTypeNameProvided;
3503
			break;
3504
		case ProblemReasons.InheritedNameHidesEnclosingName :
3441
		case ProblemReasons.InheritedNameHidesEnclosingName :
3505
			id = IProblem.InheritedTypeHidesEnclosingName;
3442
			id = IProblem.InheritedTypeHidesEnclosingName;
3506
			break;
3443
			break;
Lines 4067-4093 Link Here
4067
				sourceStart,
4004
				sourceStart,
4068
				sourceEnd);
4005
				sourceEnd);
4069
			return;
4006
			return;
4070
		case ProblemReasons.TypeArgumentsForRawGenericMethod :
4071
			severity = computeSeverity(IProblem.JavadocTypeArgumentsForRawGenericConstructor);
4072
			if (severity == ProblemSeverities.Ignore) return;
4073
			problemConstructor = (ProblemMethodBinding) targetConstructor;
4074
			shownConstructor = problemConstructor.closestMatch;
4075
			this.handle(
4076
				IProblem.JavadocTypeArgumentsForRawGenericConstructor,
4077
				new String[] {
4078
				        new String(shownConstructor.declaringClass.sourceName()),
4079
				        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, false),
4080
				        new String(shownConstructor.declaringClass.readableName()),
4081
				        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, false) },
4082
				new String[] {
4083
				        new String(shownConstructor.declaringClass.sourceName()),
4084
				        typesAsString(shownConstructor.isVarargs(), shownConstructor.parameters, true),
4085
				        new String(shownConstructor.declaringClass.shortReadableName()),
4086
				        typesAsString(targetConstructor.isVarargs(), targetConstructor.parameters, true) },
4087
				severity,
4088
				sourceStart,
4089
				sourceEnd);
4090
			return;
4091
		case ProblemReasons.NoError : // 0
4007
		case ProblemReasons.NoError : // 0
4092
		default :
4008
		default :
4093
			needImplementation(); // want to fail to see why we were here...
4009
			needImplementation(); // want to fail to see why we were here...
Lines 4387-4395 Link Here
4387
			case ProblemReasons.Ambiguous :
4303
			case ProblemReasons.Ambiguous :
4388
				id = IProblem.JavadocAmbiguousType;
4304
				id = IProblem.JavadocAmbiguousType;
4389
				break;
4305
				break;
4390
			case ProblemReasons.InternalNameProvided :
4391
				id = IProblem.JavadocInternalTypeNameProvided;
4392
				break;
4393
			case ProblemReasons.InheritedNameHidesEnclosingName :
4306
			case ProblemReasons.InheritedNameHidesEnclosingName :
4394
				id = IProblem.JavadocInheritedNameHidesEnclosingTypeName;
4307
				id = IProblem.JavadocInheritedNameHidesEnclosingTypeName;
4395
				break;
4308
				break;
Lines 4758-4803 Link Here
4758
		methodDecl.sourceStart,
4671
		methodDecl.sourceStart,
4759
		methodDecl.sourceEnd);
4672
		methodDecl.sourceEnd);
4760
}
4673
}
4761
public void missingDeprecatedAnnotationForField(FieldDeclaration field) {
4762
	int severity = computeSeverity(IProblem.FieldMissingDeprecatedAnnotation);
4763
	if (severity == ProblemSeverities.Ignore) return;
4764
	FieldBinding binding = field.binding;
4765
	this.handle(
4766
		IProblem.FieldMissingDeprecatedAnnotation,
4767
		new String[] {new String(binding.declaringClass.readableName()), new String(binding.name), },
4768
		new String[] {new String(binding.declaringClass.shortReadableName()), new String(binding.name), },
4769
		severity,
4770
		nodeSourceStart(binding, field),
4771
		nodeSourceEnd(binding, field));
4772
}
4773
public void missingDeprecatedAnnotationForMethod(AbstractMethodDeclaration method) {
4774
	int severity = computeSeverity(IProblem.MethodMissingDeprecatedAnnotation);
4775
	if (severity == ProblemSeverities.Ignore) return;
4776
	MethodBinding binding = method.binding;
4777
	char[] methodSelector = binding.selector;
4778
	if(methodSelector == null)
4779
		methodSelector = method.getSafeName();
4780
	
4781
	this.handle(
4782
		IProblem.MethodMissingDeprecatedAnnotation,
4783
		new String[] {new String(methodSelector), typesAsString(binding.isVarargs(), binding.parameters, false), new String(binding.declaringClass.readableName()), },
4784
		new String[] {new String(methodSelector), typesAsString(binding.isVarargs(), binding.parameters, true), new String(binding.declaringClass.shortReadableName()),},
4785
		severity,
4786
		method.sourceStart,
4787
		method.sourceEnd);
4788
}
4789
public void missingDeprecatedAnnotationForType(TypeDeclaration type) {
4790
	int severity = computeSeverity(IProblem.TypeMissingDeprecatedAnnotation);
4791
	if (severity == ProblemSeverities.Ignore) return;
4792
	TypeBinding binding = type.binding;
4793
	this.handle(
4794
		IProblem.TypeMissingDeprecatedAnnotation,
4795
		new String[] {new String(binding.readableName()), },
4796
		new String[] {new String(binding.shortReadableName()),},
4797
		severity,
4798
		type.sourceStart,
4799
		type.sourceEnd);
4800
}
4801
public void missingEnumConstantCase(SwitchStatement switchStatement, FieldBinding enumConstant) {
4674
public void missingEnumConstantCase(SwitchStatement switchStatement, FieldBinding enumConstant) {
4802
	this.handle(
4675
	this.handle(
4803
		IProblem.MissingEnumConstantCase,
4676
		IProblem.MissingEnumConstantCase,
Lines 4806-4827 Link Here
4806
		switchStatement.expression.sourceStart,
4679
		switchStatement.expression.sourceStart,
4807
		switchStatement.expression.sourceEnd);
4680
		switchStatement.expression.sourceEnd);
4808
}
4681
}
4809
public void missingOverrideAnnotation(AbstractMethodDeclaration method) {
4810
	int severity = computeSeverity(IProblem.MissingOverrideAnnotation);
4811
	if (severity == ProblemSeverities.Ignore) return;
4812
	MethodBinding binding = method.binding;
4813
	char[] methodSelector = binding.selector;
4814
	if(methodSelector == null)
4815
		methodSelector = method.getSafeName();
4816
	
4817
	this.handle(
4818
		IProblem.MissingOverrideAnnotation,
4819
		new String[] {new String(methodSelector), typesAsString(binding.isVarargs(), binding.parameters, false), new String(binding.declaringClass.readableName()), },
4820
		new String[] {new String(methodSelector), typesAsString(binding.isVarargs(), binding.parameters, true), new String(binding.declaringClass.shortReadableName()),},
4821
		severity,
4822
		method.sourceStart,
4823
		method.sourceEnd);
4824
}
4825
public void missingReturnType(AbstractMethodDeclaration methodDecl) {
4682
public void missingReturnType(AbstractMethodDeclaration methodDecl) {
4826
	this.handle(
4683
	this.handle(
4827
		IProblem.MissingReturnType,
4684
		IProblem.MissingReturnType,
Lines 4882-4896 Link Here
4882
		messageSend.sourceStart,
4739
		messageSend.sourceStart,
4883
		messageSend.sourceEnd);
4740
		messageSend.sourceEnd);
4884
}
4741
}
4885
public void nativeMethodsCannotBeStrictfp(ReferenceBinding type, AbstractMethodDeclaration methodDecl) {
4886
	String[] arguments = new String[] {new String(type.sourceName()), new String(methodDecl.getSafeName())};
4887
	this.handle(
4888
		IProblem.NativeMethodsCannotBeStrictfp,
4889
		arguments,
4890
		arguments,
4891
		methodDecl.sourceStart,
4892
		methodDecl.sourceEnd);
4893
}
4894
public void needImplementation() {
4742
public void needImplementation() {
4895
	this.abortDueToInternalError(Messages.abort_missingCode);
4743
	this.abortDueToInternalError(Messages.abort_missingCode);
4896
}
4744
}
Lines 5055-5069 Link Here
5055
		typeDeclaration.sourceStart,
4903
		typeDeclaration.sourceStart,
5056
		typeDeclaration.sourceEnd);
4904
		typeDeclaration.sourceEnd);
5057
}
4905
}
5058
5059
public void nonExternalizedStringLiteral(ASTNode location) {
5060
	this.handle(
5061
		IProblem.NonExternalizedStringLiteral,
5062
		NoArgument,
5063
		NoArgument,
5064
		location.sourceStart,
5065
		location.sourceEnd);
5066
}
5067
public void nonGenericTypeCannotBeParameterized(ASTNode location, TypeBinding type, TypeBinding[] argumentTypes) {
4906
public void nonGenericTypeCannotBeParameterized(ASTNode location, TypeBinding type, TypeBinding[] argumentTypes) {
5068
	this.nonGenericTypeCannotBeParameterized(0, location, type, argumentTypes);
4907
	this.nonGenericTypeCannotBeParameterized(0, location, type, argumentTypes);
5069
}
4908
}
Lines 5208-5237 Link Here
5208
		expression.sourceStart,
5047
		expression.sourceStart,
5209
		expression.sourceEnd);
5048
		expression.sourceEnd);
5210
}
5049
}
5211
public void objectCannotBeGeneric(TypeDeclaration typeDecl) {
5212
	this.handle(
5213
		IProblem.ObjectCannotBeGeneric,
5214
		NoArgument,
5215
		NoArgument,
5216
		typeDecl.typeParameters[0].sourceStart,
5217
		typeDecl.typeParameters[typeDecl.typeParameters.length-1].sourceEnd);
5218
}
5219
public void objectCannotHaveSuperTypes(SourceTypeBinding type) {
5220
	this.handle(
5221
		IProblem.ObjectCannotHaveSuperTypes,
5222
		NoArgument,
5223
		NoArgument,
5224
		type.sourceStart(),
5225
		type.sourceEnd());
5226
}
5227
public void objectMustBeClass(SourceTypeBinding type) {
5228
	this.handle(
5229
		IProblem.ObjectMustBeClass,
5230
		NoArgument,
5231
		NoArgument,
5232
		type.sourceStart(),
5233
		type.sourceEnd());
5234
}
5235
public void operatorOnlyValidOnNumericType(CompoundAssignment  assignment, TypeBinding leftType, TypeBinding rightType) {
5050
public void operatorOnlyValidOnNumericType(CompoundAssignment  assignment, TypeBinding leftType, TypeBinding rightType) {
5236
	String leftName = new String(leftType.readableName());
5051
	String leftName = new String(leftType.readableName());
5237
	String rightName = new String(rightType.readableName());
5052
	String rightName = new String(rightType.readableName());
Lines 6381-6394 Link Here
6381
		instanceofExpression.sourceStart,
6196
		instanceofExpression.sourceStart,
6382
		instanceofExpression.sourceEnd);
6197
		instanceofExpression.sourceEnd);
6383
}
6198
}
6384
public void unnecessaryNLSTags(int sourceStart, int sourceEnd) {
6385
	this.handle(
6386
		IProblem.UnnecessaryNLSTag,
6387
		NoArgument,
6388
		NoArgument,
6389
		sourceStart,
6390
		sourceEnd);
6391
}
6392
public void unqualifiedFieldAccess(NameReference reference, FieldBinding field) {
6199
public void unqualifiedFieldAccess(NameReference reference, FieldBinding field) {
6393
	int sourceStart = reference.sourceStart;
6200
	int sourceStart = reference.sourceStart;
6394
	int sourceEnd = reference.sourceEnd;
6201
	int sourceEnd = reference.sourceEnd;
Lines 6532-6589 Link Here
6532
		expression.sourceStart,
6339
		expression.sourceStart,
6533
		expression.sourceEnd);
6340
		expression.sourceEnd);
6534
}
6341
}
6535
public void unusedArgument(LocalDeclaration localDecl) {
6536
	int severity = computeSeverity(IProblem.ArgumentIsNeverUsed);
6537
	if (severity == ProblemSeverities.Ignore) return;
6538
	String[] arguments = new String[] {new String(localDecl.name)};
6539
	this.handle(
6540
		IProblem.ArgumentIsNeverUsed,
6541
		arguments,
6542
		arguments,
6543
		severity,
6544
		localDecl.sourceStart,
6545
		localDecl.sourceEnd);
6546
}
6547
public void unusedDeclaredThrownException(ReferenceBinding exceptionType, AbstractMethodDeclaration method, ASTNode location) {
6548
	boolean isConstructor = method.isConstructor();
6549
	int severity = computeSeverity(isConstructor ? IProblem.UnusedConstructorDeclaredThrownException : IProblem.UnusedMethodDeclaredThrownException);
6550
	if (severity == ProblemSeverities.Ignore) return;
6551
	if (isConstructor) {
6552
		this.handle(
6553
			IProblem.UnusedConstructorDeclaredThrownException,
6554
			new String[] {
6555
				new String(method.binding.declaringClass.readableName()),
6556
				typesAsString(method.binding.isVarargs(), method.binding.parameters, false),
6557
				new String(exceptionType.readableName()),
6558
			 },
6559
			new String[] {
6560
				new String(method.binding.declaringClass.shortReadableName()),
6561
				typesAsString(method.binding.isVarargs(), method.binding.parameters, true),
6562
				new String(exceptionType.shortReadableName()),
6563
			 },
6564
			severity,
6565
			location.sourceStart,
6566
			location.sourceEnd);
6567
	} else {
6568
		this.handle(
6569
			IProblem.UnusedMethodDeclaredThrownException,
6570
			new String[] {
6571
				new String(method.binding.declaringClass.readableName()),
6572
				new String(method.getSafeName()),
6573
				typesAsString(method.binding.isVarargs(), method.binding.parameters, false),
6574
				new String(exceptionType.readableName()),
6575
			 },
6576
			new String[] {
6577
				new String(method.binding.declaringClass.shortReadableName()),
6578
				new String(method.getSafeName()),
6579
				typesAsString(method.binding.isVarargs(), method.binding.parameters, true),
6580
				new String(exceptionType.shortReadableName()),
6581
			 },
6582
			severity,
6583
			location.sourceStart,
6584
			location.sourceEnd);
6585
	}
6586
}
6587
public void unusedLabel(LabeledStatement statement) {
6342
public void unusedLabel(LabeledStatement statement) {
6588
	int severity = computeSeverity(IProblem.UnusedLabel);
6343
	int severity = computeSeverity(IProblem.UnusedLabel);
6589
	if (severity == ProblemSeverities.Ignore) return;
6344
	if (severity == ProblemSeverities.Ignore) return;
(-)src/org/eclipse/wst/jsdt/internal/compiler/problem/messages.properties (-60 lines)
Lines 9-20 Link Here
9
#     IBM Corporation - initial API and implementation
9
#     IBM Corporation - initial API and implementation
10
###############################################################################
10
###############################################################################
11
0 = {0}
11
0 = {0}
12
1 = super cannot be used in java.lang.Object
13
2 = {0} cannot be resolved to a type
12
2 = {0} cannot be resolved to a type
14
3 = The type {0} is not visible
13
3 = The type {0} is not visible
15
4 = The type {0} is ambiguous
14
4 = The type {0} is ambiguous
16
5 = The type {0} is deprecated
15
5 = The type {0} is deprecated
17
6 = The nested type {0} cannot be referenced using its binary name
18
7 = The type {0} is never used locally
16
7 = The type {0} is never used locally
19
17
20
15 = Incompatible operand types {0} and {1}
18
15 = Incompatible operand types {0} and {1}
Lines 40-46 Link Here
40
50 = {0} cannot be resolved
38
50 = {0} cannot be resolved
41
51 = The local variable {0} may not have been initialized
39
51 = The local variable {0} may not have been initialized
42
52 = void is an invalid type for the variable {0}
40
52 = void is an invalid type for the variable {0}
43
###[obsolete] 53 = An array of void is an invalid type for the variable {0}
44
54 = void[] is an invalid type
41
54 = void[] is an invalid type
45
55 = Duplicate local variable {0}
42
55 = Duplicate local variable {0}
46
56 = Duplicate parameter {0}
43
56 = Duplicate parameter {0}
Lines 254-272 Link Here
254
326 = A package must be specified in {0} or a default package created
251
326 = A package must be specified in {0} or a default package created
255
327 = The hierarchy of the type {0} is inconsistent
252
327 = The hierarchy of the type {0} is inconsistent
256
328 = The declared package "{1}" does not match the expected package "{0}"
253
328 = The declared package "{1}" does not match the expected package "{0}"
257
329 = The type java.lang.Object cannot have a superclass or superinterfaces
258
330 = The type java.lang.Object must be a class
259
260
###[obsolete] 330 = {0} cannot be resolved or is not a valid superclass
261
###[obsolete] 331 = Superclass {0} is not visible
262
###[obsolete] 332 = Superclass {0} is ambiguous
263
###[obsolete] 333 = Superclass {0} cannot be referenced using its binary name
264
###[obsolete] 334 = Superclass {0} is defined in an inherited type and an enclosing scope
265
###[obsolete] 335 = {0} cannot be resolved or is not a valid superinterface
266
###[obsolete] 336 = Superinterface {0} is not visible
267
###[obsolete] 337 = Superinterface {0} is ambiguous
268
###[obsolete] 338 = Superinterface {0} cannot be referenced using its binary name
269
###[obsolete] 339 = Superinterface {0} is defined in an inherited type and an enclosing scope
270
254
271
340 = Duplicate field {0}.{1}
255
340 = Duplicate field {0}.{1}
272
341 = Duplicate modifier for the field {0}
256
341 = Duplicate modifier for the field {0}
Lines 276-287 Link Here
276
345 = The field {0} can be either final or volatile, not both
260
345 = The field {0} can be either final or volatile, not both
277
346 = The field {0} cannot be declared static; static fields can only be declared in static or top level types
261
346 = The field {0} cannot be declared static; static fields can only be declared in static or top level types
278
262
279
###[obsolete] 350 = {2} cannot be resolved (or is not a valid type) for the field {1}.{0}
280
###[obsolete] 351 = The type {2} is not visible for the field {1}.{0}
281
###[obsolete] 352 = The type {2} is ambiguous for the field {1}.{0}
282
###[obsolete] 353 = The field type {2} cannot be referenced using its binary name
283
###[obsolete] 354 = The field type {2} is defined in an inherited type and an enclosing scope
284
285
355 = Duplicate function {0}({2}) in type {1}
263
355 = Duplicate function {0}({2}) in type {1}
286
356 = Illegal modifier for parameter {0}; only final is permitted
264
356 = Illegal modifier for parameter {0}; only final is permitted
287
357 = Duplicate modifier for the function {1} in type {0}
265
357 = Duplicate modifier for the function {1} in type {0}
Lines 292-336 Link Here
292
362 = The abstract function {1} in type {0} can only set a visibility modifier, one of public or protected
270
362 = The abstract function {1} in type {0} can only set a visibility modifier, one of public or protected
293
363 = The abstract function {1} in type {0} can only be defined by an abstract class
271
363 = The abstract function {1} in type {0} can only be defined by an abstract class
294
364 = void is an invalid type for the parameter {1} of the function {0}
272
364 = void is an invalid type for the parameter {1} of the function {0}
295
###[obsolete] 365 = An array of void is an invalid type for the parameter {1} of the function {0}
296
###[obsolete] 366 = An array of void is an invalid return type for the function {0}
297
367 = The native function {1} cannot also be declared strictfp
298
368 = Duplicate modifier for parameter {0}
273
368 = Duplicate modifier for parameter {0}
299
274
300
###[obsolete] 370 = {2} cannot be resolved (or is not a valid type) for the parameter {1} of the function {0}
301
###[obsolete] 371 = The type {2} is not visible for the parameter {1} of the function {0}
302
###[obsolete] 372 = The type {2} is ambiguous for the parameter {1} of the function {0}
303
###[obsolete] 373 = The parameter type {2} cannot be referenced using its binary name
304
###[obsolete] 374 = The parameter type {2} is defined in an inherited type and an enclosing scope
305
###[obsolete] 375 = {1} cannot be resolved (or is not an exception type) for the function {0}
306
###[obsolete] 376 = The exception type {1} is not visible for the function {0}
307
###[obsolete] 377 = The exception type {1} is ambiguous for the function {0}
308
###[obsolete] 378 = The exception type {1} cannot be referenced using its binary name
309
###[obsolete] 379 = The exception type {1} is defined in an inherited type and an enclosing scope
310
###[obsolete] 380 = {1} cannot be resolved (or is not a valid return type) for the function {0}
311
###[obsolete] 381 = The return type {1} is not visible for the function {0}
312
###[obsolete] 382 = The return type {1} is ambiguous for the function {0}
313
###[obsolete] 383 = The return type {1} cannot be referenced using its binary name
314
###[obsolete] 384 = The return type {1} is defined in an inherited type and an enclosing scope
315
316
385 = The import {0} conflicts with a type defined in the same file
275
385 = The import {0} conflicts with a type defined in the same file
317
386 = The import {0} collides with another import statement
276
386 = The import {0} collides with another import statement
318
387 = Only a type can be imported. {0} resolves to a package
277
387 = Only a type can be imported. {0} resolves to a package
319
388 = The import {0} is never used
320
390 = The import {0} cannot be resolved
278
390 = The import {0} cannot be resolved
321
279
322
###[obsolete] 391 = The imported type {0} is not visible
323
###[obsolete] 392 = The imported type {0} is ambiguous
324
###[obsolete] 393 = The imported type {0} cannot be referenced using its binary name
325
###[obsolete] 394 = The imported type {0} is defined in an inherited type and an enclosing scope
326
327
391 = The static import {0} must be a field or member type
280
391 = The static import {0} must be a field or member type
328
281
329
395 = Duplicate modifier for the variable {0}
282
395 = Duplicate modifier for the variable {0}
330
396 = Illegal modifier for the variable {0}; only final is permitted
283
396 = Illegal modifier for the variable {0}; only final is permitted
331
###[obsolete] 397 = Redundant null check: The variable {0} cannot be null at this location
332
###[obsolete] 398 = Null pointer access: The variable {0} can only be null at this location
333
###[obsolete] 399 = Potential null pointer access: The variable {0} may be null at this location
334
	
284
	
335
400 = The type {3} must implement the inherited abstract function {2}.{0}({1})
285
400 = The type {3} must implement the inherited abstract function {2}.{0}({1})
336
401 = Cannot override the final function from {0}
286
401 = Cannot override the final function from {0}
Lines 420-426 Link Here
420
504 = The type {0} is not visible
370
504 = The type {0} is not visible
421
505 = The type {0} is ambiguous
371
505 = The type {0} is ambiguous
422
506 = The type {0} is deprecated
372
506 = The type {0} is deprecated
423
507 = The nested type {0} cannot be referenced using its binary name
424
508 = The function {1} is defined in an inherited type and an enclosing scope
373
508 = The function {1} is defined in an inherited type and an enclosing scope
425
509 = The field {0} is defined in an inherited type and an enclosing scope 
374
509 = The field {0} is defined in an inherited type and an enclosing scope 
426
510 = The type {0} is defined in an inherited type and an enclosing scope
375
510 = The type {0} is defined in an inherited type and an enclosing scope
Lines 438-444 Link Here
438
520 = Duplicate type parameter {0}
387
520 = Duplicate type parameter {0}
439
521 = Cannot refer to the type parameter {0} as a supertype
388
521 = Cannot refer to the type parameter {0} as a supertype
440
522 = Cannot make a static reference to the non-static type {0}
389
522 = Cannot make a static reference to the non-static type {0}
441
523 = The type java.lang.Object cannot be declared as a generic
442
524 = The type {0} is not generic; it cannot be parameterized with arguments <{1}>
390
524 = The type {0} is not generic; it cannot be parameterized with arguments <{1}>
443
525 = Incorrect number of arguments for type {0}; it cannot be parameterized with arguments <{1}>
391
525 = Incorrect number of arguments for type {0}; it cannot be parameterized with arguments <{1}>
444
526 = Bound mismatch: The type {0} is not a valid substitute for the bounded parameter <{2} extends {3}> of the type {1}
392
526 = Bound mismatch: The type {0} is not a valid substitute for the bounded parameter <{2} extends {3}> of the type {1}
Lines 537-554 Link Here
537
624 = Annotation type declaration cannot have a constructor
485
624 = Annotation type declaration cannot have a constructor
538
625 = The value for annotation attribute {0}.{1} must be some @{2} annotation 
486
625 = The value for annotation attribute {0}.{1} must be some @{2} annotation 
539
626 = The annotation type {0} should not be used as a superinterface for {1}
487
626 = The annotation type {0} should not be used as a superinterface for {1}
540
627 = The function {0}({1}) of type {2} should be tagged with @Override since it actually overrides a superclass function
541
628 = The deprecated field {0}.{1} should be annotated with @Deprecated
542
629 = The deprecated function {0}({1}) of type {2} should be annotated with @Deprecated
543
630 = The deprecated type {0} should be annotated with @Deprecated
544
631 = Unhandled warning token {0}
488
631 = Unhandled warning token {0}
545
632 = The value for annotation attribute {0}.{1} must be an array initializer
489
632 = The value for annotation attribute {0}.{1} must be an array initializer
546
633 = The value for annotation attribute {0}.{1} must be an enum constant expression
490
633 = The value for annotation attribute {0}.{1} must be an enum constant expression
547
634 = The function {0}({1}) of type {2} must override or implement a supertype function
491
634 = The function {0}({1}) of type {2} must override or implement a supertype function
548
492
549
### CORRUPTED BINARIES
550
700 = The class file {0} contains a signature ''{1}'' ill-formed at position {2}
551
552
### CORRUPTED SOURCES
493
### CORRUPTED SOURCES
553
701 = Cannot read the source from {0}; either the file uses a different encoding than {1} or it is corrupted
494
701 = Cannot read the source from {0}; either the file uses a different encoding than {1} or it is corrupted
554
702 = Cannot read the source from {0} due to internal exception {1}
495
702 = Cannot read the source from {0} due to internal exception {1}
Lines 588-591 Link Here
588
856 = The constructor {0}({1}) of type {2} is not generic; it cannot be parameterized with arguments <{3}>
529
856 = The constructor {0}({1}) of type {2} is not generic; it cannot be parameterized with arguments <{3}>
589
857 = Incorrect number of type arguments for generic constructor <{3}>{0}({1}) of type {2}; it cannot be parameterized with arguments <{4}>
530
857 = Incorrect number of type arguments for generic constructor <{3}>{0}({1}) of type {2}; it cannot be parameterized with arguments <{4}>
590
858 = The parameterized constructor <{3}>{0}({1}) of type {2} is not applicable for the arguments ({4})
531
858 = The parameterized constructor <{3}>{0}({1}) of type {2} is not applicable for the arguments ({4})
591
859 = The constructor {0}({1}) of raw type {2} is no longer generic; it cannot be parameterized with arguments <{3}>
(-)src/org/eclipse/wst/jsdt/internal/compiler/problem/DefaultProblem.java (-2 lines)
Lines 163-170 Link Here
163
			return "unnecessary code"; //$NON-NLS-1$
163
			return "unnecessary code"; //$NON-NLS-1$
164
		case CAT_UNCHECKED_RAW:
164
		case CAT_UNCHECKED_RAW:
165
			return "unchecked/raw"; //$NON-NLS-1$
165
			return "unchecked/raw"; //$NON-NLS-1$
166
		case CAT_NLS:
167
			return "nls"; //$NON-NLS-1$
168
		case CAT_RESTRICTION:
166
		case CAT_RESTRICTION:
169
			return "restriction"; //$NON-NLS-1$
167
			return "restriction"; //$NON-NLS-1$
170
	}
168
	}
(-)src/org/eclipse/wst/jsdt/internal/compiler/lookup/MethodScope.java (-8 lines)
Lines 207-220 Link Here
207
		if (methodBinding.declaringClass.isFinal())
207
		if (methodBinding.declaringClass.isFinal())
208
			modifiers |= AccFinal;
208
			modifiers |= AccFinal;
209
		*/
209
		*/
210
		// native methods cannot also be tagged as strictfp
211
		if ((modifiers & ClassFileConstants.AccNative) != 0 && (modifiers & ClassFileConstants.AccStrictfp) != 0)
212
			problemReporter().nativeMethodsCannotBeStrictfp(declaringClass, (AbstractMethodDeclaration) referenceContext);
213
214
//		// static members are only authorized in a static member or top level type
215
//		if (((realModifiers & ClassFileConstants.AccStatic) != 0) && declaringClass.isNestedType() && !declaringClass.isStatic())
216
//			problemReporter().unexpectedStaticModifierForMethod(declaringClass, (AbstractMethodDeclaration) referenceContext);
217
218
		methodBinding.modifiers = modifiers;
210
		methodBinding.modifiers = modifiers;
219
	}
211
	}
220
212
(-)src/org/eclipse/wst/jsdt/internal/compiler/lookup/LookupEnvironment.java (-5 / +1 lines)
Lines 1125-1133 Link Here
1125
		return null;
1125
		return null;
1126
	referenceBinding = BinaryTypeBinding.resolveType(referenceBinding, this, false); // no raw conversion for now
1126
	referenceBinding = BinaryTypeBinding.resolveType(referenceBinding, this, false); // no raw conversion for now
1127
1127
1128
	// compoundName refers to a nested type incorrectly (for example, package1.A$B)
1129
	if (referenceBinding.isNestedType())
1130
		return new ProblemReferenceBinding(compoundName, referenceBinding, InternalNameProvided);
1131
	return referenceBinding;
1128
	return referenceBinding;
1132
}
1129
}
1133
private TypeBinding[] getTypeArgumentsFromSignature(SignatureWrapper wrapper, TypeVariableBinding[] staticVariables, ReferenceBinding enclosingType, ReferenceBinding genericType) {
1130
private TypeBinding[] getTypeArgumentsFromSignature(SignatureWrapper wrapper, TypeVariableBinding[] staticVariables, ReferenceBinding enclosingType, ReferenceBinding genericType) {
Lines 1225-1232 Link Here
1225
				binding = TypeBinding.SHORT;
1222
				binding = TypeBinding.SHORT;
1226
				break;
1223
				break;
1227
			default :
1224
			default :
1228
				problemReporter.corruptedSignature(enclosingType, signature, start);
1225
				break;
1229
				// will never reach here, since error will cause abort
1230
		}
1226
		}
1231
	} else {
1227
	} else {
1232
		binding = getTypeFromConstantPoolName(signature, start + 1, end, isParameterized); // skip leading 'L' or 'T'
1228
		binding = getTypeFromConstantPoolName(signature, start + 1, end, isParameterized); // skip leading 'L' or 'T'
(-)src/org/eclipse/wst/jsdt/internal/compiler/lookup/ClassScope.java (-5 lines)
Lines 353-359 Link Here
353
		sourceType.typeVariables = Binding.NO_TYPE_VARIABLES; // safety
353
		sourceType.typeVariables = Binding.NO_TYPE_VARIABLES; // safety
354
354
355
		if (sourceType.id == T_JavaLangObject) { // handle the case of redefining java.lang.Object up front
355
		if (sourceType.id == T_JavaLangObject) { // handle the case of redefining java.lang.Object up front
356
			problemReporter().objectCannotBeGeneric(referenceContext);
357
			return;
356
			return;
358
		}
357
		}
359
		sourceType.typeVariables = createTypeVariables(typeParameters, sourceType);
358
		sourceType.typeVariables = createTypeVariables(typeParameters, sourceType);
Lines 831-840 Link Here
831
		if (sourceType.id == T_JavaLangObject) { // handle the case of redefining java.lang.Object up front
830
		if (sourceType.id == T_JavaLangObject) { // handle the case of redefining java.lang.Object up front
832
			sourceType.superclass = null;
831
			sourceType.superclass = null;
833
			sourceType.superInterfaces = Binding.NO_SUPERINTERFACES;
832
			sourceType.superInterfaces = Binding.NO_SUPERINTERFACES;
834
			if (!sourceType.isClass())
835
				problemReporter().objectMustBeClass(sourceType);
836
//			if (referenceContext.superclass != null || (referenceContext.superInterfaces != null && referenceContext.superInterfaces.length > 0))
837
//				problemReporter().objectCannotHaveSuperTypes(sourceType);
838
			return true; // do not propagate Object's hierarchy problems down to every subtype
833
			return true; // do not propagate Object's hierarchy problems down to every subtype
839
		}
834
		}
840
		if ( (referenceContext!=null && referenceContext.superclass == null) || (inferredType!=null && inferredType.superClass==null)) {
835
		if ( (referenceContext!=null && referenceContext.superclass == null) || (inferredType!=null && inferredType.superClass==null)) {
(-)src/org/eclipse/wst/jsdt/internal/compiler/lookup/ProblemReasons.java (-1 lines)
Lines 15-21 Link Here
15
	final int NotFound = 1;
15
	final int NotFound = 1;
16
	final int NotVisible = 2;
16
	final int NotVisible = 2;
17
	final int Ambiguous = 3;
17
	final int Ambiguous = 3;
18
	final int InternalNameProvided = 4; // used if an internal name is used in source
19
	final int InheritedNameHidesEnclosingName = 5;
18
	final int InheritedNameHidesEnclosingName = 5;
20
	final int NonStaticReferenceInConstructorInvocation = 6;
19
	final int NonStaticReferenceInConstructorInvocation = 6;
21
	final int NonStaticReferenceInStaticContext = 7;
20
	final int NonStaticReferenceInStaticContext = 7;
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/FieldDeclaration.java (-8 lines)
Lines 26-32 Link Here
26
import org.eclipse.wst.jsdt.internal.compiler.lookup.MethodScope;
26
import org.eclipse.wst.jsdt.internal.compiler.lookup.MethodScope;
27
import org.eclipse.wst.jsdt.internal.compiler.lookup.Scope;
27
import org.eclipse.wst.jsdt.internal.compiler.lookup.Scope;
28
import org.eclipse.wst.jsdt.internal.compiler.lookup.SourceTypeBinding;
28
import org.eclipse.wst.jsdt.internal.compiler.lookup.SourceTypeBinding;
29
import org.eclipse.wst.jsdt.internal.compiler.lookup.TagBits;
30
import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding;
29
import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding;
31
30
32
public class FieldDeclaration extends AbstractVariableDeclaration implements IFieldDeclaration {
31
public class FieldDeclaration extends AbstractVariableDeclaration implements IFieldDeclaration {
Lines 168-180 Link Here
168
		initializationScope.initializedField = this.binding;
167
		initializationScope.initializedField = this.binding;
169
		initializationScope.lastVisibleFieldID = this.binding.id;
168
		initializationScope.lastVisibleFieldID = this.binding.id;
170
169
171
//		resolveAnnotations(initializationScope, this.annotations, this.binding);
172
		// check @Deprecated annotation presence
173
		if ((this.binding.getAnnotationTagBits() & TagBits.AnnotationDeprecated) == 0
174
				&& (this.binding.modifiers & ClassFileConstants.AccDeprecated) != 0
175
				&& initializationScope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) {
176
			initializationScope.problemReporter().missingDeprecatedAnnotationForField(this);
177
		}
178
		// the resolution of the initialization hasn't been done
170
		// the resolution of the initialization hasn't been done
179
		if (this.initialization == null) {
171
		if (this.initialization == null) {
180
			this.binding.setConstant(Constant.NotAConstant);
172
			this.binding.setConstant(Constant.NotAConstant);
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/QualifiedSuperReference.java (-1 lines)
Lines 49-55 Link Here
49
			return null; // error case
49
			return null; // error case
50
50
51
		if (currentCompatibleType.id == T_JavaLangObject) {
51
		if (currentCompatibleType.id == T_JavaLangObject) {
52
			scope.problemReporter().cannotUseSuperInJavaLangObject(this);
53
			return null;
52
			return null;
54
		}
53
		}
55
		return this.resolvedType = currentCompatibleType.superclass();
54
		return this.resolvedType = currentCompatibleType.superclass();
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/SuperReference.java (-1 lines)
Lines 58-64 Link Here
58
			return null;
58
			return null;
59
		ReferenceBinding enclosingReceiverType = scope.enclosingReceiverType();
59
		ReferenceBinding enclosingReceiverType = scope.enclosingReceiverType();
60
		if (enclosingReceiverType.id == T_JavaLangObject) {
60
		if (enclosingReceiverType.id == T_JavaLangObject) {
61
			scope.problemReporter().cannotUseSuperInJavaLangObject(this);
62
			return null;
61
			return null;
63
		}
62
		}
64
		return this.resolvedType = enclosingReceiverType.superclass();
63
		return this.resolvedType = enclosingReceiverType.superclass();
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/TypeDeclaration.java (-6 lines)
Lines 862-873 Link Here
862
//		} finally {
862
//		} finally {
863
//			this.staticInitializerScope.insideTypeAnnotation = old;
863
//			this.staticInitializerScope.insideTypeAnnotation = old;
864
//		}
864
//		}
865
		// check @Deprecated annotation
866
		if ((sourceType.getAnnotationTagBits() & TagBits.AnnotationDeprecated) == 0
867
				&& (sourceType.modifiers & ClassFileConstants.AccDeprecated) != 0
868
				&& this.scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) {
869
			this.scope.problemReporter().missingDeprecatedAnnotationForType(this);
870
		}
871
		if ((this.bits & ASTNode.UndocumentedEmptyBlock) != 0) {
865
		if ((this.bits & ASTNode.UndocumentedEmptyBlock) != 0) {
872
			this.scope.problemReporter().undocumentedEmptyBlock(this.bodyStart-1, this.bodyEnd);
866
			this.scope.problemReporter().undocumentedEmptyBlock(this.bodyStart-1, this.bodyEnd);
873
		}
867
		}
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/AbstractMethodDeclaration.java (-9 lines)
Lines 26-32 Link Here
26
import org.eclipse.wst.jsdt.internal.compiler.flow.FlowContext;
26
import org.eclipse.wst.jsdt.internal.compiler.flow.FlowContext;
27
import org.eclipse.wst.jsdt.internal.compiler.flow.FlowInfo;
27
import org.eclipse.wst.jsdt.internal.compiler.flow.FlowInfo;
28
import org.eclipse.wst.jsdt.internal.compiler.impl.ReferenceContext;
28
import org.eclipse.wst.jsdt.internal.compiler.impl.ReferenceContext;
29
30
import org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding;
29
import org.eclipse.wst.jsdt.internal.compiler.lookup.AnnotationBinding;
31
import org.eclipse.wst.jsdt.internal.compiler.lookup.Binding;
30
import org.eclipse.wst.jsdt.internal.compiler.lookup.Binding;
32
import org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope;
31
import org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope;
Lines 37-43 Link Here
37
import org.eclipse.wst.jsdt.internal.compiler.lookup.ReferenceBinding;
36
import org.eclipse.wst.jsdt.internal.compiler.lookup.ReferenceBinding;
38
import org.eclipse.wst.jsdt.internal.compiler.lookup.Scope;
37
import org.eclipse.wst.jsdt.internal.compiler.lookup.Scope;
39
import org.eclipse.wst.jsdt.internal.compiler.lookup.SourceTypeBinding;
38
import org.eclipse.wst.jsdt.internal.compiler.lookup.SourceTypeBinding;
40
import org.eclipse.wst.jsdt.internal.compiler.lookup.TagBits;
41
import org.eclipse.wst.jsdt.internal.compiler.parser.Parser;
39
import org.eclipse.wst.jsdt.internal.compiler.parser.Parser;
42
import org.eclipse.wst.jsdt.internal.compiler.problem.AbortCompilation;
40
import org.eclipse.wst.jsdt.internal.compiler.problem.AbortCompilation;
43
import org.eclipse.wst.jsdt.internal.compiler.problem.AbortCompilationUnit;
41
import org.eclipse.wst.jsdt.internal.compiler.problem.AbortCompilationUnit;
Lines 379-391 Link Here
379
//			if (JavaScriptCore.IS_ECMASCRIPT4)
377
//			if (JavaScriptCore.IS_ECMASCRIPT4)
380
//				resolveAnnotations(scope, this.annotations, this.binding);
378
//				resolveAnnotations(scope, this.annotations, this.binding);
381
			resolveStatements();
379
			resolveStatements();
382
			// check @Deprecated annotation presence
383
			if (this.binding != null
384
					&& (this.binding.getAnnotationTagBits() & TagBits.AnnotationDeprecated) == 0
385
					&& (this.binding.modifiers & ClassFileConstants.AccDeprecated) != 0
386
					&& this.scope.compilerOptions().sourceLevel >= ClassFileConstants.JDK1_5) {
387
				this.scope.problemReporter().missingDeprecatedAnnotationForMethod(this);
388
			}
389
		} catch (AbortMethod e) {	// ========= abort on fatal error =============
380
		} catch (AbortMethod e) {	// ========= abort on fatal error =============
390
			this.ignoreFurtherInvestigation = true;
381
			this.ignoreFurtherInvestigation = true;
391
		}
382
		}
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/MethodDeclaration.java (-8 lines)
Lines 10-16 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.wst.jsdt.internal.compiler.ast;
11
package org.eclipse.wst.jsdt.internal.compiler.ast;
12
12
13
import org.eclipse.wst.jsdt.core.JavaScriptCore;
14
import org.eclipse.wst.jsdt.core.ast.IASTNode;
13
import org.eclipse.wst.jsdt.core.ast.IASTNode;
15
import org.eclipse.wst.jsdt.core.ast.IFunctionDeclaration;
14
import org.eclipse.wst.jsdt.core.ast.IFunctionDeclaration;
16
import org.eclipse.wst.jsdt.internal.compiler.ASTVisitor;
15
import org.eclipse.wst.jsdt.internal.compiler.ASTVisitor;
Lines 109-117 Link Here
109
				}
108
				}
110
			}
109
			}
111
			this.scope.reportUnusedDeclarations();
110
			this.scope.reportUnusedDeclarations();
112
			// check unreachable catch blocks
113
			if (JavaScriptCore.IS_ECMASCRIPT4)
114
				methodContext.complainIfUnusedExceptionHandlers(this);
115
		} catch (AbortMethod e) {
111
		} catch (AbortMethod e) {
116
			this.ignoreFurtherInvestigation = true;
112
			this.ignoreFurtherInvestigation = true;
117
		}
113
		}
Lines 175-184 Link Here
175
					break checkOverride;
171
					break checkOverride;
176
				// claims to override, and doesn't actually do so
172
				// claims to override, and doesn't actually do so
177
				this.scope.problemReporter().methodMustOverride(this);
173
				this.scope.problemReporter().methodMustOverride(this);
178
			} else if (!isInterfaceMethod
179
						&& (bindingModifiers & (ClassFileConstants.AccStatic|ExtraCompilerModifiers.AccOverriding)) == ExtraCompilerModifiers.AccOverriding) {
180
				// actually overrides, but did not claim to do so
181
				this.scope.problemReporter().missingOverrideAnnotation(this);
182
			}
174
			}
183
		}
175
		}
184
176
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/Annotation.java (-1 lines)
Lines 319-325 Link Here
319
		long tagBits = detectStandardAnnotation(scope, annotationType, valueAttribute);
319
		long tagBits = detectStandardAnnotation(scope, annotationType, valueAttribute);
320
320
321
		// record annotation positions in the compilation result
321
		// record annotation positions in the compilation result
322
		scope.referenceCompilationUnit().compilationResult.recordSuppressWarnings(CompilerOptions.NonExternalizedString, this.sourceStart, this.declarationSourceEnd);
323
		if (this.recipient != null) {
322
		if (this.recipient != null) {
324
			if (tagBits != 0) {
323
			if (tagBits != 0) {
325
				// tag bits onto recipient
324
				// tag bits onto recipient
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/CompilationUnitDeclaration.java (-103 lines)
Lines 10-16 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.wst.jsdt.internal.compiler.ast;
11
package org.eclipse.wst.jsdt.internal.compiler.ast;
12
12
13
import java.util.Arrays;
14
import java.util.Comparator;
13
import java.util.Comparator;
15
import java.util.Iterator;
14
import java.util.Iterator;
16
15
Lines 407-413 Link Here
407
					statements[i].resolve(scope);
406
					statements[i].resolve(scope);
408
				}
407
				}
409
			}
408
			}
410
			reportNLSProblems();
411
		} catch (AbortCompilationUnit e) {
409
		} catch (AbortCompilationUnit e) {
412
			this.ignoreFurtherInvestigation = true;
410
			this.ignoreFurtherInvestigation = true;
413
			return;
411
			return;
Lines 435-547 Link Here
435
						programElement.resolve(scope);
433
						programElement.resolve(scope);
436
				}
434
				}
437
			}
435
			}
438
			reportNLSProblems();
439
		} catch (AbortCompilationUnit e) {
436
		} catch (AbortCompilationUnit e) {
440
			this.ignoreFurtherInvestigation = true;
437
			this.ignoreFurtherInvestigation = true;
441
			return;
438
			return;
442
		}
439
		}
443
	}
440
	}
444
441
445
446
	private void reportNLSProblems() {
447
		if (this.nlsTags != null || this.stringLiterals != null) {
448
			final int stringLiteralsLength = this.stringLiteralsPtr;
449
			final int nlsTagsLength = this.nlsTags == null ? 0 : this.nlsTags.length;
450
			if (stringLiteralsLength == 0) {
451
				if (nlsTagsLength != 0) {
452
					for (int i = 0; i < nlsTagsLength; i++) {
453
						NLSTag tag = this.nlsTags[i];
454
						if (tag != null) {
455
							scope.problemReporter().unnecessaryNLSTags(tag.start, tag.end);
456
						}
457
					}
458
				}
459
			} else if (nlsTagsLength == 0) {
460
				// resize string literals
461
				if (this.stringLiterals.length != stringLiteralsLength) {
462
					System.arraycopy(this.stringLiterals, 0, (stringLiterals = new StringLiteral[stringLiteralsLength]), 0, stringLiteralsLength);
463
				}
464
				Arrays.sort(this.stringLiterals, STRING_LITERAL_COMPARATOR);
465
				for (int i = 0; i < stringLiteralsLength; i++) {
466
					scope.problemReporter().nonExternalizedStringLiteral(this.stringLiterals[i]);
467
				}
468
			} else {
469
				// need to iterate both arrays to find non matching elements
470
				if (this.stringLiterals.length != stringLiteralsLength) {
471
					System.arraycopy(this.stringLiterals, 0, (stringLiterals = new StringLiteral[stringLiteralsLength]), 0, stringLiteralsLength);
472
				}
473
				Arrays.sort(this.stringLiterals, STRING_LITERAL_COMPARATOR);
474
				int indexInLine = 1;
475
				int lastLineNumber = -1;
476
				StringLiteral literal = null;
477
				int index = 0;
478
				int i = 0;
479
				stringLiteralsLoop: for (; i < stringLiteralsLength; i++) {
480
					literal = this.stringLiterals[i];
481
					final int literalLineNumber = literal.lineNumber;
482
					if (lastLineNumber != literalLineNumber) {
483
						indexInLine = 1;
484
						lastLineNumber = literalLineNumber;
485
					} else {
486
						indexInLine++;
487
					}
488
					if (index < nlsTagsLength) {
489
						nlsTagsLoop: for (; index < nlsTagsLength; index++) {
490
							NLSTag tag = this.nlsTags[index];
491
							if (tag == null) continue nlsTagsLoop;
492
							int tagLineNumber = tag.lineNumber;
493
							if (literalLineNumber < tagLineNumber) {
494
								scope.problemReporter().nonExternalizedStringLiteral(literal);
495
								continue stringLiteralsLoop;
496
							} else if (literalLineNumber == tagLineNumber) {
497
								if (tag.index == indexInLine) {
498
									this.nlsTags[index] = null;
499
									index++;
500
									continue stringLiteralsLoop;
501
								} else {
502
									nlsTagsLoop2: for (int index2 = index + 1; index2 < nlsTagsLength; index2++) {
503
										NLSTag tag2 = this.nlsTags[index2];
504
										if (tag2 == null) continue nlsTagsLoop2;
505
										int tagLineNumber2 = tag2.lineNumber;
506
										if (literalLineNumber == tagLineNumber2) {
507
											if (tag2.index == indexInLine) {
508
												this.nlsTags[index2] = null;
509
												continue stringLiteralsLoop;
510
											} else {
511
												continue nlsTagsLoop2;
512
											}
513
										} else {
514
											scope.problemReporter().nonExternalizedStringLiteral(literal);
515
											continue stringLiteralsLoop;
516
										}
517
									}
518
									scope.problemReporter().nonExternalizedStringLiteral(literal);
519
									continue stringLiteralsLoop;
520
								}
521
							} else {
522
								scope.problemReporter().unnecessaryNLSTags(tag.start, tag.end);
523
								continue nlsTagsLoop;
524
							}
525
						}
526
					}
527
					// all nls tags have been processed, so remaining string literals are not externalized
528
					break stringLiteralsLoop;
529
				}
530
				for (; i < stringLiteralsLength; i++) {
531
					scope.problemReporter().nonExternalizedStringLiteral(this.stringLiterals[i]);
532
				}
533
				if (index < nlsTagsLength) {
534
					for (; index < nlsTagsLength; index++) {
535
						NLSTag tag = this.nlsTags[index];
536
						if (tag != null) {
537
							scope.problemReporter().unnecessaryNLSTags(tag.start, tag.end);
538
						}
539
					}
540
				}
541
			}
542
		}
543
	}
544
545
	public void tagAsHavingErrors() {
442
	public void tagAsHavingErrors() {
546
		ignoreFurtherInvestigation = true;
443
		ignoreFurtherInvestigation = true;
547
	}
444
	}
(-)src/org/eclipse/wst/jsdt/internal/compiler/ast/ConstructorDeclaration.java (-6 lines)
Lines 174-181 Link Here
174
				}
174
				}
175
			}
175
			}
176
		}
176
		}
177
		// check unreachable catch blocks
178
		constructorContext.complainIfUnusedExceptionHandlers(this);
179
	} catch (AbortMethod e) {
177
	} catch (AbortMethod e) {
180
		this.ignoreFurtherInvestigation = true;
178
		this.ignoreFurtherInvestigation = true;
181
	}
179
	}
Lines 282-291 Link Here
282
	if (this.constructorCall != null) {
280
	if (this.constructorCall != null) {
283
		if (sourceType.id == TypeIds.T_JavaLangObject
281
		if (sourceType.id == TypeIds.T_JavaLangObject
284
				&& this.constructorCall.accessMode != ExplicitConstructorCall.This) {
282
				&& this.constructorCall.accessMode != ExplicitConstructorCall.This) {
285
			// cannot use super() in java.lang.Object
286
			if (this.constructorCall.accessMode == ExplicitConstructorCall.Super) {
287
				this.scope.problemReporter().cannotUseSuperInJavaLangObject(this.constructorCall);
288
			}
289
			this.constructorCall = null;
283
			this.constructorCall = null;
290
		} else {
284
		} else {
291
			this.constructorCall.resolve(this.scope);
285
			this.constructorCall.resolve(this.scope);
(-)src/org/eclipse/wst/jsdt/core/compiler/CategorizedProblem.java (-2 lines)
Lines 92-99 Link Here
92
	public static final int CAT_UNNECESSARY_CODE = 120;
92
	public static final int CAT_UNNECESSARY_CODE = 120;
93
	/** Category for optional problems related to type safety in generics */
93
	/** Category for optional problems related to type safety in generics */
94
	public static final int CAT_UNCHECKED_RAW = 130;
94
	public static final int CAT_UNCHECKED_RAW = 130;
95
	/** Category for optional problems related to internationalization of String literals */
96
	public static final int CAT_NLS = 140;
97
	/** Category for optional problems related to access restrictions */
95
	/** Category for optional problems related to access restrictions */
98
	public static final int CAT_RESTRICTION = 150;
96
	public static final int CAT_RESTRICTION = 150;
99
97
(-)src/org/eclipse/wst/jsdt/core/compiler/IProblem.java (-98 lines)
Lines 261-272 Link Here
261
	/**
261
	/**
262
	 * General type related problems
262
	 * General type related problems
263
	 */
263
	 */
264
	int ObjectHasNoSuperclass = TypeRelated + 1;
265
	int UndefinedType = TypeRelated + 2;
264
	int UndefinedType = TypeRelated + 2;
266
	int NotVisibleType = TypeRelated + 3;
265
	int NotVisibleType = TypeRelated + 3;
267
	int AmbiguousType = TypeRelated + 4;
266
	int AmbiguousType = TypeRelated + 4;
268
	int UsingDeprecatedType = TypeRelated + 5;
267
	int UsingDeprecatedType = TypeRelated + 5;
269
	int InternalTypeNameProvided = TypeRelated + 6;
270
	int UnusedPrivateType = Internal + TypeRelated + 7;
268
	int UnusedPrivateType = Internal + TypeRelated + 7;
271
269
272
	int IncompatibleTypesInEqualityOperator = TypeRelated + 15;
270
	int IncompatibleTypesInEqualityOperator = TypeRelated + 15;
Lines 297-304 Link Here
297
	int UndefinedName = Internal + FieldRelated + 50;
295
	int UndefinedName = Internal + FieldRelated + 50;
298
	int UninitializedLocalVariable = Internal + 51;
296
	int UninitializedLocalVariable = Internal + 51;
299
	int VariableTypeCannotBeVoid = Internal + 52;
297
	int VariableTypeCannotBeVoid = Internal + 52;
300
	/** @deprecated - problem is no longer generated, use {@link #CannotAllocateVoidArray} instead */
301
	int VariableTypeCannotBeVoidArray = Internal + 53;
302
	int CannotAllocateVoidArray = Internal + 54;
298
	int CannotAllocateVoidArray = Internal + 54;
303
	// local variables
299
	// local variables
304
	int RedefinedLocal = Internal + 55;
300
	int RedefinedLocal = Internal + 55;
Lines 309-315 Link Here
309
	int ParameterAssignment = Internal + 59;
305
	int ParameterAssignment = Internal + 59;
310
	int FinalOuterLocalAssignment = Internal + 60;
306
	int FinalOuterLocalAssignment = Internal + 60;
311
	int LocalVariableIsNeverUsed = Internal + 61;
307
	int LocalVariableIsNeverUsed = Internal + 61;
312
	int ArgumentIsNeverUsed = Internal + 62;
313
	int BytecodeExceeds64KLimit = Internal + 63;
308
	int BytecodeExceeds64KLimit = Internal + 63;
314
	int BytecodeExceeds64KLimitForClinit = Internal + 64;
309
	int BytecodeExceeds64KLimitForClinit = Internal + 64;
315
	int TooManyArgumentSlots = Internal + 65;
310
	int TooManyArgumentSlots = Internal + 65;
Lines 442-449 Link Here
442
	int UnnecessaryArgumentCast = Internal + TypeRelated + 182;
437
	int UnnecessaryArgumentCast = Internal + TypeRelated + 182;
443
	int UnnecessaryInstanceof = Internal + TypeRelated + 183;
438
	int UnnecessaryInstanceof = Internal + TypeRelated + 183;
444
	int FinallyMustCompleteNormally = Internal + 184;
439
	int FinallyMustCompleteNormally = Internal + 184;
445
	int UnusedMethodDeclaredThrownException = Internal + 185;
446
	int UnusedConstructorDeclaredThrownException = Internal + 186;
447
	int EmptyControlFlowStatement = Internal + TypeRelated + 188;
440
	int EmptyControlFlowStatement = Internal + TypeRelated + 188;
448
	int UnnecessaryElse = Internal + 189;
441
	int UnnecessaryElse = Internal + 189;
449
442
Lines 515-525 Link Here
515
	int NullSourceString = Syntax + Internal + 258;
508
	int NullSourceString = Syntax + Internal + 258;
516
	int UnterminatedString = Syntax + Internal + 259;
509
	int UnterminatedString = Syntax + Internal + 259;
517
	int UnterminatedComment = Syntax + Internal + 260;
510
	int UnterminatedComment = Syntax + Internal + 260;
518
	int NonExternalizedStringLiteral = Internal + 261;
519
	int InvalidDigit = Syntax + Internal + 262;
511
	int InvalidDigit = Syntax + Internal + 262;
520
	int InvalidLowSurrogate = Syntax + Internal + 263;
512
	int InvalidLowSurrogate = Syntax + Internal + 263;
521
	int InvalidHighSurrogate = Syntax + Internal + 264;
513
	int InvalidHighSurrogate = Syntax + Internal + 264;
522
	int UnnecessaryNLSTag = Internal + 265;
523
514
524
	// type related problems
515
	// type related problems
525
	int DiscouragedReference = TypeRelated + 280;
516
	int DiscouragedReference = TypeRelated + 280;
Lines 552-581 Link Here
552
	int MustSpecifyPackage = Internal + 326;
543
	int MustSpecifyPackage = Internal + 326;
553
	int HierarchyHasProblems = TypeRelated + 327;
544
	int HierarchyHasProblems = TypeRelated + 327;
554
	int PackageIsNotExpectedPackage = Internal + 328;
545
	int PackageIsNotExpectedPackage = Internal + 328;
555
	int ObjectCannotHaveSuperTypes = Internal + 329;
556
	int ObjectMustBeClass = Internal + 330;
557
558
	/** @deprecated - problem is no longer generated, use {@link #UndefinedType} instead */
559
	int SuperclassNotFound =  TypeRelated + 329 + ProblemReasons.NotFound; // TypeRelated + 330
560
	/** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
561
	int SuperclassNotVisible =  TypeRelated + 329 + ProblemReasons.NotVisible; // TypeRelated + 331
562
	/** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
563
	int SuperclassAmbiguous =  TypeRelated + 329 + ProblemReasons.Ambiguous; // TypeRelated + 332
564
	/** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
565
	int SuperclassInternalNameProvided =  TypeRelated + 329 + ProblemReasons.InternalNameProvided; // TypeRelated + 333
566
	/** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
567
	int SuperclassInheritedNameHidesEnclosingName =  TypeRelated + 329 + ProblemReasons.InheritedNameHidesEnclosingName; // TypeRelated + 334
568
569
	/** @deprecated - problem is no longer generated, use {@link #UndefinedType} instead */
570
	int InterfaceNotFound =  TypeRelated + 334 + ProblemReasons.NotFound; // TypeRelated + 335
571
	/** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
572
	int InterfaceNotVisible =  TypeRelated + 334 + ProblemReasons.NotVisible; // TypeRelated + 336
573
	/** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
574
	int InterfaceAmbiguous =  TypeRelated + 334 + ProblemReasons.Ambiguous; // TypeRelated + 337
575
	/** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
576
	int InterfaceInternalNameProvided =  TypeRelated + 334 + ProblemReasons.InternalNameProvided; // TypeRelated + 338
577
	/** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
578
	int InterfaceInheritedNameHidesEnclosingName =  TypeRelated + 334 + ProblemReasons.InheritedNameHidesEnclosingName; // TypeRelated + 339
579
546
580
	// field related problems
547
	// field related problems
581
	int DuplicateField = FieldRelated + 340;
548
	int DuplicateField = FieldRelated + 340;
Lines 597-668 Link Here
597
	int IllegalAbstractModifierCombinationForMethod = MethodRelated + 362;
564
	int IllegalAbstractModifierCombinationForMethod = MethodRelated + 362;
598
	int AbstractMethodInAbstractClass = MethodRelated + 363;
565
	int AbstractMethodInAbstractClass = MethodRelated + 363;
599
	int ArgumentTypeCannotBeVoid = MethodRelated + 364;
566
	int ArgumentTypeCannotBeVoid = MethodRelated + 364;
600
	/** @deprecated - problem is no longer generated, use {@link #CannotAllocateVoidArray} instead */
601
	int ArgumentTypeCannotBeVoidArray = MethodRelated + 365;
602
	/** @deprecated - problem is no longer generated, use {@link #CannotAllocateVoidArray} instead */
603
	int ReturnTypeCannotBeVoidArray = MethodRelated + 366;
604
	int NativeMethodsCannotBeStrictfp = MethodRelated + 367;
605
	int DuplicateModifierForArgument = MethodRelated + 368;
567
	int DuplicateModifierForArgument = MethodRelated + 368;
606
568
607
	/** @deprecated - problem is no longer generated, use {@link #UndefinedType} instead */
608
	int ArgumentTypeNotFound =  MethodRelated + 369 + ProblemReasons.NotFound; // MethodRelated + 370
609
	/** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
610
	int ArgumentTypeNotVisible =  MethodRelated + 369 + ProblemReasons.NotVisible; // MethodRelated + 371
611
	/** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
612
	int ArgumentTypeAmbiguous =  MethodRelated + 369 + ProblemReasons.Ambiguous; // MethodRelated + 372
613
	/** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
614
	int ArgumentTypeInternalNameProvided =  MethodRelated + 369 + ProblemReasons.InternalNameProvided; // MethodRelated + 373
615
	/** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
616
	int ArgumentTypeInheritedNameHidesEnclosingName =  MethodRelated + 369 + ProblemReasons.InheritedNameHidesEnclosingName; // MethodRelated + 374
617
618
	/** @deprecated - problem is no longer generated, use {@link #UndefinedType} instead */
619
	int ExceptionTypeNotFound =  MethodRelated + 374 + ProblemReasons.NotFound; // MethodRelated + 375
620
	/** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
621
	int ExceptionTypeNotVisible =  MethodRelated + 374 + ProblemReasons.NotVisible; // MethodRelated + 376
622
	/** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
623
	int ExceptionTypeAmbiguous =  MethodRelated + 374 + ProblemReasons.Ambiguous; // MethodRelated + 377
624
	/** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
625
	int ExceptionTypeInternalNameProvided =  MethodRelated + 374 + ProblemReasons.InternalNameProvided; // MethodRelated + 378
626
	/** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
627
	int ExceptionTypeInheritedNameHidesEnclosingName =  MethodRelated + 374 + ProblemReasons.InheritedNameHidesEnclosingName; // MethodRelated + 379
628
629
	/** @deprecated - problem is no longer generated, use {@link #UndefinedType} instead */
630
	int ReturnTypeNotFound =  MethodRelated + 379 + ProblemReasons.NotFound; // MethodRelated + 380
631
	/** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
632
	int ReturnTypeNotVisible =  MethodRelated + 379 + ProblemReasons.NotVisible; // MethodRelated + 381
633
	/** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
634
	int ReturnTypeAmbiguous =  MethodRelated + 379 + ProblemReasons.Ambiguous; // MethodRelated + 382
635
	/** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
636
	int ReturnTypeInternalNameProvided =  MethodRelated + 379 + ProblemReasons.InternalNameProvided; // MethodRelated + 383
637
	/** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
638
	int ReturnTypeInheritedNameHidesEnclosingName =  MethodRelated + 379 + ProblemReasons.InheritedNameHidesEnclosingName; // MethodRelated + 384
639
640
	// import related problems
569
	// import related problems
641
	int ConflictingImport = ImportRelated + 385;
570
	int ConflictingImport = ImportRelated + 385;
642
	int DuplicateImport = ImportRelated + 386;
571
	int DuplicateImport = ImportRelated + 386;
643
	int CannotImportPackage = ImportRelated + 387;
572
	int CannotImportPackage = ImportRelated + 387;
644
573
645
	int ImportNotFound =  ImportRelated + 389 + ProblemReasons.NotFound; // ImportRelated + 390
574
	int ImportNotFound =  ImportRelated + 389 + ProblemReasons.NotFound; // ImportRelated + 390
646
	/** @deprecated - problem is no longer generated, use {@link #NotVisibleType} instead */
647
	int ImportNotVisible =  ImportRelated + 389 + ProblemReasons.NotVisible; // ImportRelated + 391
648
	/** @deprecated - problem is no longer generated, use {@link #AmbiguousType} instead */
649
	int ImportAmbiguous =  ImportRelated + 389 + ProblemReasons.Ambiguous; // ImportRelated + 392
650
	/** @deprecated - problem is no longer generated, use {@link #InternalTypeNameProvided} instead */
651
	int ImportInternalNameProvided =  ImportRelated + 389 + ProblemReasons.InternalNameProvided; // ImportRelated + 393
652
	/** @deprecated - problem is no longer generated, use {@link #InheritedTypeHidesEnclosingName} instead */
653
	int ImportInheritedNameHidesEnclosingName =  ImportRelated + 389 + ProblemReasons.InheritedNameHidesEnclosingName; // ImportRelated + 394
654
655
	int InvalidTypeForStaticImport =  ImportRelated + 391;
656
575
657
	// local variable related problems
576
	// local variable related problems
658
	int DuplicateModifierForVariable = MethodRelated + 395;
577
	int DuplicateModifierForVariable = MethodRelated + 395;
659
	int IllegalModifierForVariable = MethodRelated + 396;
578
	int IllegalModifierForVariable = MethodRelated + 396;
660
	/** @deprecated - problem is no longer generated, use {@link #RedundantNullCheckOnNonNullLocalVariable} instead */
661
	int LocalVariableCannotBeNull = Internal + 397; // since 3.3: semantics are LocalVariableRedundantCheckOnNonNull
662
	/** @deprecated - problem is no longer generated, use {@link #NullLocalVariableReference}, {@link #RedundantNullCheckOnNullLocalVariable} or {@link #RedundantLocalVariableNullAssignment} instead */
663
	int LocalVariableCanOnlyBeNull = Internal + 398; // since 3.3: split with LocalVariableRedundantCheckOnNull depending on context
664
	/** @deprecated - problem is no longer generated, use {@link #PotentialNullLocalVariableReference} instead */
665
	int LocalVariableMayBeNull = Internal + 399;
666
579
667
	// method verifier problems
580
	// method verifier problems
668
	int AbstractMethodMustBeImplemented = MethodRelated + 400;
581
	int AbstractMethodMustBeImplemented = MethodRelated + 400;
Lines 788-794 Link Here
788
	int JavadocNotVisibleType = Javadoc + Internal + 504;
701
	int JavadocNotVisibleType = Javadoc + Internal + 504;
789
	int JavadocAmbiguousType = Javadoc + Internal + 505;
702
	int JavadocAmbiguousType = Javadoc + Internal + 505;
790
	int JavadocUsingDeprecatedType = Javadoc + Internal + 506;
703
	int JavadocUsingDeprecatedType = Javadoc + Internal + 506;
791
	int JavadocInternalTypeNameProvided = Javadoc + Internal + 507;
792
	int JavadocInheritedMethodHidesEnclosingName = Javadoc + Internal + 508;
704
	int JavadocInheritedMethodHidesEnclosingName = Javadoc + Internal + 508;
793
	int JavadocInheritedFieldHidesEnclosingName = Javadoc + Internal + 509;
705
	int JavadocInheritedFieldHidesEnclosingName = Javadoc + Internal + 509;
794
	int JavadocInheritedNameHidesEnclosingTypeName = Javadoc + Internal + 510;
706
	int JavadocInheritedNameHidesEnclosingTypeName = Javadoc + Internal + 510;
Lines 809-815 Link Here
809
	int DuplicateTypeVariable = Internal + 520;
721
	int DuplicateTypeVariable = Internal + 520;
810
	int IllegalTypeVariableSuperReference = Internal + 521;
722
	int IllegalTypeVariableSuperReference = Internal + 521;
811
	int NonStaticTypeFromStaticInvocation = Internal + 522;
723
	int NonStaticTypeFromStaticInvocation = Internal + 522;
812
	int ObjectCannotBeGeneric = Internal + 523;
813
	int NonGenericType = TypeRelated + 524;
724
	int NonGenericType = TypeRelated + 524;
814
	int IncorrectArityForParameterizedType = TypeRelated + 525;
725
	int IncorrectArityForParameterizedType = TypeRelated + 525;
815
	int TypeArgumentMismatch = TypeRelated + 526;
726
	int TypeArgumentMismatch = TypeRelated + 526;
Lines 903-922 Link Here
903
	int AnnotationTypeDeclarationCannotHaveConstructor = Syntax + Internal + 624;
814
	int AnnotationTypeDeclarationCannotHaveConstructor = Syntax + Internal + 624;
904
	int AnnotationValueMustBeAnnotation = Internal + 625;
815
	int AnnotationValueMustBeAnnotation = Internal + 625;
905
	int AnnotationTypeUsedAsSuperInterface = TypeRelated + 626;
816
	int AnnotationTypeUsedAsSuperInterface = TypeRelated + 626;
906
	int MissingOverrideAnnotation = MethodRelated + 627;
907
	int FieldMissingDeprecatedAnnotation = Internal + 628;
908
	int MethodMissingDeprecatedAnnotation = Internal + 629;
909
	int TypeMissingDeprecatedAnnotation = Internal + 630;
910
	int UnhandledWarningToken = Internal + 631;
817
	int UnhandledWarningToken = Internal + 631;
911
	int AnnotationValueMustBeArrayInitializer = Internal + 632;
818
	int AnnotationValueMustBeArrayInitializer = Internal + 632;
912
	int AnnotationValueMustBeAnEnumConstant = Internal + 633;
819
	int AnnotationValueMustBeAnEnumConstant = Internal + 633;
913
	int MethodMustOverrideOrImplement = MethodRelated + 634;
820
	int MethodMustOverrideOrImplement = MethodRelated + 634;
914
821
915
	/**
822
	/**
916
	 * Corrupted binaries
917
	 */
918
	int CorruptedSignature = Internal + 700;
919
	/**
920
	 * Corrupted source
823
	 * Corrupted source
921
	 */
824
	 */
922
	int InvalidEncoding = Internal + 701;
825
	int InvalidEncoding = Internal + 701;
Lines 965-971 Link Here
965
	int JavadocNonGenericConstructor = Javadoc + Internal + 856;
868
	int JavadocNonGenericConstructor = Javadoc + Internal + 856;
966
	int JavadocIncorrectArityForParameterizedConstructor = Javadoc + Internal + 857;
869
	int JavadocIncorrectArityForParameterizedConstructor = Javadoc + Internal + 857;
967
	int JavadocParameterizedConstructorArgumentTypeMismatch = Javadoc + Internal + 858;
870
	int JavadocParameterizedConstructorArgumentTypeMismatch = Javadoc + Internal + 858;
968
	int JavadocTypeArgumentsForRawGenericConstructor = Javadoc + Internal + 859;
969
871
970
	/**
872
	/**
971
	 * External problems -- These are problems defined by other plugins
873
	 * External problems -- These are problems defined by other plugins
(-)src/org/eclipse/wst/jsdt/core/JavaScriptCore.java (-5 lines)
Lines 318-328 Link Here
318
	 * Possible  configurable option ID.
318
	 * Possible  configurable option ID.
319
	 * @see #getDefaultOptions()
319
	 * @see #getDefaultOptions()
320
	 */
320
	 */
321
	public static final String COMPILER_PB_NON_NLS_STRING_LITERAL = PLUGIN_ID + ".compiler.problem.nonExternalizedStringLiteral"; //$NON-NLS-1$
322
	/**
323
	 * Possible  configurable option ID.
324
	 * @see #getDefaultOptions()
325
	 */
326
	public static final String COMPILER_PB_ASSERT_IDENTIFIER = PLUGIN_ID + ".compiler.problem.assertIdentifier"; //$NON-NLS-1$
321
	public static final String COMPILER_PB_ASSERT_IDENTIFIER = PLUGIN_ID + ".compiler.problem.assertIdentifier"; //$NON-NLS-1$
327
	/**
322
	/**
328
	 * Possible  configurable option ID.
323
	 * Possible  configurable option ID.
(-)src/org/eclipse/wst/jsdt/internal/compiler/parser/Parser.java (-2 / +1 lines)
Lines 146-152 Link Here
146
import org.eclipse.wst.jsdt.internal.compiler.problem.AbortCompilation;
146
import org.eclipse.wst.jsdt.internal.compiler.problem.AbortCompilation;
147
import org.eclipse.wst.jsdt.internal.compiler.problem.AbortCompilationUnit;
147
import org.eclipse.wst.jsdt.internal.compiler.problem.AbortCompilationUnit;
148
import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter;
148
import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter;
149
import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemSeverities;
150
import org.eclipse.wst.jsdt.internal.compiler.util.Messages;
149
import org.eclipse.wst.jsdt.internal.compiler.util.Messages;
151
import org.eclipse.wst.jsdt.internal.compiler.util.Util;
150
import org.eclipse.wst.jsdt.internal.compiler.util.Util;
152
151
Lines 8515-8521 Link Here
8515
	this.scanner.foundTaskCount = 0;
8514
	this.scanner.foundTaskCount = 0;
8516
	this.scanner.eofPosition = Integer.MAX_VALUE;
8515
	this.scanner.eofPosition = Integer.MAX_VALUE;
8517
	this.recordStringLiterals = true;
8516
	this.recordStringLiterals = true;
8518
	final boolean checkNLS = this.options.getSeverity(CompilerOptions.NonExternalizedString) != ProblemSeverities.Ignore;
8517
	final boolean checkNLS = false;
8519
	this.checkExternalizeStrings = checkNLS;
8518
	this.checkExternalizeStrings = checkNLS;
8520
	this.scanner.checkNonExternalizedStringLiterals = initializeNLS && checkNLS;
8519
	this.scanner.checkNonExternalizedStringLiterals = initializeNLS && checkNLS;
8521
8520
(-)src/org/eclipse/wst/jsdt/internal/core/util/CommentRecorderParser.java (-3 / +1 lines)
Lines 12-21 Link Here
12
12
13
import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration;
13
import org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration;
14
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
14
import org.eclipse.wst.jsdt.internal.compiler.classfmt.ClassFileConstants;
15
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
16
import org.eclipse.wst.jsdt.internal.compiler.parser.Parser;
15
import org.eclipse.wst.jsdt.internal.compiler.parser.Parser;
17
import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter;
16
import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemReporter;
18
import org.eclipse.wst.jsdt.internal.compiler.problem.ProblemSeverities;
19
17
20
/**
18
/**
21
 * Internal parser used for parsing source to create DOM AST nodes.
19
 * Internal parser used for parsing source to create DOM AST nodes.
Lines 238-244 Link Here
238
		this.scanner = new CommentRecorderScanner(
236
		this.scanner = new CommentRecorderScanner(
239
				false /*comment*/,
237
				false /*comment*/,
240
				false /*whitespace*/,
238
				false /*whitespace*/,
241
				this.options.getSeverity(CompilerOptions.NonExternalizedString) != ProblemSeverities.Ignore /*nls*/,
239
				false /*externalized strings*/,
242
				this.options.sourceLevel /*sourceLevel*/,
240
				this.options.sourceLevel /*sourceLevel*/,
243
				this.options.taskTags/*taskTags*/,
241
				this.options.taskTags/*taskTags*/,
244
				this.options.taskPriorites/*taskPriorities*/,
242
				this.options.taskPriorites/*taskPriorities*/,
(-)src/org/eclipse/wst/jsdt/internal/compiler/impl/CompilerOptions.java (-44 / +1 lines)
Lines 43-49 Link Here
43
	public static final String OPTION_ReportDeprecationWhenOverridingDeprecatedMethod = "org.eclipse.wst.jsdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod"; //$NON-NLS-1$
43
	public static final String OPTION_ReportDeprecationWhenOverridingDeprecatedMethod = "org.eclipse.wst.jsdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod"; //$NON-NLS-1$
44
	public static final String OPTION_ReportHiddenCatchBlock = "org.eclipse.wst.jsdt.core.compiler.problem.hiddenCatchBlock"; //$NON-NLS-1$
44
	public static final String OPTION_ReportHiddenCatchBlock = "org.eclipse.wst.jsdt.core.compiler.problem.hiddenCatchBlock"; //$NON-NLS-1$
45
	public static final String OPTION_ReportUnusedLocal = "org.eclipse.wst.jsdt.core.compiler.problem.unusedLocal"; //$NON-NLS-1$
45
	public static final String OPTION_ReportUnusedLocal = "org.eclipse.wst.jsdt.core.compiler.problem.unusedLocal"; //$NON-NLS-1$
46
	public static final String OPTION_ReportUnusedParameter = "org.eclipse.wst.jsdt.core.compiler.problem.unusedParameter"; //$NON-NLS-1$
47
	public static final String OPTION_ReportUnusedParameterWhenImplementingAbstract = "org.eclipse.wst.jsdt.core.compiler.problem.unusedParameterWhenImplementingAbstract"; //$NON-NLS-1$
46
	public static final String OPTION_ReportUnusedParameterWhenImplementingAbstract = "org.eclipse.wst.jsdt.core.compiler.problem.unusedParameterWhenImplementingAbstract"; //$NON-NLS-1$
48
	public static final String OPTION_ReportUnusedParameterWhenOverridingConcrete = "org.eclipse.wst.jsdt.core.compiler.problem.unusedParameterWhenOverridingConcrete"; //$NON-NLS-1$
47
	public static final String OPTION_ReportUnusedParameterWhenOverridingConcrete = "org.eclipse.wst.jsdt.core.compiler.problem.unusedParameterWhenOverridingConcrete"; //$NON-NLS-1$
49
	public static final String OPTION_ReportUnusedParameterIncludeDocCommentReference = "org.eclipse.wst.jsdt.core.compiler.problem.unusedParameterIncludeDocCommentReference"; //$NON-NLS-1$
48
	public static final String OPTION_ReportUnusedParameterIncludeDocCommentReference = "org.eclipse.wst.jsdt.core.compiler.problem.unusedParameterIncludeDocCommentReference"; //$NON-NLS-1$
Lines 54-60 Link Here
54
	public static final String OPTION_ReportFieldHiding = "org.eclipse.wst.jsdt.core.compiler.problem.fieldHiding"; //$NON-NLS-1$
53
	public static final String OPTION_ReportFieldHiding = "org.eclipse.wst.jsdt.core.compiler.problem.fieldHiding"; //$NON-NLS-1$
55
	public static final String OPTION_ReportTypeParameterHiding = "org.eclipse.wst.jsdt.core.compiler.problem.typeParameterHiding"; //$NON-NLS-1$
54
	public static final String OPTION_ReportTypeParameterHiding = "org.eclipse.wst.jsdt.core.compiler.problem.typeParameterHiding"; //$NON-NLS-1$
56
	public static final String OPTION_ReportPossibleAccidentalBooleanAssignment = "org.eclipse.wst.jsdt.core.compiler.problem.possibleAccidentalBooleanAssignment"; //$NON-NLS-1$
55
	public static final String OPTION_ReportPossibleAccidentalBooleanAssignment = "org.eclipse.wst.jsdt.core.compiler.problem.possibleAccidentalBooleanAssignment"; //$NON-NLS-1$
57
	public static final String OPTION_ReportNonExternalizedStringLiteral = "org.eclipse.wst.jsdt.core.compiler.problem.nonExternalizedStringLiteral"; //$NON-NLS-1$
58
	public static final String OPTION_ReportIncompatibleNonInheritedInterfaceMethod = "org.eclipse.wst.jsdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod"; //$NON-NLS-1$
56
	public static final String OPTION_ReportIncompatibleNonInheritedInterfaceMethod = "org.eclipse.wst.jsdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod"; //$NON-NLS-1$
59
	public static final String OPTION_ReportUnusedPrivateMember = "org.eclipse.wst.jsdt.core.compiler.problem.unusedPrivateMember"; //$NON-NLS-1$
57
	public static final String OPTION_ReportUnusedPrivateMember = "org.eclipse.wst.jsdt.core.compiler.problem.unusedPrivateMember"; //$NON-NLS-1$
60
	public static final String OPTION_ReportNoImplicitStringConversion = "org.eclipse.wst.jsdt.core.compiler.problem.noImplicitStringConversion"; //$NON-NLS-1$
58
	public static final String OPTION_ReportNoImplicitStringConversion = "org.eclipse.wst.jsdt.core.compiler.problem.noImplicitStringConversion"; //$NON-NLS-1$
Lines 78-85 Link Here
78
	public static final String OPTION_ReportMissingJavadocCommentsVisibility = "org.eclipse.wst.jsdt.core.compiler.problem.missingJavadocCommentsVisibility"; //$NON-NLS-1$
76
	public static final String OPTION_ReportMissingJavadocCommentsVisibility = "org.eclipse.wst.jsdt.core.compiler.problem.missingJavadocCommentsVisibility"; //$NON-NLS-1$
79
	public static final String OPTION_ReportMissingJavadocCommentsOverriding = "org.eclipse.wst.jsdt.core.compiler.problem.missingJavadocCommentsOverriding"; //$NON-NLS-1$
77
	public static final String OPTION_ReportMissingJavadocCommentsOverriding = "org.eclipse.wst.jsdt.core.compiler.problem.missingJavadocCommentsOverriding"; //$NON-NLS-1$
80
	public static final String OPTION_ReportFinallyBlockNotCompletingNormally = "org.eclipse.wst.jsdt.core.compiler.problem.finallyBlockNotCompletingNormally"; //$NON-NLS-1$
78
	public static final String OPTION_ReportFinallyBlockNotCompletingNormally = "org.eclipse.wst.jsdt.core.compiler.problem.finallyBlockNotCompletingNormally"; //$NON-NLS-1$
81
	public static final String OPTION_ReportUnusedDeclaredThrownException = "org.eclipse.wst.jsdt.core.compiler.problem.unusedDeclaredThrownException"; //$NON-NLS-1$
82
	public static final String OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding = "org.eclipse.wst.jsdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding"; //$NON-NLS-1$
83
	public static final String OPTION_ReportUnqualifiedFieldAccess = "org.eclipse.wst.jsdt.core.compiler.problem.unqualifiedFieldAccess"; //$NON-NLS-1$
79
	public static final String OPTION_ReportUnqualifiedFieldAccess = "org.eclipse.wst.jsdt.core.compiler.problem.unqualifiedFieldAccess"; //$NON-NLS-1$
84
	public static final String OPTION_ReportUncheckedTypeOperation = "org.eclipse.wst.jsdt.core.compiler.problem.uncheckedTypeOperation"; //$NON-NLS-1$
80
	public static final String OPTION_ReportUncheckedTypeOperation = "org.eclipse.wst.jsdt.core.compiler.problem.uncheckedTypeOperation"; //$NON-NLS-1$
85
	public static final String OPTION_ReportRawTypeReference =  "org.eclipse.wst.jsdt.core.compiler.problem.rawTypeReference"; //$NON-NLS-1$
81
	public static final String OPTION_ReportRawTypeReference =  "org.eclipse.wst.jsdt.core.compiler.problem.rawTypeReference"; //$NON-NLS-1$
Lines 167-178 Link Here
167
	public static final long UsingDeprecatedAPI = ASTNode.Bit3;
163
	public static final long UsingDeprecatedAPI = ASTNode.Bit3;
168
	public static final long MaskedCatchBlock = ASTNode.Bit4;
164
	public static final long MaskedCatchBlock = ASTNode.Bit4;
169
	public static final long UnusedLocalVariable = ASTNode.Bit5;
165
	public static final long UnusedLocalVariable = ASTNode.Bit5;
170
	public static final long UnusedArgument = ASTNode.Bit6;
171
	public static final long NoImplicitStringConversion = ASTNode.Bit7;
166
	public static final long NoImplicitStringConversion = ASTNode.Bit7;
172
//TODO: remove	AccessEmulation
167
//TODO: remove	AccessEmulation
173
	public static final long AccessEmulation = ASTNode.Bit8;	
168
	public static final long AccessEmulation = ASTNode.Bit8;	
174
	public static final long WrongNumberOfArguments = ASTNode.Bit8;
169
	public static final long WrongNumberOfArguments = ASTNode.Bit8;
175
	public static final long NonExternalizedString = ASTNode.Bit9;
176
	public static final long AssertUsedAsAnIdentifier = ASTNode.Bit10;
170
	public static final long AssertUsedAsAnIdentifier = ASTNode.Bit10;
177
	public static final long NonStaticAccessToStatic = ASTNode.Bit12;
171
	public static final long NonStaticAccessToStatic = ASTNode.Bit12;
178
	public static final long Task = ASTNode.Bit13;
172
	public static final long Task = ASTNode.Bit13;
Lines 186-192 Link Here
186
	public static final long MissingJavadocComments  = ASTNode.Bit21;
180
	public static final long MissingJavadocComments  = ASTNode.Bit21;
187
	public static final long MissingJavadocTags = ASTNode.Bit22;
181
	public static final long MissingJavadocTags = ASTNode.Bit22;
188
	public static final long UnqualifiedFieldAccess = ASTNode.Bit23;
182
	public static final long UnqualifiedFieldAccess = ASTNode.Bit23;
189
	public static final long UnusedDeclaredThrownException = ASTNode.Bit24;
190
	public static final long FinallyBlockNotCompleting = ASTNode.Bit25;
183
	public static final long FinallyBlockNotCompleting = ASTNode.Bit25;
191
	public static final long InvalidJavadoc = ASTNode.Bit26;
184
	public static final long InvalidJavadoc = ASTNode.Bit26;
192
	public static final long UnnecessaryTypeCheck = ASTNode.Bit27;
185
	public static final long UnnecessaryTypeCheck = ASTNode.Bit27;
Lines 305-313 Link Here
305
	public boolean reportUnusedParameterWhenOverridingConcrete = false;
298
	public boolean reportUnusedParameterWhenOverridingConcrete = false;
306
	public boolean reportUnusedParameterIncludeDocCommentReference = true;
299
	public boolean reportUnusedParameterIncludeDocCommentReference = true;
307
300
308
	// unused declaration of thrown exception
309
	public boolean reportUnusedDeclaredThrownExceptionWhenOverriding = false;
310
311
	// constructor/setter parameter hiding
301
	// constructor/setter parameter hiding
312
	public boolean reportSpecialParameterHidingField = false;
302
	public boolean reportSpecialParameterHidingField = false;
313
303
Lines 404-413 Link Here
404
		optionsMap.put(OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, this.reportDeprecationWhenOverridingDeprecatedMethod ? ENABLED : DISABLED);
394
		optionsMap.put(OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, this.reportDeprecationWhenOverridingDeprecatedMethod ? ENABLED : DISABLED);
405
		optionsMap.put(OPTION_ReportHiddenCatchBlock, getSeverityString(MaskedCatchBlock));
395
		optionsMap.put(OPTION_ReportHiddenCatchBlock, getSeverityString(MaskedCatchBlock));
406
		optionsMap.put(OPTION_ReportUnusedLocal, getSeverityString(UnusedLocalVariable));
396
		optionsMap.put(OPTION_ReportUnusedLocal, getSeverityString(UnusedLocalVariable));
407
		optionsMap.put(OPTION_ReportUnusedParameter, getSeverityString(UnusedArgument));
408
		optionsMap.put(OPTION_ReportWrongNumberOfArguments, getSeverityString(WrongNumberOfArguments));
397
		optionsMap.put(OPTION_ReportWrongNumberOfArguments, getSeverityString(WrongNumberOfArguments));
409
		optionsMap.put(OPTION_ReportNoEffectAssignment, getSeverityString(NoEffectAssignment));
398
		optionsMap.put(OPTION_ReportNoEffectAssignment, getSeverityString(NoEffectAssignment));
410
		optionsMap.put(OPTION_ReportNonExternalizedStringLiteral, getSeverityString(NonExternalizedString));
411
		optionsMap.put(OPTION_ReportNoImplicitStringConversion, getSeverityString(NoImplicitStringConversion));
399
		optionsMap.put(OPTION_ReportNoImplicitStringConversion, getSeverityString(NoImplicitStringConversion));
412
		optionsMap.put(OPTION_ReportNonStaticAccessToStatic, getSeverityString(NonStaticAccessToStatic));
400
		optionsMap.put(OPTION_ReportNonStaticAccessToStatic, getSeverityString(NonStaticAccessToStatic));
413
		optionsMap.put(OPTION_ReportIndirectStaticAccess, getSeverityString(IndirectStaticAccess));
401
		optionsMap.put(OPTION_ReportIndirectStaticAccess, getSeverityString(IndirectStaticAccess));
Lines 438-445 Link Here
438
		optionsMap.put(OPTION_ReportMissingJavadocCommentsVisibility, getVisibilityString(this.reportMissingJavadocCommentsVisibility));
426
		optionsMap.put(OPTION_ReportMissingJavadocCommentsVisibility, getVisibilityString(this.reportMissingJavadocCommentsVisibility));
439
		optionsMap.put(OPTION_ReportMissingJavadocCommentsOverriding, this.reportMissingJavadocCommentsOverriding ? ENABLED : DISABLED);
427
		optionsMap.put(OPTION_ReportMissingJavadocCommentsOverriding, this.reportMissingJavadocCommentsOverriding ? ENABLED : DISABLED);
440
		optionsMap.put(OPTION_ReportFinallyBlockNotCompletingNormally, getSeverityString(FinallyBlockNotCompleting));
428
		optionsMap.put(OPTION_ReportFinallyBlockNotCompletingNormally, getSeverityString(FinallyBlockNotCompleting));
441
		optionsMap.put(OPTION_ReportUnusedDeclaredThrownException, getSeverityString(UnusedDeclaredThrownException));
442
		optionsMap.put(OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding, this.reportUnusedDeclaredThrownExceptionWhenOverriding ? ENABLED : DISABLED);
443
		optionsMap.put(OPTION_ReportUnqualifiedFieldAccess, getSeverityString(UnqualifiedFieldAccess));
429
		optionsMap.put(OPTION_ReportUnqualifiedFieldAccess, getSeverityString(UnqualifiedFieldAccess));
444
		optionsMap.put(OPTION_ReportUncheckedTypeOperation, getSeverityString(UncheckedTypeOperation));
430
		optionsMap.put(OPTION_ReportUncheckedTypeOperation, getSeverityString(UncheckedTypeOperation));
445
		optionsMap.put(OPTION_ReportRawTypeReference, getSeverityString(RawTypeReference));
431
		optionsMap.put(OPTION_ReportRawTypeReference, getSeverityString(RawTypeReference));
Lines 519-532 Link Here
519
					return OPTION_ReportHiddenCatchBlock;
505
					return OPTION_ReportHiddenCatchBlock;
520
				case (int) UnusedLocalVariable :
506
				case (int) UnusedLocalVariable :
521
					return OPTION_ReportUnusedLocal;
507
					return OPTION_ReportUnusedLocal;
522
				case (int) UnusedArgument :
523
					return OPTION_ReportUnusedParameter;
524
				case (int) NoImplicitStringConversion :
508
				case (int) NoImplicitStringConversion :
525
					return OPTION_ReportNoImplicitStringConversion;
509
					return OPTION_ReportNoImplicitStringConversion;
526
				case (int) WrongNumberOfArguments :
510
				case (int) WrongNumberOfArguments :
527
					return OPTION_ReportWrongNumberOfArguments;
511
					return OPTION_ReportWrongNumberOfArguments;
528
				case (int) NonExternalizedString :
529
					return OPTION_ReportNonExternalizedStringLiteral;
530
				case (int) AssertUsedAsAnIdentifier :
512
				case (int) AssertUsedAsAnIdentifier :
531
					return OPTION_ReportAssertIdentifier;
513
					return OPTION_ReportAssertIdentifier;
532
				case (int) NonStaticAccessToStatic :
514
				case (int) NonStaticAccessToStatic :
Lines 553-560 Link Here
553
					return OPTION_ReportMissingJavadocTags;
535
					return OPTION_ReportMissingJavadocTags;
554
				case (int) UnqualifiedFieldAccess :
536
				case (int) UnqualifiedFieldAccess :
555
					return OPTION_ReportUnqualifiedFieldAccess;
537
					return OPTION_ReportUnqualifiedFieldAccess;
556
				case (int) UnusedDeclaredThrownException :
557
					return OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding;
558
				case (int) FinallyBlockNotCompleting :
538
				case (int) FinallyBlockNotCompleting :
559
					return OPTION_ReportFinallyBlockNotCompletingNormally;
539
					return OPTION_ReportFinallyBlockNotCompletingNormally;
560
				case (int) InvalidJavadoc :
540
				case (int) InvalidJavadoc :
Lines 743-755 Link Here
743
				this.reportDeprecationWhenOverridingDeprecatedMethod = false;
723
				this.reportDeprecationWhenOverridingDeprecatedMethod = false;
744
			}
724
			}
745
		}
725
		}
746
		if ((optionValue = optionsMap.get(OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding)) != null) {
747
			if (ENABLED.equals(optionValue)) {
748
				this.reportUnusedDeclaredThrownExceptionWhenOverriding = true;
749
			} else if (DISABLED.equals(optionValue)) {
750
				this.reportUnusedDeclaredThrownExceptionWhenOverriding = false;
751
			}
752
		}
753
		if ((optionValue = optionsMap.get(OPTION_Compliance)) != null) {
726
		if ((optionValue = optionsMap.get(OPTION_Compliance)) != null) {
754
			long level = versionToJdkLevel(optionValue);
727
			long level = versionToJdkLevel(optionValue);
755
			if (level != 0) this.complianceLevel = level;
728
			if (level != 0) this.complianceLevel = level;
Lines 871-879 Link Here
871
		if ((optionValue = optionsMap.get(OPTION_ReportDeprecation)) != null) updateSeverity(UsingDeprecatedAPI, optionValue);
844
		if ((optionValue = optionsMap.get(OPTION_ReportDeprecation)) != null) updateSeverity(UsingDeprecatedAPI, optionValue);
872
		if ((optionValue = optionsMap.get(OPTION_ReportHiddenCatchBlock)) != null) updateSeverity(MaskedCatchBlock, optionValue);
845
		if ((optionValue = optionsMap.get(OPTION_ReportHiddenCatchBlock)) != null) updateSeverity(MaskedCatchBlock, optionValue);
873
		if ((optionValue = optionsMap.get(OPTION_ReportUnusedLocal)) != null) updateSeverity(UnusedLocalVariable, optionValue);
846
		if ((optionValue = optionsMap.get(OPTION_ReportUnusedLocal)) != null) updateSeverity(UnusedLocalVariable, optionValue);
874
		if ((optionValue = optionsMap.get(OPTION_ReportUnusedParameter)) != null) updateSeverity(UnusedArgument, optionValue);
875
		if ((optionValue = optionsMap.get(OPTION_ReportUnusedPrivateMember)) != null) updateSeverity(UnusedPrivateMember, optionValue);
847
		if ((optionValue = optionsMap.get(OPTION_ReportUnusedPrivateMember)) != null) updateSeverity(UnusedPrivateMember, optionValue);
876
		if ((optionValue = optionsMap.get(OPTION_ReportUnusedDeclaredThrownException)) != null) updateSeverity(UnusedDeclaredThrownException, optionValue);
877
		if ((optionValue = optionsMap.get(OPTION_ReportNoImplicitStringConversion)) != null) updateSeverity(NoImplicitStringConversion, optionValue);
848
		if ((optionValue = optionsMap.get(OPTION_ReportNoImplicitStringConversion)) != null) updateSeverity(NoImplicitStringConversion, optionValue);
878
		if ((optionValue = optionsMap.get(OPTION_ReportWrongNumberOfArguments)) != null) updateSeverity(WrongNumberOfArguments, optionValue);
849
		if ((optionValue = optionsMap.get(OPTION_ReportWrongNumberOfArguments)) != null) updateSeverity(WrongNumberOfArguments, optionValue);
879
		if ((optionValue = optionsMap.get(OPTION_ReportLocalVariableHiding)) != null) updateSeverity(LocalVariableHiding, optionValue);
850
		if ((optionValue = optionsMap.get(OPTION_ReportLocalVariableHiding)) != null) updateSeverity(LocalVariableHiding, optionValue);
Lines 881-887 Link Here
881
		if ((optionValue = optionsMap.get(OPTION_ReportTypeParameterHiding)) != null) updateSeverity(TypeHiding, optionValue);
852
		if ((optionValue = optionsMap.get(OPTION_ReportTypeParameterHiding)) != null) updateSeverity(TypeHiding, optionValue);
882
		if ((optionValue = optionsMap.get(OPTION_ReportPossibleAccidentalBooleanAssignment)) != null) updateSeverity(AccidentalBooleanAssign, optionValue);
853
		if ((optionValue = optionsMap.get(OPTION_ReportPossibleAccidentalBooleanAssignment)) != null) updateSeverity(AccidentalBooleanAssign, optionValue);
883
		if ((optionValue = optionsMap.get(OPTION_ReportEmptyStatement)) != null) updateSeverity(EmptyStatement, optionValue);
854
		if ((optionValue = optionsMap.get(OPTION_ReportEmptyStatement)) != null) updateSeverity(EmptyStatement, optionValue);
884
		if ((optionValue = optionsMap.get(OPTION_ReportNonExternalizedStringLiteral)) != null) updateSeverity(NonExternalizedString, optionValue);
885
		if ((optionValue = optionsMap.get(OPTION_ReportAssertIdentifier)) != null) updateSeverity(AssertUsedAsAnIdentifier, optionValue);
855
		if ((optionValue = optionsMap.get(OPTION_ReportAssertIdentifier)) != null) updateSeverity(AssertUsedAsAnIdentifier, optionValue);
886
		if ((optionValue = optionsMap.get(OPTION_ReportEnumIdentifier)) != null) updateSeverity(EnumUsedAsAnIdentifier, optionValue);
856
		if ((optionValue = optionsMap.get(OPTION_ReportEnumIdentifier)) != null) updateSeverity(EnumUsedAsAnIdentifier, optionValue);
887
		if ((optionValue = optionsMap.get(OPTION_ReportNonStaticAccessToStatic)) != null) updateSeverity(NonStaticAccessToStatic, optionValue);
857
		if ((optionValue = optionsMap.get(OPTION_ReportNonStaticAccessToStatic)) != null) updateSeverity(NonStaticAccessToStatic, optionValue);
Lines 1049-1058 Link Here
1049
		buf.append("\n\t- deprecation: ").append(getSeverityString(UsingDeprecatedAPI)); //$NON-NLS-1$
1019
		buf.append("\n\t- deprecation: ").append(getSeverityString(UsingDeprecatedAPI)); //$NON-NLS-1$
1050
		buf.append("\n\t- masked catch block: ").append(getSeverityString(MaskedCatchBlock)); //$NON-NLS-1$
1020
		buf.append("\n\t- masked catch block: ").append(getSeverityString(MaskedCatchBlock)); //$NON-NLS-1$
1051
		buf.append("\n\t- unused local variable: ").append(getSeverityString(UnusedLocalVariable)); //$NON-NLS-1$
1021
		buf.append("\n\t- unused local variable: ").append(getSeverityString(UnusedLocalVariable)); //$NON-NLS-1$
1052
		buf.append("\n\t- unused parameter: ").append(getSeverityString(UnusedArgument)); //$NON-NLS-1$
1053
		buf.append("\n\t- synthetic access emulation: ").append(getSeverityString(AccessEmulation)); //$NON-NLS-1$
1022
		buf.append("\n\t- synthetic access emulation: ").append(getSeverityString(AccessEmulation)); //$NON-NLS-1$
1054
		buf.append("\n\t- assignment with no effect: ").append(getSeverityString(NoEffectAssignment)); //$NON-NLS-1$
1023
		buf.append("\n\t- assignment with no effect: ").append(getSeverityString(NoEffectAssignment)); //$NON-NLS-1$
1055
		buf.append("\n\t- non externalized string: ").append(getSeverityString(NonExternalizedString)); //$NON-NLS-1$
1056
		buf.append("\n\t- static access receiver: ").append(getSeverityString(NonStaticAccessToStatic)); //$NON-NLS-1$
1024
		buf.append("\n\t- static access receiver: ").append(getSeverityString(NonStaticAccessToStatic)); //$NON-NLS-1$
1057
		buf.append("\n\t- indirect static access: ").append(getSeverityString(IndirectStaticAccess)); //$NON-NLS-1$
1025
		buf.append("\n\t- indirect static access: ").append(getSeverityString(IndirectStaticAccess)); //$NON-NLS-1$
1058
		buf.append("\n\t- incompatible non inherited interface method: ").append(getSeverityString(IncompatibleNonInheritedInterfaceMethod)); //$NON-NLS-1$
1026
		buf.append("\n\t- incompatible non inherited interface method: ").append(getSeverityString(IncompatibleNonInheritedInterfaceMethod)); //$NON-NLS-1$
Lines 1077-1084 Link Here
1077
		buf.append("\n\t\t+ visibility level to report missing javadoc comments: ").append(getVisibilityString(this.reportMissingJavadocCommentsVisibility)); //$NON-NLS-1$
1045
		buf.append("\n\t\t+ visibility level to report missing javadoc comments: ").append(getVisibilityString(this.reportMissingJavadocCommentsVisibility)); //$NON-NLS-1$
1078
		buf.append("\n\t\t+ report missing javadoc comments in overriding methods: ").append(this.reportMissingJavadocCommentsOverriding ? ENABLED : DISABLED); //$NON-NLS-1$
1046
		buf.append("\n\t\t+ report missing javadoc comments in overriding methods: ").append(this.reportMissingJavadocCommentsOverriding ? ENABLED : DISABLED); //$NON-NLS-1$
1079
		buf.append("\n\t- finally block not completing normally: ").append(getSeverityString(FinallyBlockNotCompleting)); //$NON-NLS-1$
1047
		buf.append("\n\t- finally block not completing normally: ").append(getSeverityString(FinallyBlockNotCompleting)); //$NON-NLS-1$
1080
		buf.append("\n\t- unused declared thrown exception: ").append(getSeverityString(UnusedDeclaredThrownException)); //$NON-NLS-1$
1081
		buf.append("\n\t- unused declared thrown exception when overriding: ").append(this.reportUnusedDeclaredThrownExceptionWhenOverriding ? ENABLED : DISABLED); //$NON-NLS-1$
1082
		buf.append("\n\t- unnecessary else: ").append(getSeverityString(UnnecessaryElse)); //$NON-NLS-1$
1048
		buf.append("\n\t- unnecessary else: ").append(getSeverityString(UnnecessaryElse)); //$NON-NLS-1$
1083
		buf.append("\n\t- JDK compliance level: "+ versionFromJdkLevel(this.complianceLevel)); //$NON-NLS-1$
1049
		buf.append("\n\t- JDK compliance level: "+ versionFromJdkLevel(this.complianceLevel)); //$NON-NLS-1$
1084
		buf.append("\n\t- JDK source level: "+ versionFromJdkLevel(this.sourceLevel)); //$NON-NLS-1$
1050
		buf.append("\n\t- JDK source level: "+ versionFromJdkLevel(this.sourceLevel)); //$NON-NLS-1$
Lines 1232-1238 Link Here
1232
			OPTION_ReportSwitchCaseShouldBeConstant,
1198
			OPTION_ReportSwitchCaseShouldBeConstant,
1233
			OPTION_ReportNoEffectAssignment,
1199
			OPTION_ReportNoEffectAssignment,
1234
			OPTION_ReportNoImplicitStringConversion,
1200
			OPTION_ReportNoImplicitStringConversion,
1235
			OPTION_ReportNonExternalizedStringLiteral,
1236
			OPTION_ReportNonStaticAccessToStatic,
1201
			OPTION_ReportNonStaticAccessToStatic,
1237
			OPTION_ReportNullReference,
1202
			OPTION_ReportNullReference,
1238
			OPTION_ReportPotentialNullReference,
1203
			OPTION_ReportPotentialNullReference,
Lines 1248-1256 Link Here
1248
			OPTION_ReportUnnecessaryElse,
1213
			OPTION_ReportUnnecessaryElse,
1249
			OPTION_ReportUnnecessaryTypeCheck,
1214
			OPTION_ReportUnnecessaryTypeCheck,
1250
			OPTION_ReportUnqualifiedFieldAccess,
1215
			OPTION_ReportUnqualifiedFieldAccess,
1251
			OPTION_ReportUnusedDeclaredThrownException,
1252
			OPTION_ReportUnusedLocal,
1216
			OPTION_ReportUnusedLocal,
1253
			OPTION_ReportUnusedParameter,
1254
			OPTION_ReportUnusedPrivateMember,
1217
			OPTION_ReportUnusedPrivateMember,
1255
			OPTION_ReportVarargsArgumentNeedCast,
1218
			OPTION_ReportVarargsArgumentNeedCast,
1256
			OPTION_ReportUnhandledWarningToken,
1219
			OPTION_ReportUnhandledWarningToken,
Lines 1273-1286 Link Here
1273
				case (int) LocalVariableHiding :
1236
				case (int) LocalVariableHiding :
1274
				case (int) MaskedCatchBlock :
1237
				case (int) MaskedCatchBlock :
1275
					return "hiding"; //$NON-NLS-1$
1238
					return "hiding"; //$NON-NLS-1$
1276
				case (int) NonExternalizedString :
1277
					return "nls"; //$NON-NLS-1$
1278
				case (int) UnnecessaryTypeCheck :
1239
				case (int) UnnecessaryTypeCheck :
1279
					return "cast"; //$NON-NLS-1$
1240
					return "cast"; //$NON-NLS-1$
1280
				case (int) UnusedLocalVariable :
1241
				case (int) UnusedLocalVariable :
1281
				case (int) UnusedArgument :
1282
				case (int) UnusedPrivateMember:
1242
				case (int) UnusedPrivateMember:
1283
				case (int) UnusedDeclaredThrownException:
1284
					return "unused"; //$NON-NLS-1$
1243
					return "unused"; //$NON-NLS-1$
1285
				case (int) IndirectStaticAccess :
1244
				case (int) IndirectStaticAccess :
1286
				case (int) NonStaticAccessToStatic :
1245
				case (int) NonStaticAccessToStatic :
Lines 1382-1389 Link Here
1382
					return IncompleteEnumSwitch;
1341
					return IncompleteEnumSwitch;
1383
				break;
1342
				break;
1384
			case 'n' :
1343
			case 'n' :
1385
				if ("nls".equals(warningToken)) //$NON-NLS-1$
1386
					return NonExternalizedString;
1387
				if ("null".equals(warningToken)) //$NON-NLS-1$
1344
				if ("null".equals(warningToken)) //$NON-NLS-1$
1388
					return NullReference | PotentialNullReference | RedundantNullCheck;
1345
					return NullReference | PotentialNullReference | RedundantNullCheck;
1389
				break;
1346
				break;
Lines 1404-1410 Link Here
1404
				break;
1361
				break;
1405
			case 'u' :
1362
			case 'u' :
1406
				if ("unused".equals(warningToken)) //$NON-NLS-1$
1363
				if ("unused".equals(warningToken)) //$NON-NLS-1$
1407
					return UnusedLocalVariable | UnusedArgument | UnusedPrivateMember | UnusedDeclaredThrownException | UnusedLabel;
1364
					return UnusedLocalVariable | UnusedPrivateMember | UnusedLabel;
1408
				if ("unchecked".equals(warningToken)) //$NON-NLS-1$
1365
				if ("unchecked".equals(warningToken)) //$NON-NLS-1$
1409
					return UncheckedTypeOperation | RawTypeReference;
1366
					return UncheckedTypeOperation | RawTypeReference;
1410
				if ("unqualified-field-access".equals(warningToken)) //$NON-NLS-1$
1367
				if ("unqualified-field-access".equals(warningToken)) //$NON-NLS-1$
(-)src/org/eclipse/wst/jsdt/internal/core/JavaProject.java (-16 / +17 lines)
Lines 3108-3130 Link Here
3108
		}
3108
		}
3109
3109
3110
		public void setCommonSuperType(LibrarySuperType newSuperType) {
3110
		public void setCommonSuperType(LibrarySuperType newSuperType) {
3111
			String superTypeName = newSuperType.getSuperTypeName();
3111
			if(newSuperType != null) {
3112
			String superTypeContainer = newSuperType.getRawContainerPath().toString();
3112
				String superTypeName = newSuperType.getSuperTypeName();
3113
3113
				String superTypeContainer = newSuperType.getRawContainerPath().toString();
3114
			try {
3114
	
3115
				IFolder rscPath = this.project.getFolder(JavaProject.SHARED_PROPERTIES_DIRECTORY);
3115
				try {
3116
				if(!rscPath.exists()) rscPath.create(true, true, new NullProgressMonitor());
3116
					IFolder rscPath = this.project.getFolder(JavaProject.SHARED_PROPERTIES_DIRECTORY);
3117
3117
					if(!rscPath.exists()) rscPath.create(true, true, new NullProgressMonitor());
3118
				IPath fullPath = new Path(JavaProject.SHARED_PROPERTIES_DIRECTORY);
3118
	
3119
				//.append(LibrarySuperType.SUPER_TYPE_NAME);
3119
					IPath fullPath = new Path(JavaProject.SHARED_PROPERTIES_DIRECTORY);
3120
3120
					//.append(LibrarySuperType.SUPER_TYPE_NAME);
3121
				setSharedProperty(fullPath.append(LibrarySuperType.SUPER_TYPE_NAME).toString(), superTypeName);
3121
	
3122
				setSharedProperty(fullPath.append(LibrarySuperType.SUPER_TYPE_CONTAINER).toString(), superTypeContainer);
3122
					setSharedProperty(fullPath.append(LibrarySuperType.SUPER_TYPE_NAME).toString(), superTypeName);
3123
			} catch (CoreException ex) {
3123
					setSharedProperty(fullPath.append(LibrarySuperType.SUPER_TYPE_CONTAINER).toString(), superTypeContainer);
3124
				// TODO Auto-generated catch block
3124
				} catch (CoreException ex) {
3125
				ex.printStackTrace();
3125
					// TODO Auto-generated catch block
3126
					ex.printStackTrace();
3127
				}
3126
			}
3128
			}
3127
3128
		}
3129
		}
3129
3130
3130
		public ITypeRoot findTypeRoot(String fullyQualifiedName) throws JavaScriptModelException {
3131
		public ITypeRoot findTypeRoot(String fullyQualifiedName) throws JavaScriptModelException {
(-)src/org/eclipse/wst/jsdt/internal/compiler/batch/Main.java (-18 lines)
Lines 1687-1696 Link Here
1687
		this.options.put(
1687
		this.options.put(
1688
			CompilerOptions.OPTION_ReportUnusedLocal,
1688
			CompilerOptions.OPTION_ReportUnusedLocal,
1689
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1689
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1690
	} else if (token.equals("unusedArgument") || token.equals("unusedArguments")/*backward compatible*/) { //$NON-NLS-1$ //$NON-NLS-2$
1691
		this.options.put(
1692
			CompilerOptions.OPTION_ReportUnusedParameter,
1693
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1694
	} else if (token.equals("unusedPrivate")) { //$NON-NLS-1$
1690
	} else if (token.equals("unusedPrivate")) { //$NON-NLS-1$
1695
		this.options.put(
1691
		this.options.put(
1696
			CompilerOptions.OPTION_ReportUnusedPrivateMember,
1692
			CompilerOptions.OPTION_ReportUnusedPrivateMember,
Lines 1720-1729 Link Here
1720
//		this.options.put(
1716
//		this.options.put(
1721
//			CompilerOptions.OPTION_ReportSyntheticAccessEmulation,
1717
//			CompilerOptions.OPTION_ReportSyntheticAccessEmulation,
1722
//			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1718
//			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1723
	} else if (token.equals("nls")) { //$NON-NLS-1$
1724
		this.options.put(
1725
			CompilerOptions.OPTION_ReportNonExternalizedStringLiteral,
1726
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1727
	} else if (token.equals("staticReceiver")) { //$NON-NLS-1$
1719
	} else if (token.equals("staticReceiver")) { //$NON-NLS-1$
1728
		this.options.put(
1720
		this.options.put(
1729
			CompilerOptions.OPTION_ReportNonStaticAccessToStatic,
1721
			CompilerOptions.OPTION_ReportNonStaticAccessToStatic,
Lines 1867-1876 Link Here
1867
		this.options.put(
1859
		this.options.put(
1868
			CompilerOptions.OPTION_ReportFinallyBlockNotCompletingNormally,
1860
			CompilerOptions.OPTION_ReportFinallyBlockNotCompletingNormally,
1869
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1861
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1870
	} else if (token.equals("unusedThrown")) { //$NON-NLS-1$
1871
		this.options.put(
1872
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException,
1873
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1874
	} else if (token.equals("unqualifiedField") //$NON-NLS-1$
1862
	} else if (token.equals("unqualifiedField") //$NON-NLS-1$
1875
			|| token.equals("unqualified-field-access")) { //$NON-NLS-1$
1863
			|| token.equals("unqualified-field-access")) { //$NON-NLS-1$
1876
		this.options.put(
1864
		this.options.put(
Lines 1958-1972 Link Here
1958
			CompilerOptions.OPTION_ReportUnusedLocal,
1946
			CompilerOptions.OPTION_ReportUnusedLocal,
1959
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1947
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1960
		this.options.put(
1948
		this.options.put(
1961
			CompilerOptions.OPTION_ReportUnusedParameter,
1962
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1963
		this.options.put(
1964
			CompilerOptions.OPTION_ReportUnusedPrivateMember,
1949
			CompilerOptions.OPTION_ReportUnusedPrivateMember,
1965
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1950
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1966
		this.options.put(
1951
		this.options.put(
1967
			CompilerOptions.OPTION_ReportUnusedDeclaredThrownException,
1968
			isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1969
		this.options.put(
1970
				CompilerOptions.OPTION_ReportUnusedLabel,
1952
				CompilerOptions.OPTION_ReportUnusedLabel,
1971
				isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1953
				isEnabling ? CompilerOptions.WARNING : CompilerOptions.IGNORE);
1972
	} else if (token.equals("paramAssign")) { //$NON-NLS-1$
1954
	} else if (token.equals("paramAssign")) { //$NON-NLS-1$
(-)src/org/eclipse/wst/jsdt/internal/compiler/flow/ExceptionHandlingFlowContext.java (-26 / +1 lines)
Lines 13-28 Link Here
13
import java.util.ArrayList;
13
import java.util.ArrayList;
14
14
15
import org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode;
15
import org.eclipse.wst.jsdt.internal.compiler.ast.ASTNode;
16
import org.eclipse.wst.jsdt.internal.compiler.ast.AbstractMethodDeclaration;
17
import org.eclipse.wst.jsdt.internal.compiler.ast.SubRoutineStatement;
16
import org.eclipse.wst.jsdt.internal.compiler.ast.SubRoutineStatement;
18
import org.eclipse.wst.jsdt.internal.compiler.ast.TryStatement;
17
import org.eclipse.wst.jsdt.internal.compiler.ast.TryStatement;
19
import org.eclipse.wst.jsdt.internal.compiler.util.ObjectCache;
20
import org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope;
18
import org.eclipse.wst.jsdt.internal.compiler.lookup.BlockScope;
21
import org.eclipse.wst.jsdt.internal.compiler.lookup.ExtraCompilerModifiers;
22
import org.eclipse.wst.jsdt.internal.compiler.lookup.MethodScope;
23
import org.eclipse.wst.jsdt.internal.compiler.lookup.ReferenceBinding;
19
import org.eclipse.wst.jsdt.internal.compiler.lookup.ReferenceBinding;
24
import org.eclipse.wst.jsdt.internal.compiler.lookup.Scope;
20
import org.eclipse.wst.jsdt.internal.compiler.lookup.Scope;
25
import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding;
21
import org.eclipse.wst.jsdt.internal.compiler.lookup.TypeBinding;
22
import org.eclipse.wst.jsdt.internal.compiler.util.ObjectCache;
26
23
27
/**
24
/**
28
 * Reflects the context of code analysis, keeping track of enclosing
25
 * Reflects the context of code analysis, keeping track of enclosing
Lines 72-99 Link Here
72
	this.initsOnReturn = FlowInfo.DEAD_END;
69
	this.initsOnReturn = FlowInfo.DEAD_END;
73
}
70
}
74
71
75
public void complainIfUnusedExceptionHandlers(AbstractMethodDeclaration method) {
76
	MethodScope scope = method.scope;
77
	// can optionally skip overriding methods
78
	if ((method.binding.modifiers & (ExtraCompilerModifiers.AccOverriding | ExtraCompilerModifiers.AccImplementing)) != 0
79
	        && !scope.compilerOptions().reportUnusedDeclaredThrownExceptionWhenOverriding) {
80
	    return;
81
	}
82
83
	// report errors for unreachable exception handlers
84
	for (int i = 0, count = this.handledExceptions.length; i < count; i++) {
85
		int index = this.indexes.get(this.handledExceptions[i]);
86
		int cacheIndex = index / ExceptionHandlingFlowContext.BitCacheSize;
87
		int bitMask = 1 << (index % ExceptionHandlingFlowContext.BitCacheSize);
88
		if ((this.isReached[cacheIndex] & bitMask) == 0) {
89
			scope.problemReporter().unusedDeclaredThrownException(
90
				this.handledExceptions[index],
91
				method,
92
				method.thrownExceptions[index]);
93
		}
94
	}
95
}
96
97
public void complainIfUnusedExceptionHandlers(BlockScope scope,TryStatement tryStatement) {
72
public void complainIfUnusedExceptionHandlers(BlockScope scope,TryStatement tryStatement) {
98
	// report errors for unreachable exception handlers
73
	// report errors for unreachable exception handlers
99
	for (int i = 0, count = this.handledExceptions.length; i < count; i++) {
74
	for (int i = 0, count = this.handledExceptions.length; i < count; i++) {
(-)src/org/eclipse/wst/jsdt/internal/formatter/DefaultCodeFormatter.java (-4 lines)
Lines 277-286 Link Here
277
			optionsMap.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.DISABLED);
277
			optionsMap.put(CompilerOptions.OPTION_ReportDeprecationWhenOverridingDeprecatedMethod, CompilerOptions.DISABLED);
278
			optionsMap.put(CompilerOptions.OPTION_ReportHiddenCatchBlock, CompilerOptions.IGNORE);
278
			optionsMap.put(CompilerOptions.OPTION_ReportHiddenCatchBlock, CompilerOptions.IGNORE);
279
			optionsMap.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE);
279
			optionsMap.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE);
280
			optionsMap.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE);
281
			optionsMap.put(CompilerOptions.OPTION_ReportWrongNumberOfArguments, CompilerOptions.IGNORE);
280
			optionsMap.put(CompilerOptions.OPTION_ReportWrongNumberOfArguments, CompilerOptions.IGNORE);
282
			optionsMap.put(CompilerOptions.OPTION_ReportNoEffectAssignment, CompilerOptions.IGNORE);
281
			optionsMap.put(CompilerOptions.OPTION_ReportNoEffectAssignment, CompilerOptions.IGNORE);
283
			optionsMap.put(CompilerOptions.OPTION_ReportNonExternalizedStringLiteral, CompilerOptions.IGNORE);
284
			optionsMap.put(CompilerOptions.OPTION_ReportNoImplicitStringConversion, CompilerOptions.IGNORE);
282
			optionsMap.put(CompilerOptions.OPTION_ReportNoImplicitStringConversion, CompilerOptions.IGNORE);
285
			optionsMap.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, CompilerOptions.IGNORE);
283
			optionsMap.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, CompilerOptions.IGNORE);
286
			optionsMap.put(CompilerOptions.OPTION_ReportIndirectStaticAccess, CompilerOptions.IGNORE);
284
			optionsMap.put(CompilerOptions.OPTION_ReportIndirectStaticAccess, CompilerOptions.IGNORE);
Lines 306-313 Link Here
306
			optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocCommentsVisibility, CompilerOptions.IGNORE);
304
			optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocCommentsVisibility, CompilerOptions.IGNORE);
307
			optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocCommentsOverriding, CompilerOptions.DISABLED);
305
			optionsMap.put(CompilerOptions.OPTION_ReportMissingJavadocCommentsOverriding, CompilerOptions.DISABLED);
308
			optionsMap.put(CompilerOptions.OPTION_ReportFinallyBlockNotCompletingNormally, CompilerOptions.IGNORE);
306
			optionsMap.put(CompilerOptions.OPTION_ReportFinallyBlockNotCompletingNormally, CompilerOptions.IGNORE);
309
			optionsMap.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownException, CompilerOptions.IGNORE);
310
			optionsMap.put(CompilerOptions.OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding, CompilerOptions.DISABLED);
311
			optionsMap.put(CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, CompilerOptions.IGNORE);
307
			optionsMap.put(CompilerOptions.OPTION_ReportUnqualifiedFieldAccess, CompilerOptions.IGNORE);
312
			optionsMap.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4);
308
			optionsMap.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_4);
313
			optionsMap.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_2);
309
			optionsMap.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_2);
(-)src/org/eclipse/wst/jsdt/core/tests/model/ResolveTests.java (-7 / +8 lines)
Lines 10-21 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.wst.jsdt.core.tests.model;
11
package org.eclipse.wst.jsdt.core.tests.model;
12
12
13
import java.io.IOException;
13
import junit.framework.Test;
14
14
15
import org.eclipse.core.runtime.CoreException;
15
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
16
import org.eclipse.wst.jsdt.core.*;
16
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
17
17
import org.eclipse.wst.jsdt.core.ILocalVariable;
18
import junit.framework.*;
18
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
19
import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
19
20
20
public class ResolveTests extends AbstractJavaModelTests {
21
public class ResolveTests extends AbstractJavaModelTests {
21
	IJavaScriptUnit wc = null;
22
	IJavaScriptUnit wc = null;
Lines 34-46 Link Here
34
public IJavaScriptUnit getWorkingCopy(String path, String source) throws JavaScriptModelException {
35
public IJavaScriptUnit getWorkingCopy(String path, String source) throws JavaScriptModelException {
35
	return super.getWorkingCopy(path, source, this.owner, null);
36
	return super.getWorkingCopy(path, source, this.owner, null);
36
}
37
}
37
private IJavaScriptElement[] select(String path, String source, String selection) throws JavaScriptModelException {
38
/*private IJavaScriptElement[] select(String path, String source, String selection) throws JavaScriptModelException {
38
	this.wc = getWorkingCopy(path, source);
39
	this.wc = getWorkingCopy(path, source);
39
	String str = wc.getSource();
40
	String str = wc.getSource();
40
	int start = str.lastIndexOf(selection);
41
	int start = str.lastIndexOf(selection);
41
	int length = selection.length();
42
	int length = selection.length();
42
	return wc.codeSelect(start, length, this.owner);
43
	return wc.codeSelect(start, length, this.owner);
43
}
44
}*/
44
public void setUpSuite() throws Exception {
45
public void setUpSuite() throws Exception {
45
	super.setUpSuite();
46
	super.setUpSuite();
46
	
47
	
(-)src/org/eclipse/wst/jsdt/core/tests/model/ReconcilerTests.java (-10 / +11 lines)
Lines 11-35 Link Here
11
package org.eclipse.wst.jsdt.core.tests.model;
11
package org.eclipse.wst.jsdt.core.tests.model;
12
12
13
13
14
import java.io.File;
15
import java.io.IOException;
14
import java.io.IOException;
16
15
17
import junit.framework.Test;
16
import junit.framework.Test;
18
17
19
import org.eclipse.core.resources.IResource;
20
import org.eclipse.core.resources.IWorkspaceRunnable;
18
import org.eclipse.core.resources.IWorkspaceRunnable;
21
import org.eclipse.core.runtime.CoreException;
19
import org.eclipse.core.runtime.CoreException;
22
import org.eclipse.core.runtime.ILogListener;
23
import org.eclipse.core.runtime.IProgressMonitor;
20
import org.eclipse.core.runtime.IProgressMonitor;
24
import org.eclipse.core.runtime.IStatus;
25
import org.eclipse.core.runtime.OperationCanceledException;
21
import org.eclipse.core.runtime.OperationCanceledException;
26
import org.eclipse.core.runtime.Path;
22
import org.eclipse.wst.jsdt.core.IBuffer;
27
import org.eclipse.core.runtime.Platform;
23
import org.eclipse.wst.jsdt.core.IIncludePathEntry;
28
import org.eclipse.wst.jsdt.core.*;
24
import org.eclipse.wst.jsdt.core.IJavaScriptElementDelta;
25
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
26
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
27
import org.eclipse.wst.jsdt.core.JavaScriptCore;
28
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
29
import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
29
import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem;
30
import org.eclipse.wst.jsdt.core.compiler.CategorizedProblem;
30
import org.eclipse.wst.jsdt.core.compiler.ValidationParticipant;
31
import org.eclipse.wst.jsdt.core.compiler.IProblem;
31
import org.eclipse.wst.jsdt.core.compiler.IProblem;
32
import org.eclipse.wst.jsdt.core.compiler.ReconcileContext;
32
import org.eclipse.wst.jsdt.core.compiler.ReconcileContext;
33
import org.eclipse.wst.jsdt.core.compiler.ValidationParticipant;
33
import org.eclipse.wst.jsdt.core.dom.AST;
34
import org.eclipse.wst.jsdt.core.dom.AST;
34
import org.eclipse.wst.jsdt.core.tests.util.Util;
35
import org.eclipse.wst.jsdt.core.tests.util.Util;
35
import org.eclipse.wst.jsdt.internal.core.CompilationUnit;
36
import org.eclipse.wst.jsdt.internal.core.CompilationUnit;
Lines 213-221 Link Here
213
//	project15.setOption(JavaScriptCore.COMPILER_PB_UNUSED_LOCAL, JavaScriptCore.IGNORE);
214
//	project15.setOption(JavaScriptCore.COMPILER_PB_UNUSED_LOCAL, JavaScriptCore.IGNORE);
214
//	project15.setOption(JavaScriptCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaScriptCore.IGNORE);
215
//	project15.setOption(JavaScriptCore.COMPILER_PB_RAW_TYPE_REFERENCE, JavaScriptCore.IGNORE);
215
}
216
}
216
private void setUp15WorkingCopy() throws JavaScriptModelException {
217
/*private void setUp15WorkingCopy() throws JavaScriptModelException {
217
	setUp15WorkingCopy("Reconciler15/src/p1/X.js", new WorkingCopyOwner() {});
218
	setUp15WorkingCopy("Reconciler15/src/p1/X.js", new WorkingCopyOwner() {});
218
}
219
}*/
219
private void setUp15WorkingCopy(String path, WorkingCopyOwner owner) throws JavaScriptModelException {
220
private void setUp15WorkingCopy(String path, WorkingCopyOwner owner) throws JavaScriptModelException {
220
	String contents = this.workingCopy.getSource();
221
	String contents = this.workingCopy.getSource();
221
	setUpWorkingCopy(path, contents, owner);
222
	setUpWorkingCopy(path, contents, owner);
(-)src/org/eclipse/wst/jsdt/core/tests/model/CodeCorrectionTests.java (-7 lines)
Lines 767-775 Link Here
767
	assertEquals("wrong token", "deprecation", CorrectionEngine.getWarningToken(IProblem.UsingDeprecatedField));
767
	assertEquals("wrong token", "deprecation", CorrectionEngine.getWarningToken(IProblem.UsingDeprecatedField));
768
	assertEquals("wrong token", "boxing", CorrectionEngine.getWarningToken(IProblem.BoxingConversion));
768
	assertEquals("wrong token", "boxing", CorrectionEngine.getWarningToken(IProblem.BoxingConversion));
769
	assertEquals("wrong token", "boxing", CorrectionEngine.getWarningToken(IProblem.UnboxingConversion));
769
	assertEquals("wrong token", "boxing", CorrectionEngine.getWarningToken(IProblem.UnboxingConversion));
770
	assertEquals("wrong token", "dep-ann", CorrectionEngine.getWarningToken(IProblem.FieldMissingDeprecatedAnnotation));
771
	assertEquals("wrong token", "dep-ann", CorrectionEngine.getWarningToken(IProblem.MethodMissingDeprecatedAnnotation));
772
	assertEquals("wrong token", "dep-ann", CorrectionEngine.getWarningToken(IProblem.TypeMissingDeprecatedAnnotation));
773
	assertEquals("wrong token", "finally", CorrectionEngine.getWarningToken(IProblem.FinallyMustCompleteNormally));
770
	assertEquals("wrong token", "finally", CorrectionEngine.getWarningToken(IProblem.FinallyMustCompleteNormally));
774
	assertEquals("wrong token", "hiding", CorrectionEngine.getWarningToken(IProblem.FieldHidingLocalVariable));
771
	assertEquals("wrong token", "hiding", CorrectionEngine.getWarningToken(IProblem.FieldHidingLocalVariable));
775
	assertEquals("wrong token", "hiding", CorrectionEngine.getWarningToken(IProblem.FieldHidingField));
772
	assertEquals("wrong token", "hiding", CorrectionEngine.getWarningToken(IProblem.FieldHidingField));
Lines 779-794 Link Here
779
	assertEquals("wrong token", "hiding", CorrectionEngine.getWarningToken(IProblem.ArgumentHidingField));
776
	assertEquals("wrong token", "hiding", CorrectionEngine.getWarningToken(IProblem.ArgumentHidingField));
780
	assertEquals("wrong token", "hiding", CorrectionEngine.getWarningToken(IProblem.MaskedCatch));
777
	assertEquals("wrong token", "hiding", CorrectionEngine.getWarningToken(IProblem.MaskedCatch));
781
	assertEquals("wrong token", "hiding", CorrectionEngine.getWarningToken(IProblem.TypeParameterHidingType));
778
	assertEquals("wrong token", "hiding", CorrectionEngine.getWarningToken(IProblem.TypeParameterHidingType));
782
	assertEquals("wrong token", "nls", CorrectionEngine.getWarningToken(IProblem.NonExternalizedStringLiteral));
783
	assertEquals("wrong token", "incomplete-switch", CorrectionEngine.getWarningToken(IProblem.MissingEnumConstantCase));
779
	assertEquals("wrong token", "incomplete-switch", CorrectionEngine.getWarningToken(IProblem.MissingEnumConstantCase));
784
	assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.LocalVariableIsNeverUsed));
780
	assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.LocalVariableIsNeverUsed));
785
	assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.ArgumentIsNeverUsed));
786
	assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.UnusedPrivateConstructor));
781
	assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.UnusedPrivateConstructor));
787
	assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.UnusedPrivateMethod));
782
	assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.UnusedPrivateMethod));
788
	assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.UnusedPrivateField));
783
	assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.UnusedPrivateField));
789
	assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.UnusedPrivateType));
784
	assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.UnusedPrivateType));
790
	assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.UnusedMethodDeclaredThrownException));
791
	assertEquals("wrong token", "unused", CorrectionEngine.getWarningToken(IProblem.UnusedConstructorDeclaredThrownException));
792
	assertEquals("wrong token", "static-access", CorrectionEngine.getWarningToken(IProblem.IndirectAccessToStaticMethod));
785
	assertEquals("wrong token", "static-access", CorrectionEngine.getWarningToken(IProblem.IndirectAccessToStaticMethod));
793
	assertEquals("wrong token", "static-access", CorrectionEngine.getWarningToken(IProblem.IndirectAccessToStaticField));
786
	assertEquals("wrong token", "static-access", CorrectionEngine.getWarningToken(IProblem.IndirectAccessToStaticField));
794
	assertEquals("wrong token", "static-access", CorrectionEngine.getWarningToken(IProblem.IndirectAccessToStaticType));
787
	assertEquals("wrong token", "static-access", CorrectionEngine.getWarningToken(IProblem.IndirectAccessToStaticType));
(-)src/org/eclipse/wst/jsdt/core/tests/model/JavaConventionTests.java (-4 / +6 lines)
Lines 10-20 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.wst.jsdt.core.tests.model;
11
package org.eclipse.wst.jsdt.core.tests.model;
12
12
13
import java.util.*;
13
import java.util.ArrayList;
14
import java.util.List;
15
14
import junit.framework.Test;
16
import junit.framework.Test;
15
import org.eclipse.core.resources.IResource;
17
16
import org.eclipse.core.runtime.*;
18
import org.eclipse.core.runtime.IStatus;
17
import org.eclipse.wst.jsdt.core.*;
19
import org.eclipse.wst.jsdt.core.JavaScriptConventions;
18
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
20
import org.eclipse.wst.jsdt.internal.compiler.impl.CompilerOptions;
19
21
20
public class JavaConventionTests extends AbstractJavaModelTests {
22
public class JavaConventionTests extends AbstractJavaModelTests {
(-)src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests2.java (-7 / +5 lines)
Lines 14-26 Link Here
14
import java.io.FileOutputStream;
14
import java.io.FileOutputStream;
15
import java.io.IOException;
15
import java.io.IOException;
16
import java.util.HashMap;
16
import java.util.HashMap;
17
import java.util.Hashtable;
18
import java.util.Map;
17
import java.util.Map;
19
import java.util.StringTokenizer;
18
import java.util.StringTokenizer;
20
19
20
import junit.framework.ComparisonFailure;
21
import junit.framework.Test;
22
21
import org.eclipse.core.resources.IFile;
23
import org.eclipse.core.resources.IFile;
22
import org.eclipse.core.resources.IProject;
24
import org.eclipse.core.resources.IProject;
23
import org.eclipse.core.resources.IResource;
24
import org.eclipse.core.resources.IWorkspaceRunnable;
25
import org.eclipse.core.resources.IWorkspaceRunnable;
25
import org.eclipse.core.runtime.CoreException;
26
import org.eclipse.core.runtime.CoreException;
26
import org.eclipse.core.runtime.IPath;
27
import org.eclipse.core.runtime.IPath;
Lines 28-42 Link Here
28
import org.eclipse.core.runtime.Path;
29
import org.eclipse.core.runtime.Path;
29
import org.eclipse.wst.jsdt.core.IAccessRule;
30
import org.eclipse.wst.jsdt.core.IAccessRule;
30
import org.eclipse.wst.jsdt.core.IIncludePathAttribute;
31
import org.eclipse.wst.jsdt.core.IIncludePathAttribute;
31
import org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer;
32
import org.eclipse.wst.jsdt.core.IIncludePathEntry;
32
import org.eclipse.wst.jsdt.core.IIncludePathEntry;
33
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
34
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
33
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
34
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
35
import org.eclipse.wst.jsdt.core.IJsGlobalScopeContainer;
35
import org.eclipse.wst.jsdt.core.JavaScriptCore;
36
import org.eclipse.wst.jsdt.core.JavaScriptCore;
36
import org.eclipse.wst.jsdt.internal.codeassist.RelevanceConstants;
37
import org.eclipse.wst.jsdt.internal.codeassist.RelevanceConstants;
37
import org.eclipse.wst.jsdt.internal.core.JavaModelManager;
38
39
import junit.framework.*;
40
38
41
public class CompletionTests2 extends ModifyingResourceTests implements RelevanceConstants {
39
public class CompletionTests2 extends ModifyingResourceTests implements RelevanceConstants {
42
	
40
	
(-)src/org/eclipse/wst/jsdt/core/tests/model/CompilationUnitTests.java (-2 / +2 lines)
Lines 81-92 Link Here
81
	super.tearDownSuite();
81
	super.tearDownSuite();
82
}
82
}
83
83
84
private IJavaScriptUnit createWorkingCopy(String source) throws JavaScriptModelException {
84
/*private IJavaScriptUnit createWorkingCopy(String source) throws JavaScriptModelException {
85
	this.workingCopy = getCompilationUnit("/P/src/p/Y.js").getWorkingCopy(new WorkingCopyOwner(){}, null, null);
85
	this.workingCopy = getCompilationUnit("/P/src/p/Y.js").getWorkingCopy(new WorkingCopyOwner(){}, null, null);
86
	this.workingCopy.getBuffer().setContents(source);
86
	this.workingCopy.getBuffer().setContents(source);
87
	this.workingCopy.makeConsistent(null);
87
	this.workingCopy.makeConsistent(null);
88
	return workingCopy;
88
	return workingCopy;
89
}
89
}*/
90
/**
90
/**
91
 * Create working copy and compute problems.
91
 * Create working copy and compute problems.
92
 * 
92
 * 
(-)src/org/eclipse/wst/jsdt/core/tests/model/WorkingCopyTests.java (-6 / +17 lines)
Lines 10-27 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.wst.jsdt.core.tests.model;
11
package org.eclipse.wst.jsdt.core.tests.model;
12
12
13
import java.io.IOException;
14
import java.util.Vector;
15
16
import junit.framework.Test;
13
import junit.framework.Test;
17
14
18
import org.eclipse.core.resources.IProject;
15
import org.eclipse.core.resources.IProject;
19
import org.eclipse.core.resources.IResource;
16
import org.eclipse.core.resources.IResource;
20
import org.eclipse.core.resources.IWorkspaceRunnable;
17
import org.eclipse.core.resources.IWorkspaceRunnable;
21
import org.eclipse.core.runtime.*;
18
import org.eclipse.core.runtime.CoreException;
22
import org.eclipse.wst.jsdt.core.*;
19
import org.eclipse.core.runtime.IProgressMonitor;
23
import org.eclipse.wst.jsdt.internal.core.util.Util;
20
import org.eclipse.core.runtime.NullProgressMonitor;
21
import org.eclipse.core.runtime.OperationCanceledException;
22
import org.eclipse.core.runtime.Path;
24
import org.eclipse.team.core.RepositoryProvider;
23
import org.eclipse.team.core.RepositoryProvider;
24
import org.eclipse.wst.jsdt.core.IBuffer;
25
import org.eclipse.wst.jsdt.core.IField;
26
import org.eclipse.wst.jsdt.core.IFunction;
27
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
28
import org.eclipse.wst.jsdt.core.IJavaScriptModelStatusConstants;
29
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
30
import org.eclipse.wst.jsdt.core.IOpenable;
31
import org.eclipse.wst.jsdt.core.IPackageFragment;
32
import org.eclipse.wst.jsdt.core.JavaScriptCore;
33
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
34
import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
35
import org.eclipse.wst.jsdt.internal.core.util.Util;
25
36
26
37
27
38
(-)src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingExpressionsTest.java (-3 / +25 lines)
Lines 16-25 Link Here
16
16
17
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
17
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
18
import org.eclipse.wst.jsdt.core.IPackageFragment;
18
import org.eclipse.wst.jsdt.core.IPackageFragment;
19
19
import org.eclipse.wst.jsdt.core.dom.AST;
20
import org.eclipse.wst.jsdt.core.dom.*;
20
import org.eclipse.wst.jsdt.core.dom.ASTNode;
21
import org.eclipse.wst.jsdt.core.dom.ArrayAccess;
22
import org.eclipse.wst.jsdt.core.dom.Assignment;
23
import org.eclipse.wst.jsdt.core.dom.Block;
24
import org.eclipse.wst.jsdt.core.dom.BooleanLiteral;
25
import org.eclipse.wst.jsdt.core.dom.CatchClause;
26
import org.eclipse.wst.jsdt.core.dom.CharacterLiteral;
27
import org.eclipse.wst.jsdt.core.dom.ConditionalExpression;
28
import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
29
import org.eclipse.wst.jsdt.core.dom.FieldAccess;
30
import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
31
import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
32
import org.eclipse.wst.jsdt.core.dom.InfixExpression;
33
import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
34
import org.eclipse.wst.jsdt.core.dom.NumberLiteral;
35
import org.eclipse.wst.jsdt.core.dom.ParenthesizedExpression;
36
import org.eclipse.wst.jsdt.core.dom.PostfixExpression;
37
import org.eclipse.wst.jsdt.core.dom.PrefixExpression;
38
import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
39
import org.eclipse.wst.jsdt.core.dom.SimpleName;
40
import org.eclipse.wst.jsdt.core.dom.SingleVariableDeclaration;
41
import org.eclipse.wst.jsdt.core.dom.StringLiteral;
42
import org.eclipse.wst.jsdt.core.dom.ThisExpression;
43
import org.eclipse.wst.jsdt.core.dom.TryStatement;
21
import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite;
44
import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite;
22
import org.eclipse.wst.jsdt.core.dom.rewrite.ListRewrite;
23
45
24
public class ASTRewritingExpressionsTest extends ASTRewritingTest {
46
public class ASTRewritingExpressionsTest extends ASTRewritingTest {
25
	private static final Class THIS= ASTRewritingExpressionsTest.class;
47
	private static final Class THIS= ASTRewritingExpressionsTest.class;
(-)src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingGroupNodeTest.java (-3 / +1 lines)
Lines 15-31 Link Here
15
15
16
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
16
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
17
import org.eclipse.wst.jsdt.core.IPackageFragment;
17
import org.eclipse.wst.jsdt.core.IPackageFragment;
18
19
import org.eclipse.wst.jsdt.core.dom.AST;
18
import org.eclipse.wst.jsdt.core.dom.AST;
20
import org.eclipse.wst.jsdt.core.dom.ASTNode;
19
import org.eclipse.wst.jsdt.core.dom.ASTNode;
21
import org.eclipse.wst.jsdt.core.dom.Block;
20
import org.eclipse.wst.jsdt.core.dom.Block;
22
import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
23
import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
21
import org.eclipse.wst.jsdt.core.dom.ExpressionStatement;
24
import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
22
import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
25
import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
23
import org.eclipse.wst.jsdt.core.dom.FunctionInvocation;
24
import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
26
import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
25
import org.eclipse.wst.jsdt.core.dom.ReturnStatement;
27
import org.eclipse.wst.jsdt.core.dom.Statement;
26
import org.eclipse.wst.jsdt.core.dom.Statement;
28
import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
29
import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite;
27
import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite;
30
28
31
public class ASTRewritingGroupNodeTest extends ASTRewritingTest {
29
public class ASTRewritingGroupNodeTest extends ASTRewritingTest {
(-)src/org/eclipse/wst/jsdt/core/tests/rewrite/describing/ASTRewritingInsertBoundTest.java (-4 / +1 lines)
Lines 19-32 Link Here
19
19
20
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
20
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
21
import org.eclipse.wst.jsdt.core.IPackageFragment;
21
import org.eclipse.wst.jsdt.core.IPackageFragment;
22
23
import org.eclipse.wst.jsdt.core.dom.AST;
22
import org.eclipse.wst.jsdt.core.dom.AST;
24
import org.eclipse.wst.jsdt.core.dom.ASTNode;
23
import org.eclipse.wst.jsdt.core.dom.ASTNode;
25
import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
26
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
24
import org.eclipse.wst.jsdt.core.dom.FieldDeclaration;
27
import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
25
import org.eclipse.wst.jsdt.core.dom.FunctionDeclaration;
28
import org.eclipse.wst.jsdt.core.dom.PrimitiveType;
26
import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
29
import org.eclipse.wst.jsdt.core.dom.TypeDeclaration;
30
import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
27
import org.eclipse.wst.jsdt.core.dom.VariableDeclarationFragment;
31
import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
28
import org.eclipse.wst.jsdt.core.dom.VariableDeclarationStatement;
32
import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite;
29
import org.eclipse.wst.jsdt.core.dom.rewrite.ASTRewrite;
(-)src/org/eclipse/wst/jsdt/core/tests/formatter/FormatterRegressionTests.java (-2 lines)
Lines 6449-6455 Link Here
6449
		String resourcePath = getResource("test492", "core_formatting.xml");
6449
		String resourcePath = getResource("test492", "core_formatting.xml");
6450
		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "core");
6450
		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "core");
6451
		assertNotNull("No preferences", options);
6451
		assertNotNull("No preferences", options);
6452
		options.put(JavaScriptCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaScriptCore.ERROR);
6453
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6452
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6454
		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, options);
6453
		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, options);
6455
		runTest(codeFormatter, "test492", "Main.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6454
		runTest(codeFormatter, "test492", "Main.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
Lines 6820-6826 Link Here
6820
		String resourcePath = getResource("test514", "formatter.xml");
6819
		String resourcePath = getResource("test514", "formatter.xml");
6821
		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "core");
6820
		Map options = DecodeCodeFormatterPreferences.decodeCodeFormatterOptions(resourcePath, "core");
6822
		assertNotNull("No preferences", options);
6821
		assertNotNull("No preferences", options);
6823
		options.put(JavaScriptCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaScriptCore.ERROR);
6824
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6822
		DefaultCodeFormatterOptions preferences = new DefaultCodeFormatterOptions(options);
6825
		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, options);
6823
		DefaultCodeFormatter codeFormatter = new DefaultCodeFormatter(preferences, options);
6826
		runTest(codeFormatter, "test514", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
6824
		runTest(codeFormatter, "test514", "A.js", CodeFormatter.K_JAVASCRIPT_UNIT);//$NON-NLS-1$ //$NON-NLS-2$
(-)src/org/eclipse/wst/jsdt/internal/corext/fix/CleanUpConstants.java (-48 lines)
Lines 777-803 Link Here
777
	public static final String REMOVE_UNNECESSARY_CASTS= "cleanup.remove_unnecessary_casts"; //$NON-NLS-1$
777
	public static final String REMOVE_UNNECESSARY_CASTS= "cleanup.remove_unnecessary_casts"; //$NON-NLS-1$
778
	
778
	
779
	/**
779
	/**
780
	 * Remove unnecessary '$NON-NLS$' tags.
781
	 * <p>
782
	 * i.e.:
783
	 * 
784
	 * <pre><code>
785
	 * String s; //$NON-NLS-1$ -&gt; String s;
786
	 * </code></pre>
787
	 * 
788
	 * <br>
789
	 * <br>
790
	 * Possible values: {TRUE, FALSE}<br>
791
	 * Default value: Value returned by {@link #getEclipseDefaultSettings()}<br>
792
	 * <br>
793
	 * 
794
	 * @see #TRUE
795
	 * @see #FALSE
796
	 * 
797
	 */
798
	public static final String REMOVE_UNNECESSARY_NLS_TAGS= "cleanup.remove_unnecessary_nls_tags"; //$NON-NLS-1$
799
	
800
	/**
801
	 * Controls whether missing annotations should be added to the code. For
780
	 * Controls whether missing annotations should be added to the code. For
802
	 * detailed settings use:<br>
781
	 * detailed settings use:<br>
803
	 * {@link #ADD_MISSING_ANNOTATIONS_DEPRECATED}<br>
782
	 * {@link #ADD_MISSING_ANNOTATIONS_DEPRECATED}<br>
Lines 917-943 Link Here
917
	public static final String ADD_MISSING_SERIAL_VERSION_ID_DEFAULT= "cleanup.add_default_serial_version_id"; //$NON-NLS-1$
896
	public static final String ADD_MISSING_SERIAL_VERSION_ID_DEFAULT= "cleanup.add_default_serial_version_id"; //$NON-NLS-1$
918
	
897
	
919
	/**
898
	/**
920
	 * Add '$NON-NLS$' tags to non externalized strings.
921
	 * <p>
922
	 * i.e.:
923
	 * 
924
	 * <pre><code>
925
	 *                   	 String s= &quot;&quot;; -&gt; String s= &quot;&quot;; //$NON-NLS-1$
926
	 * </code></pre>
927
	 * 
928
	 * <br>
929
	 * <br>
930
	 * Possible values: {TRUE, FALSE}<br>
931
	 * Default value: Value returned by {@link #getEclipseDefaultSettings()}<br>
932
	 * <br>
933
	 * 
934
	 * @see #TRUE
935
	 * @see #FALSE
936
	 * 
937
	 */
938
	public static final String ADD_MISSING_NLS_TAGS= "cleanup.add_missing_nls_tags"; //$NON-NLS-1$
939
	
940
	/**
941
	 * If true the imports are organized while cleaning up code.
899
	 * If true the imports are organized while cleaning up code.
942
	 * 
900
	 * 
943
	 * Possible values: {TRUE, FALSE}<br>
901
	 * Possible values: {TRUE, FALSE}<br>
Lines 1125-1131 Link Here
1125
		
1083
		
1126
		//Unnecessary Code
1084
		//Unnecessary Code
1127
		result.put(REMOVE_UNNECESSARY_CASTS, TRUE);
1085
		result.put(REMOVE_UNNECESSARY_CASTS, TRUE);
1128
		result.put(REMOVE_UNNECESSARY_NLS_TAGS, TRUE);
1129
		
1086
		
1130
		//Missing Code
1087
		//Missing Code
1131
		result.put(ADD_MISSING_ANNOTATIONS, TRUE);
1088
		result.put(ADD_MISSING_ANNOTATIONS, TRUE);
Lines 1136-1143 Link Here
1136
		result.put(ADD_MISSING_SERIAL_VERSION_ID_GENERATED, FALSE);
1093
		result.put(ADD_MISSING_SERIAL_VERSION_ID_GENERATED, FALSE);
1137
		result.put(ADD_MISSING_SERIAL_VERSION_ID_DEFAULT, TRUE);
1094
		result.put(ADD_MISSING_SERIAL_VERSION_ID_DEFAULT, TRUE);
1138
		
1095
		
1139
		result.put(ADD_MISSING_NLS_TAGS, FALSE);
1140
		
1141
		//Code Organising
1096
		//Code Organising
1142
		result.put(FORMAT_SOURCE_CODE, FALSE);
1097
		result.put(FORMAT_SOURCE_CODE, FALSE);
1143
		
1098
		
Lines 1201-1207 Link Here
1201
		
1156
		
1202
		//Unnecessary Code
1157
		//Unnecessary Code
1203
		result.put(REMOVE_UNNECESSARY_CASTS, TRUE);
1158
		result.put(REMOVE_UNNECESSARY_CASTS, TRUE);
1204
		result.put(REMOVE_UNNECESSARY_NLS_TAGS, FALSE);
1205
		
1159
		
1206
		//Missing Code
1160
		//Missing Code
1207
		result.put(ADD_MISSING_ANNOTATIONS, TRUE);
1161
		result.put(ADD_MISSING_ANNOTATIONS, TRUE);
Lines 1212-1219 Link Here
1212
		result.put(ADD_MISSING_SERIAL_VERSION_ID_GENERATED, FALSE);
1166
		result.put(ADD_MISSING_SERIAL_VERSION_ID_GENERATED, FALSE);
1213
		result.put(ADD_MISSING_SERIAL_VERSION_ID_DEFAULT, TRUE);
1167
		result.put(ADD_MISSING_SERIAL_VERSION_ID_DEFAULT, TRUE);
1214
		
1168
		
1215
		result.put(ADD_MISSING_NLS_TAGS, FALSE);
1216
		
1217
		//Code Organising
1169
		//Code Organising
1218
		result.put(FORMAT_SOURCE_CODE, FALSE);
1170
		result.put(FORMAT_SOURCE_CODE, FALSE);
1219
		
1171
		
(-)src/org/eclipse/wst/jsdt/internal/corext/fix/CleanUpRefactoring.java (-3 lines)
Lines 66-72 Link Here
66
import org.eclipse.wst.jsdt.internal.ui.fix.ExpressionsCleanUp;
66
import org.eclipse.wst.jsdt.internal.ui.fix.ExpressionsCleanUp;
67
import org.eclipse.wst.jsdt.internal.ui.fix.ICleanUp;
67
import org.eclipse.wst.jsdt.internal.ui.fix.ICleanUp;
68
import org.eclipse.wst.jsdt.internal.ui.fix.SortMembersCleanUp;
68
import org.eclipse.wst.jsdt.internal.ui.fix.SortMembersCleanUp;
69
import org.eclipse.wst.jsdt.internal.ui.fix.StringCleanUp;
70
import org.eclipse.wst.jsdt.internal.ui.fix.UnusedCodeCleanUp;
69
import org.eclipse.wst.jsdt.internal.ui.fix.UnusedCodeCleanUp;
71
import org.eclipse.wst.jsdt.internal.ui.javaeditor.ASTProvider;
70
import org.eclipse.wst.jsdt.internal.ui.javaeditor.ASTProvider;
72
import org.eclipse.wst.jsdt.internal.ui.refactoring.IScheduledRefactoring;
71
import org.eclipse.wst.jsdt.internal.ui.refactoring.IScheduledRefactoring;
Lines 1036-1042 Link Here
1036
				new UnusedCodeCleanUp(), 
1035
				new UnusedCodeCleanUp(), 
1037
//				new Java50CleanUp(), 
1036
//				new Java50CleanUp(), 
1038
//				new UnnecessaryCodeCleanUp(), 
1037
//				new UnnecessaryCodeCleanUp(), 
1039
				new StringCleanUp(), 
1040
				new SortMembersCleanUp(), 
1038
				new SortMembersCleanUp(), 
1041
//				new ImportsCleanUp(), 
1039
//				new ImportsCleanUp(), 
1042
				new CodeFormatCleanUp(), 
1040
				new CodeFormatCleanUp(), 
Lines 1053-1059 Link Here
1053
				new UnusedCodeCleanUp(settings), 
1051
				new UnusedCodeCleanUp(settings), 
1054
//				new Java50CleanUp(settings), 
1052
//				new Java50CleanUp(settings), 
1055
//				new UnnecessaryCodeCleanUp(settings), 
1053
//				new UnnecessaryCodeCleanUp(settings), 
1056
				new StringCleanUp(settings),
1057
				new SortMembersCleanUp(settings), 
1054
				new SortMembersCleanUp(settings), 
1058
//				new ImportsCleanUp(settings), 
1055
//				new ImportsCleanUp(settings), 
1059
				new CodeFormatCleanUp(settings), 
1056
				new CodeFormatCleanUp(settings), 
(-)src/org/eclipse/wst/jsdt/internal/corext/fix/UnusedCodeFix.java (-1 / +1 lines)
Lines 466-472 Link Here
466
	public static UnusedCodeFix createUnusedMemberFix(JavaScriptUnit compilationUnit, IProblemLocation problem, boolean forceInitializerRemoval) {
466
	public static UnusedCodeFix createUnusedMemberFix(JavaScriptUnit compilationUnit, IProblemLocation problem, boolean forceInitializerRemoval) {
467
		int id= problem.getProblemId();
467
		int id= problem.getProblemId();
468
		if (id == IProblem.UnusedPrivateMethod || id == IProblem.UnusedPrivateConstructor || id == IProblem.UnusedPrivateField ||
468
		if (id == IProblem.UnusedPrivateMethod || id == IProblem.UnusedPrivateConstructor || id == IProblem.UnusedPrivateField ||
469
		    id == IProblem.UnusedPrivateType || id == IProblem.LocalVariableIsNeverUsed || id == IProblem.ArgumentIsNeverUsed) {
469
		    id == IProblem.UnusedPrivateType || id == IProblem.LocalVariableIsNeverUsed) {
470
			
470
			
471
			SimpleName name= getUnusedName(compilationUnit, problem);
471
			SimpleName name= getUnusedName(compilationUnit, problem);
472
			if (name != null) {
472
			if (name != null) {
(-)src/org/eclipse/wst/jsdt/internal/corext/fix/StringFix.java (-229 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.wst.jsdt.internal.corext.fix;
12
13
import java.util.ArrayList;
14
import java.util.Iterator;
15
import java.util.List;
16
17
import org.eclipse.core.runtime.CoreException;
18
import org.eclipse.core.runtime.IStatus;
19
import org.eclipse.ltk.core.refactoring.CategorizedTextEditGroup;
20
import org.eclipse.ltk.core.refactoring.GroupCategory;
21
import org.eclipse.ltk.core.refactoring.GroupCategorySet;
22
import org.eclipse.ltk.core.refactoring.TextChange;
23
import org.eclipse.text.edits.ReplaceEdit;
24
import org.eclipse.text.edits.TextEdit;
25
import org.eclipse.text.edits.TextEditGroup;
26
import org.eclipse.wst.jsdt.core.IBuffer;
27
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
28
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
29
import org.eclipse.wst.jsdt.core.compiler.IProblem;
30
import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
31
import org.eclipse.wst.jsdt.core.formatter.IndentManipulation;
32
import org.eclipse.wst.jsdt.internal.corext.refactoring.changes.CompilationUnitChange;
33
import org.eclipse.wst.jsdt.internal.corext.refactoring.changes.TextChangeCompatibility;
34
import org.eclipse.wst.jsdt.internal.corext.refactoring.nls.NLSUtil;
35
import org.eclipse.wst.jsdt.internal.ui.dialogs.StatusInfo;
36
import org.eclipse.wst.jsdt.internal.ui.text.correction.ProblemLocation;
37
import org.eclipse.wst.jsdt.ui.text.java.IProblemLocation;
38
39
/**
40
 * Fix which solves various issues with strings.
41
 * Supported:
42
 * 		Add missing $NON-NLS$ tag
43
 * 		Remove unnecessary $NON-NLS$ tag
44
 *
45
 */
46
public class StringFix implements IFix {
47
	
48
	private final TextEditGroup[] fEditGroups;
49
	private final String fName;
50
	private final IJavaScriptUnit fCompilationUnit;
51
52
	public static StringFix createFix(JavaScriptUnit compilationUnit, IProblemLocation problem, boolean removeNLSTag, boolean addNLSTag) throws CoreException {
53
		TextEdit addEdit= null;
54
		IJavaScriptUnit cu= (IJavaScriptUnit)compilationUnit.getJavaElement();
55
		if (addNLSTag) {
56
			addEdit= NLSUtil.createNLSEdit(cu, problem.getOffset());
57
		}
58
		ReplaceEdit removeEdit= null;
59
		if (removeNLSTag) {
60
			IBuffer buffer= cu.getBuffer();
61
			if (buffer != null) {
62
				removeEdit= getReplace(problem.getOffset(), problem.getLength(), buffer, true);
63
			}
64
		}
65
66
		if (addEdit != null && removeEdit != null) {
67
			String label= FixMessages.StringFix_AddRemoveNonNls_description;
68
			return new StringFix(label, compilationUnit, new TextEditGroup[] {new TextEditGroup(label, addEdit), new TextEditGroup(label, removeEdit)});
69
		} else if (addEdit != null) {
70
			String label= FixMessages.StringFix_AddNonNls_description;
71
			return new StringFix(label, compilationUnit, new TextEditGroup[] {new TextEditGroup(label, addEdit)});
72
		} else if (removeEdit != null) {
73
			String label= FixMessages.StringFix_RemoveNonNls_description;
74
			return new StringFix(label, compilationUnit, new TextEditGroup[] {new TextEditGroup(label, removeEdit)});
75
		} else {
76
			return null;
77
		}
78
	}
79
	
80
	public static IFix createCleanUp(JavaScriptUnit compilationUnit, boolean addNLSTag, boolean removeNLSTag) throws CoreException, JavaScriptModelException {
81
		if (!addNLSTag && !removeNLSTag)
82
			return null;
83
		
84
		IProblem[] problems= compilationUnit.getProblems();
85
		IProblemLocation[] locations= new IProblemLocation[problems.length];
86
		for (int i= 0; i < problems.length; i++) {
87
			locations[i]= new ProblemLocation(problems[i]);
88
		}
89
		return createCleanUp(compilationUnit, addNLSTag, removeNLSTag, locations);
90
	}
91
	
92
	public static IFix createCleanUp(JavaScriptUnit compilationUnit, IProblemLocation[] problems, boolean addNLSTag, boolean removeNLSTag) throws CoreException, JavaScriptModelException {
93
		if (!addNLSTag && !removeNLSTag)
94
			return null;
95
		
96
		return createCleanUp(compilationUnit, addNLSTag, removeNLSTag, problems);
97
	}
98
99
	private static IFix createCleanUp(JavaScriptUnit compilationUnit, boolean addNLSTag, boolean removeNLSTag, IProblemLocation[] problems) throws CoreException, JavaScriptModelException {
100
		IJavaScriptUnit cu= (IJavaScriptUnit)compilationUnit.getJavaElement();
101
		List result= new ArrayList();
102
		
103
		List missingNLSProblems= new ArrayList();
104
		for (int i= 0; i < problems.length; i++) {
105
			IProblemLocation problem= problems[i];
106
			if (addNLSTag && problem.getProblemId() == IProblem.NonExternalizedStringLiteral) {
107
				missingNLSProblems.add(problem);
108
			}
109
			if (removeNLSTag && problem.getProblemId() == IProblem.UnnecessaryNLSTag) {
110
				IBuffer buffer= cu.getBuffer();
111
				if (buffer != null) {
112
					TextEdit edit= StringFix.getReplace(problem.getOffset(), problem.getLength(), buffer, false);
113
					if (edit != null) {
114
						String label= FixMessages.StringFix_RemoveNonNls_description;
115
						result.add(new CategorizedTextEditGroup(label, edit, new GroupCategorySet(new GroupCategory(label, label, label))));
116
					}
117
				}
118
			}
119
		}
120
		if (!missingNLSProblems.isEmpty()) {
121
			int[] positions= new int[missingNLSProblems.size()];
122
			int i=0;
123
			for (Iterator iter= missingNLSProblems.iterator(); iter.hasNext();) {
124
				IProblemLocation problem= (IProblemLocation)iter.next();
125
				positions[i]= problem.getOffset();
126
				i++;
127
			}
128
			TextEdit[] edits= NLSUtil.createNLSEdits(cu, positions);
129
			if (edits != null) {
130
				for (int j= 0; j < edits.length; j++) {
131
					String label= FixMessages.StringFix_AddNonNls_description;
132
					result.add(new CategorizedTextEditGroup(label, edits[j], new GroupCategorySet(new GroupCategory(label, label, label))));	
133
				}
134
			}
135
		}
136
		if (result.isEmpty())
137
			return null;
138
		
139
		return new StringFix("", compilationUnit, (TextEditGroup[])result.toArray(new TextEditGroup[result.size()])); //$NON-NLS-1$
140
	}
141
	
142
	private static ReplaceEdit getReplace(int offset, int length, IBuffer buffer, boolean removeLeadingIndents) {
143
		
144
		String replaceString= new String();
145
		boolean hasMoreInComment= false;
146
		
147
		// look after the tag
148
		int next= offset + length;
149
		while (next < buffer.getLength()) {
150
			char ch= buffer.getChar(next);
151
			if (IndentManipulation.isIndentChar(ch)) {
152
				next++; // remove all whitespace
153
			} else if (IndentManipulation.isLineDelimiterChar(ch)) {
154
				length= next - offset; 
155
				break;
156
			} else if (ch == '/') {
157
				next++;
158
				if (next == buffer.getLength() || buffer.getChar(next) != '/') {
159
					replaceString= "//"; //$NON-NLS-1$
160
				} else {
161
					length= next - offset - 1;
162
				}
163
				hasMoreInComment= true;
164
				break;
165
			} else {
166
				replaceString= "//"; //$NON-NLS-1$
167
				hasMoreInComment= true;
168
				break;
169
			}
170
		}
171
		if (!hasMoreInComment && removeLeadingIndents) {
172
			while (offset > 0 && IndentManipulation.isIndentChar(buffer.getChar(offset - 1))) {
173
				offset--;
174
				length++;
175
			}
176
		}
177
		if (length > 0) {
178
			ReplaceEdit replaceEdit= new ReplaceEdit(offset, length, replaceString);
179
			return replaceEdit;
180
		} else {
181
			return null;
182
		}
183
	}
184
	
185
	private StringFix(String name, JavaScriptUnit compilationUnit, TextEditGroup[] groups) {
186
		fName= name;
187
		fCompilationUnit= (IJavaScriptUnit)compilationUnit.getJavaElement();
188
		fEditGroups= groups;
189
	}
190
191
	/* (non-Javadoc)
192
	 * @see org.eclipse.wst.jsdt.internal.corext.fix.AbstractFix#createChange()
193
	 */
194
	public TextChange createChange() throws CoreException {
195
		if (fEditGroups == null || fEditGroups.length == 0)
196
			return null;
197
		
198
		CompilationUnitChange result= new CompilationUnitChange(getDescription(), getCompilationUnit());
199
		for (int i= 0; i < fEditGroups.length; i++) {
200
			TextEdit[] edits= fEditGroups[i].getTextEdits();
201
			String groupName= fEditGroups[i].getName();
202
			for (int j= 0; j < edits.length; j++) {
203
				TextChangeCompatibility.addTextEdit(result, groupName, edits[j]);	
204
			}
205
		}
206
		return result;
207
	}
208
209
	/* (non-Javadoc)
210
	 * @see org.eclipse.wst.jsdt.internal.corext.fix.IFix#getDescription()
211
	 */
212
	public String getDescription() {
213
		return fName;
214
	}
215
216
	/* (non-Javadoc)
217
	 * @see org.eclipse.wst.jsdt.internal.corext.fix.IFix#getCompilationUnit()
218
	 */
219
	public IJavaScriptUnit getCompilationUnit() {
220
		return fCompilationUnit;
221
	}
222
223
	/* (non-Javadoc)
224
	 * @see org.eclipse.wst.jsdt.internal.corext.fix.IFix#getStatus()
225
	 */
226
	public IStatus getStatus() {
227
	    return StatusInfo.OK_STATUS;
228
	}
229
}
(-)src/org/eclipse/wst/jsdt/internal/ui/fix/StringCleanUp.java (-130 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.wst.jsdt.internal.ui.fix;
12
13
import java.util.ArrayList;
14
import java.util.Hashtable;
15
import java.util.List;
16
import java.util.Map;
17
18
import org.eclipse.core.runtime.CoreException;
19
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
20
import org.eclipse.wst.jsdt.core.JavaScriptCore;
21
import org.eclipse.wst.jsdt.core.compiler.IProblem;
22
import org.eclipse.wst.jsdt.core.dom.JavaScriptUnit;
23
import org.eclipse.wst.jsdt.internal.corext.fix.CleanUpConstants;
24
import org.eclipse.wst.jsdt.internal.corext.fix.IFix;
25
import org.eclipse.wst.jsdt.internal.corext.fix.StringFix;
26
import org.eclipse.wst.jsdt.ui.text.java.IProblemLocation;
27
28
/**
29
 * Create fixes which can solve problems in connection with Strings
30
 * @see org.eclipse.wst.jsdt.internal.corext.fix.StringFix
31
 *
32
 */
33
public class StringCleanUp extends AbstractCleanUp {
34
	
35
	public StringCleanUp(Map options) {
36
		super(options);
37
	}
38
	
39
	public StringCleanUp() {
40
		super();
41
	}
42
	
43
	/**
44
	 * {@inheritDoc}
45
	 */
46
	public boolean requireAST(IJavaScriptUnit unit) throws CoreException {
47
	    return isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS) || 
48
		       isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS);
49
	}
50
51
	public IFix createFix(JavaScriptUnit compilationUnit) throws CoreException {
52
		if (compilationUnit == null)
53
			return null;
54
55
		return StringFix.createCleanUp(compilationUnit, 
56
				isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS), 
57
				isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS));
58
	}
59
	
60
	/**
61
	 * {@inheritDoc}
62
	 */
63
	public IFix createFix(JavaScriptUnit compilationUnit, IProblemLocation[] problems) throws CoreException {
64
		if (compilationUnit == null)
65
			return null;
66
		
67
		return StringFix.createCleanUp(compilationUnit, problems,
68
				isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS), 
69
				isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS));
70
	}
71
72
	public Map getRequiredOptions() {
73
		Map result= new Hashtable();
74
		
75
		if (isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS) || isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS))
76
			result.put(JavaScriptCore.COMPILER_PB_NON_NLS_STRING_LITERAL, JavaScriptCore.WARNING);
77
		
78
		return result;
79
	}
80
81
	/**
82
	 * {@inheritDoc}
83
	 */
84
	public String[] getDescriptions() {
85
		List result= new ArrayList();
86
		if (isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS))
87
			result.add(MultiFixMessages.StringMultiFix_AddMissingNonNls_description);
88
		if (isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS))
89
			result.add(MultiFixMessages.StringMultiFix_RemoveUnnecessaryNonNls_description);
90
		return (String[])result.toArray(new String[result.size()]);
91
	}
92
	
93
	/**
94
	 * {@inheritDoc}
95
	 */
96
	public String getPreview() {
97
		StringBuffer buf= new StringBuffer();
98
		
99
		if (isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS)) {
100
			buf.append("var s=\"\";"); //$NON-NLS-1$
101
		} else {
102
			buf.append("var s=\"\"; //$NON-NLS-1$"); //$NON-NLS-1$
103
		}
104
		
105
		return buf.toString();
106
	}
107
108
	/**
109
	 * {@inheritDoc}
110
	 * @throws CoreException 
111
	 */
112
	public boolean canFix(JavaScriptUnit compilationUnit, IProblemLocation problem) throws CoreException {
113
		return StringFix.createFix(compilationUnit, problem, isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS), isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS)) != null;
114
	}
115
116
	/**
117
	 * {@inheritDoc}
118
	 */
119
	public int maximalNumberOfFixes(JavaScriptUnit compilationUnit) {
120
		int result= 0;
121
		IProblem[] problems= compilationUnit.getProblems();
122
		if (isEnabled(CleanUpConstants.ADD_MISSING_NLS_TAGS))
123
			result+= getNumberOfProblems(problems, IProblem.NonExternalizedStringLiteral);
124
		
125
		if (isEnabled(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS))
126
			result+= getNumberOfProblems(problems, IProblem.UnnecessaryNLSTag);
127
		
128
		return result;
129
	}	
130
}
(-)src/org/eclipse/wst/jsdt/internal/ui/fix/Java50CleanUp.java (-10 lines)
Lines 156-171 Link Here
156
	public int maximalNumberOfFixes(JavaScriptUnit compilationUnit) {
156
	public int maximalNumberOfFixes(JavaScriptUnit compilationUnit) {
157
		int result= 0;
157
		int result= 0;
158
		IProblem[] problems= compilationUnit.getProblems();
158
		IProblem[] problems= compilationUnit.getProblems();
159
		if (isEnabled(CleanUpConstants.ADD_MISSING_ANNOTATIONS) && isEnabled(CleanUpConstants.ADD_MISSING_ANNOTATIONS_OVERRIDE)) {
160
			result+= getNumberOfProblems(problems, IProblem.MissingOverrideAnnotation);
161
		}
162
		if (isEnabled(CleanUpConstants.ADD_MISSING_ANNOTATIONS) && isEnabled(CleanUpConstants.ADD_MISSING_ANNOTATIONS_DEPRECATED)) {
163
			for (int i=0;i<problems.length;i++) {
164
				int id= problems[i].getID();
165
				if (id == IProblem.FieldMissingDeprecatedAnnotation || id == IProblem.MethodMissingDeprecatedAnnotation || id == IProblem.TypeMissingDeprecatedAnnotation)
166
					result++;
167
			}
168
		}
169
		if (isEnabled(CleanUpConstants.VARIABLE_DECLARATION_USE_TYPE_ARGUMENTS_FOR_RAW_TYPE_REFERENCES)) {
159
		if (isEnabled(CleanUpConstants.VARIABLE_DECLARATION_USE_TYPE_ARGUMENTS_FOR_RAW_TYPE_REFERENCES)) {
170
			for (int i=0;i<problems.length;i++) {
160
			for (int i=0;i<problems.length;i++) {
171
				int id= problems[i].getID();
161
				int id= problems[i].getID();
(-)src/org/eclipse/wst/jsdt/internal/ui/text/correction/CorrectionMessages.properties (-1 lines)
Lines 70-76 Link Here
70
LocalCorrectionsSubProcessor_addthrows_description=Add throws declaration
70
LocalCorrectionsSubProcessor_addthrows_description=Add throws declaration
71
LocalCorrectionsSubProcessor_addadditionalcatch_description=Add catch clause to surrounding try
71
LocalCorrectionsSubProcessor_addadditionalcatch_description=Add catch clause to surrounding try
72
LocalCorrectionsSubProcessor_unnecessaryinstanceof_description=Replace with null check
72
LocalCorrectionsSubProcessor_unnecessaryinstanceof_description=Replace with null check
73
LocalCorrectionsSubProcessor_unnecessarythrow_description=Remove thrown exception
74
LocalCorrectionsSubProcessor_classtointerface_description=Change ''{0}'' to interface
73
LocalCorrectionsSubProcessor_classtointerface_description=Change ''{0}'' to interface
75
74
76
LocalCorrectionsSubProcessor_externalizestrings_description=Open the 'Externalize Strings' wizard
75
LocalCorrectionsSubProcessor_externalizestrings_description=Open the 'Externalize Strings' wizard
(-)src/org/eclipse/wst/jsdt/internal/ui/text/correction/CorrectionMessages.java (-1 lines)
Lines 78-84 Link Here
78
	public static String LocalCorrectionsSubProcessor_addthrows_description;
78
	public static String LocalCorrectionsSubProcessor_addthrows_description;
79
	public static String LocalCorrectionsSubProcessor_addadditionalcatch_description;
79
	public static String LocalCorrectionsSubProcessor_addadditionalcatch_description;
80
	public static String LocalCorrectionsSubProcessor_unnecessaryinstanceof_description;
80
	public static String LocalCorrectionsSubProcessor_unnecessaryinstanceof_description;
81
	public static String LocalCorrectionsSubProcessor_unnecessarythrow_description;
82
	public static String LocalCorrectionsSubProcessor_classtointerface_description;
81
	public static String LocalCorrectionsSubProcessor_classtointerface_description;
83
	public static String LocalCorrectionsSubProcessor_externalizestrings_description;
82
	public static String LocalCorrectionsSubProcessor_externalizestrings_description;
84
	public static String LocalCorrectionsSubProcessor_externalizestrings_dialog_title;
83
	public static String LocalCorrectionsSubProcessor_externalizestrings_dialog_title;
(-)src/org/eclipse/wst/jsdt/internal/ui/text/correction/QuickFixProcessor.java (-24 lines)
Lines 78-84 Link Here
78
			case IProblem.UnusedPrivateField:
78
			case IProblem.UnusedPrivateField:
79
			case IProblem.UnusedPrivateType:
79
			case IProblem.UnusedPrivateType:
80
			case IProblem.LocalVariableIsNeverUsed:
80
			case IProblem.LocalVariableIsNeverUsed:
81
			case IProblem.ArgumentIsNeverUsed:
82
			case IProblem.MethodRequiresBody:
81
			case IProblem.MethodRequiresBody:
83
			case IProblem.NeedToEmulateFieldReadAccess:
82
			case IProblem.NeedToEmulateFieldReadAccess:
84
			case IProblem.NeedToEmulateFieldWriteAccess:
83
			case IProblem.NeedToEmulateFieldWriteAccess:
Lines 90-97 Link Here
90
			case IProblem.IndirectAccessToStaticField:
89
			case IProblem.IndirectAccessToStaticField:
91
			case IProblem.IndirectAccessToStaticMethod:
90
			case IProblem.IndirectAccessToStaticMethod:
92
			case IProblem.Task:
91
			case IProblem.Task:
93
			case IProblem.UnusedMethodDeclaredThrownException:
94
			case IProblem.UnusedConstructorDeclaredThrownException:
95
			case IProblem.UnqualifiedFieldAccess:
92
			case IProblem.UnqualifiedFieldAccess:
96
			case IProblem.JavadocMissing:
93
			case IProblem.JavadocMissing:
97
			case IProblem.JavadocMissingParamTag:
94
			case IProblem.JavadocMissingParamTag:
Lines 164-181 Link Here
164
			case IProblem.InvalidUsageOfVarargs:
161
			case IProblem.InvalidUsageOfVarargs:
165
			case IProblem.InvalidUsageOfAnnotations:
162
			case IProblem.InvalidUsageOfAnnotations:
166
			case IProblem.InvalidUsageOfAnnotationDeclarations:
163
			case IProblem.InvalidUsageOfAnnotationDeclarations:
167
			case IProblem.FieldMissingDeprecatedAnnotation:
168
			case IProblem.OverridingDeprecatedMethod:
164
			case IProblem.OverridingDeprecatedMethod:
169
			case IProblem.MethodMissingDeprecatedAnnotation:
170
			case IProblem.TypeMissingDeprecatedAnnotation:
171
			case IProblem.MissingOverrideAnnotation:
172
			case IProblem.MethodMustOverride:
165
			case IProblem.MethodMustOverride:
173
			case IProblem.MethodMustOverrideOrImplement:
166
			case IProblem.MethodMustOverrideOrImplement:
174
			case IProblem.IsClassPathCorrect:
167
			case IProblem.IsClassPathCorrect:
175
			case IProblem.MethodReturnsVoid:
168
			case IProblem.MethodReturnsVoid:
176
			case IProblem.ForbiddenReference:
169
			case IProblem.ForbiddenReference:
177
			case IProblem.DiscouragedReference:
170
			case IProblem.DiscouragedReference:
178
			case IProblem.UnnecessaryNLSTag:
179
			case IProblem.AssignmentHasNoEffect:
171
			case IProblem.AssignmentHasNoEffect:
180
			case IProblem.UnsafeTypeConversion:
172
			case IProblem.UnsafeTypeConversion:
181
			case IProblem.UndefinedAnnotationMember:
173
			case IProblem.UndefinedAnnotationMember:
Lines 305-316 Link Here
305
			case IProblem.ShouldReturnValue:
297
			case IProblem.ShouldReturnValue:
306
				ReturnTypeSubProcessor.addMissingReturnStatementProposals(context, problem, proposals);
298
				ReturnTypeSubProcessor.addMissingReturnStatementProposals(context, problem, proposals);
307
				break;
299
				break;
308
			case IProblem.NonExternalizedStringLiteral:
309
				LocalCorrectionsSubProcessor.addNLSProposals(context, problem, proposals);
310
				break;
311
			case IProblem.UnnecessaryNLSTag:
312
				LocalCorrectionsSubProcessor.getUnnecessaryNLSTagProposals(context, problem, proposals);
313
				break;
314
			case IProblem.NonStaticAccessToStaticField:
300
			case IProblem.NonStaticAccessToStaticField:
315
			case IProblem.NonStaticAccessToStaticMethod:
301
			case IProblem.NonStaticAccessToStaticMethod:
316
			case IProblem.IndirectAccessToStaticField:
302
			case IProblem.IndirectAccessToStaticField:
Lines 402-408 Link Here
402
			case IProblem.UnusedPrivateField:
388
			case IProblem.UnusedPrivateField:
403
			case IProblem.UnusedPrivateType:
389
			case IProblem.UnusedPrivateType:
404
			case IProblem.LocalVariableIsNeverUsed:
390
			case IProblem.LocalVariableIsNeverUsed:
405
			case IProblem.ArgumentIsNeverUsed:
406
				LocalCorrectionsSubProcessor.addUnusedMemberProposal(context, problem, proposals);
391
				LocalCorrectionsSubProcessor.addUnusedMemberProposal(context, problem, proposals);
407
				break;
392
				break;
408
			case IProblem.NeedToEmulateFieldReadAccess:
393
			case IProblem.NeedToEmulateFieldReadAccess:
Lines 420-429 Link Here
420
			case IProblem.UnnecessaryInstanceof:
405
			case IProblem.UnnecessaryInstanceof:
421
				LocalCorrectionsSubProcessor.addUnnecessaryInstanceofProposal(context, problem, proposals);
406
				LocalCorrectionsSubProcessor.addUnnecessaryInstanceofProposal(context, problem, proposals);
422
				break;
407
				break;
423
			case IProblem.UnusedMethodDeclaredThrownException:
424
			case IProblem.UnusedConstructorDeclaredThrownException:
425
				LocalCorrectionsSubProcessor.addUnnecessaryThrownExceptionProposal(context, problem, proposals);
426
				break;
427
			case IProblem.UnqualifiedFieldAccess:
408
			case IProblem.UnqualifiedFieldAccess:
428
				ModifierCorrectionSubProcessor.addGetterSetterProposal(context, problem, proposals, 15);
409
				ModifierCorrectionSubProcessor.addGetterSetterProposal(context, problem, proposals, 15);
429
//				LocalCorrectionsSubProcessor.addUnqualifiedFieldAccessProposal(context, problem, proposals);
410
//				LocalCorrectionsSubProcessor.addUnqualifiedFieldAccessProposal(context, problem, proposals);
Lines 502-512 Link Here
502
			case IProblem.MethodMustOverrideOrImplement:
483
			case IProblem.MethodMustOverrideOrImplement:
503
				ModifierCorrectionSubProcessor.removeOverrideAnnotationProposal(context, problem, proposals);
484
				ModifierCorrectionSubProcessor.removeOverrideAnnotationProposal(context, problem, proposals);
504
				break;
485
				break;
505
			case IProblem.FieldMissingDeprecatedAnnotation:
506
			case IProblem.MethodMissingDeprecatedAnnotation:
507
			case IProblem.TypeMissingDeprecatedAnnotation:
508
//				ModifierCorrectionSubProcessor.addDeprecatedAnnotationProposal(context, problem, proposals);
509
				break;
510
			case IProblem.OverridingDeprecatedMethod:
486
			case IProblem.OverridingDeprecatedMethod:
511
				ModifierCorrectionSubProcessor.addOverridingDeprecatedMethodProposal(context, problem, proposals);
487
				ModifierCorrectionSubProcessor.addOverridingDeprecatedMethodProposal(context, problem, proposals);
512
				break;
488
				break;
(-)src/org/eclipse/wst/jsdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java (-82 lines)
Lines 33-39 Link Here
33
import org.eclipse.ui.IWorkbenchPage;
33
import org.eclipse.ui.IWorkbenchPage;
34
import org.eclipse.ui.part.FileEditorInput;
34
import org.eclipse.ui.part.FileEditorInput;
35
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
35
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
36
import org.eclipse.wst.jsdt.core.JavaScriptModelException;
37
import org.eclipse.wst.jsdt.core.compiler.IProblem;
36
import org.eclipse.wst.jsdt.core.compiler.IProblem;
38
import org.eclipse.wst.jsdt.core.dom.AST;
37
import org.eclipse.wst.jsdt.core.dom.AST;
39
import org.eclipse.wst.jsdt.core.dom.ASTNode;
38
import org.eclipse.wst.jsdt.core.dom.ASTNode;
Lines 85-94 Link Here
85
import org.eclipse.wst.jsdt.internal.corext.fix.CodeStyleFix;
84
import org.eclipse.wst.jsdt.internal.corext.fix.CodeStyleFix;
86
import org.eclipse.wst.jsdt.internal.corext.fix.IFix;
85
import org.eclipse.wst.jsdt.internal.corext.fix.IFix;
87
import org.eclipse.wst.jsdt.internal.corext.fix.Java50Fix;
86
import org.eclipse.wst.jsdt.internal.corext.fix.Java50Fix;
88
import org.eclipse.wst.jsdt.internal.corext.fix.StringFix;
89
import org.eclipse.wst.jsdt.internal.corext.fix.UnusedCodeFix;
87
import org.eclipse.wst.jsdt.internal.corext.fix.UnusedCodeFix;
90
import org.eclipse.wst.jsdt.internal.corext.refactoring.changes.CompilationUnitChange;
88
import org.eclipse.wst.jsdt.internal.corext.refactoring.changes.CompilationUnitChange;
91
import org.eclipse.wst.jsdt.internal.corext.refactoring.nls.NLSRefactoring;
92
import org.eclipse.wst.jsdt.internal.corext.refactoring.surround.ExceptionAnalyzer;
89
import org.eclipse.wst.jsdt.internal.corext.refactoring.surround.ExceptionAnalyzer;
93
import org.eclipse.wst.jsdt.internal.corext.refactoring.surround.SurroundWithTryCatchRefactoring;
90
import org.eclipse.wst.jsdt.internal.corext.refactoring.surround.SurroundWithTryCatchRefactoring;
94
import org.eclipse.wst.jsdt.internal.corext.util.JavaModelUtil;
91
import org.eclipse.wst.jsdt.internal.corext.util.JavaModelUtil;
Lines 97-108 Link Here
97
import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
94
import org.eclipse.wst.jsdt.internal.ui.JavaScriptPlugin;
98
import org.eclipse.wst.jsdt.internal.ui.fix.CodeStyleCleanUp;
95
import org.eclipse.wst.jsdt.internal.ui.fix.CodeStyleCleanUp;
99
import org.eclipse.wst.jsdt.internal.ui.fix.Java50CleanUp;
96
import org.eclipse.wst.jsdt.internal.ui.fix.Java50CleanUp;
100
import org.eclipse.wst.jsdt.internal.ui.fix.StringCleanUp;
101
import org.eclipse.wst.jsdt.internal.ui.fix.UnnecessaryCodeCleanUp;
97
import org.eclipse.wst.jsdt.internal.ui.fix.UnnecessaryCodeCleanUp;
102
import org.eclipse.wst.jsdt.internal.ui.javaeditor.JavaEditor;
98
import org.eclipse.wst.jsdt.internal.ui.javaeditor.JavaEditor;
103
import org.eclipse.wst.jsdt.internal.ui.refactoring.RefactoringSaveHelper;
104
import org.eclipse.wst.jsdt.internal.ui.refactoring.actions.RefactoringStarter;
105
import org.eclipse.wst.jsdt.internal.ui.refactoring.nls.ExternalizeWizard;
106
import org.eclipse.wst.jsdt.internal.ui.text.correction.ChangeMethodSignatureProposal.ChangeDescription;
99
import org.eclipse.wst.jsdt.internal.ui.text.correction.ChangeMethodSignatureProposal.ChangeDescription;
107
import org.eclipse.wst.jsdt.internal.ui.text.correction.ChangeMethodSignatureProposal.InsertDescription;
100
import org.eclipse.wst.jsdt.internal.ui.text.correction.ChangeMethodSignatureProposal.InsertDescription;
108
import org.eclipse.wst.jsdt.internal.ui.text.correction.ChangeMethodSignatureProposal.RemoveDescription;
101
import org.eclipse.wst.jsdt.internal.ui.text.correction.ChangeMethodSignatureProposal.RemoveDescription;
Lines 271-328 Link Here
271
264
272
		QuickAssistProcessor.getCatchClauseToThrowsProposals(context, selectedNode, proposals);
265
		QuickAssistProcessor.getCatchClauseToThrowsProposals(context, selectedNode, proposals);
273
	}
266
	}
274
275
	public static void addNLSProposals(IInvocationContext context, IProblemLocation problem, Collection proposals) throws CoreException {
276
		final IJavaScriptUnit cu= context.getCompilationUnit();
277
		if (cu == null || !cu.exists()){
278
			return;
279
		}
280
		String name= CorrectionMessages.LocalCorrectionsSubProcessor_externalizestrings_description;
281
282
		ChangeCorrectionProposal proposal= new ChangeCorrectionProposal(name, null, 2, JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE)) {
283
			public void apply(IDocument document) {
284
				try {
285
					NLSRefactoring refactoring= NLSRefactoring.create(cu);
286
					if (refactoring == null)
287
						return;
288
					ExternalizeWizard wizard= new ExternalizeWizard(refactoring);
289
					String dialogTitle= CorrectionMessages.LocalCorrectionsSubProcessor_externalizestrings_dialog_title;
290
					new RefactoringStarter().activate(refactoring, wizard, JavaScriptPlugin.getActiveWorkbenchShell(), dialogTitle, RefactoringSaveHelper.SAVE_NON_JAVA_UPDATES);
291
				} catch (JavaScriptModelException e) {
292
					JavaScriptPlugin.log(e);
293
				}
294
			}
295
			public String getAdditionalProposalInfo() {
296
				return CorrectionMessages.LocalCorrectionsSubProcessor_externalizestrings_additional_info;
297
			}
298
			
299
		};
300
		proposals.add(proposal);
301
		
302
		IFix fix= StringFix.createFix(context.getASTRoot(), problem, false, true);
303
		if (fix != null) {
304
			Image image= JavaPluginImages.get(JavaPluginImages.IMG_OBJS_NLS_NEVER_TRANSLATE);
305
			Map options= new Hashtable();
306
			options.put(CleanUpConstants.ADD_MISSING_NLS_TAGS, CleanUpConstants.TRUE);
307
			FixCorrectionProposal addNLS= new FixCorrectionProposal(fix, new StringCleanUp(options), 3, image, context);
308
			addNLS.setCommandId(ADD_NON_NLS_ID);
309
			proposals.add(addNLS);
310
		}
311
	}
312
	
267
	
313
	public static void getUnnecessaryNLSTagProposals(IInvocationContext context, IProblemLocation problem, Collection proposals) throws CoreException {
314
		IFix fix= StringFix.createFix(context.getASTRoot(), problem, true, false);
315
		if (fix != null) {
316
			Image image= JavaScriptPlugin.getDefault().getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
317
			Map options= new Hashtable();
318
			options.put(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS, CleanUpConstants.TRUE);
319
			FixCorrectionProposal proposal= new FixCorrectionProposal(fix, new StringCleanUp(options), 6, image, context);
320
			proposal.setCommandId(REMOVE_UNNECESSARY_NLS_TAG_ID);
321
			proposals.add(proposal);
322
		}
323
	}
324
	
325
326
	/*
268
	/*
327
	 * Fix instance accesses and indirect (static) accesses to static fields/methods
269
	 * Fix instance accesses and indirect (static) accesses to static fields/methods
328
	 */
270
	 */
Lines 538-567 Link Here
538
480
539
	}
481
	}
540
482
541
	public static void addUnnecessaryThrownExceptionProposal(IInvocationContext context, IProblemLocation problem, Collection proposals) {
542
		ASTNode selectedNode= problem.getCoveringNode(context.getASTRoot());
543
		if (selectedNode == null || !(selectedNode.getParent() instanceof FunctionDeclaration)) {
544
			return;
545
		}
546
		FunctionDeclaration decl= (FunctionDeclaration) selectedNode.getParent();
547
		IFunctionBinding binding= decl.resolveBinding();
548
		if (binding != null) {
549
			List thrownExceptions= decl.thrownExceptions();
550
			int index= thrownExceptions.indexOf(selectedNode);
551
			if (index == -1) {
552
				return;
553
			}
554
			ChangeDescription[] desc= new ChangeDescription[thrownExceptions.size()];
555
			desc[index]= new RemoveDescription();
556
557
			IJavaScriptUnit cu= context.getCompilationUnit();
558
			String label= CorrectionMessages.LocalCorrectionsSubProcessor_unnecessarythrow_description;
559
			Image image= JavaPluginImages.get(JavaPluginImages.IMG_OBJS_EXCEPTION);
560
561
			proposals.add(new ChangeMethodSignatureProposal(label, cu, selectedNode, binding, null, desc, 5, image));
562
		}
563
	}
564
565
//	public static void addUnqualifiedFieldAccessProposal(IInvocationContext context, IProblemLocation problem, Collection proposals) throws CoreException {
483
//	public static void addUnqualifiedFieldAccessProposal(IInvocationContext context, IProblemLocation problem, Collection proposals) throws CoreException {
566
//		IFix fix= CodeStyleFix.createAddFieldQualifierFix(context.getASTRoot(), problem);
484
//		IFix fix= CodeStyleFix.createAddFieldQualifierFix(context.getASTRoot(), problem);
567
//		if (fix != null) {
485
//		if (fix != null) {
(-)src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpMessages.java (-2 lines)
Lines 60-67 Link Here
60
	public static String CodeStyleTabPage_RadioName_UseBlocksSpecial;
60
	public static String CodeStyleTabPage_RadioName_UseBlocksSpecial;
61
61
62
62
63
64
	public static String UnnecessaryCodeTabPage_CheckboxName_UnnecessaryNLSTags;
65
	public static String UnnecessaryCodeTabPage_CheckboxName_UnusedFields;
63
	public static String UnnecessaryCodeTabPage_CheckboxName_UnusedFields;
66
	public static String UnnecessaryCodeTabPage_CheckboxName_UnusedLocalVariables;
64
	public static String UnnecessaryCodeTabPage_CheckboxName_UnusedLocalVariables;
67
	public static String UnnecessaryCodeTabPage_CheckboxName_UnusedMembers;
65
	public static String UnnecessaryCodeTabPage_CheckboxName_UnusedMembers;
(-)src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/CleanUpMessages.properties (-2 / +1 lines)
Lines 51-55 Link Here
51
UnnecessaryCodeTabPage_CheckboxName_UnusedFields=V&ars
51
UnnecessaryCodeTabPage_CheckboxName_UnusedFields=V&ars
52
UnnecessaryCodeTabPage_CheckboxName_UnusedMethods=&Functions
52
UnnecessaryCodeTabPage_CheckboxName_UnusedMethods=&Functions
53
UnnecessaryCodeTabPage_CheckboxName_UnusedLocalVariables=Remove unused &local variables
53
UnnecessaryCodeTabPage_CheckboxName_UnusedLocalVariables=Remove unused &local variables
54
UnnecessaryCodeTabPage_GroupName_UnnecessaryCode=Unnecessary code
54
UnnecessaryCodeTabPage_GroupName_UnnecessaryCode=Unnecessary code
55
UnnecessaryCodeTabPage_CheckboxName_UnnecessaryNLSTags=Remove unnecessary '$NON-NLS$' ta&gs
(-)src/org/eclipse/wst/jsdt/internal/ui/preferences/cleanup/UnnecessaryCodeTabPage.java (-5 / +1 lines)
Lines 16-22 Link Here
16
import org.eclipse.swt.widgets.Group;
16
import org.eclipse.swt.widgets.Group;
17
import org.eclipse.wst.jsdt.internal.corext.fix.CleanUpConstants;
17
import org.eclipse.wst.jsdt.internal.corext.fix.CleanUpConstants;
18
import org.eclipse.wst.jsdt.internal.ui.fix.ICleanUp;
18
import org.eclipse.wst.jsdt.internal.ui.fix.ICleanUp;
19
import org.eclipse.wst.jsdt.internal.ui.fix.StringCleanUp;
20
import org.eclipse.wst.jsdt.internal.ui.fix.UnnecessaryCodeCleanUp;
19
import org.eclipse.wst.jsdt.internal.ui.fix.UnnecessaryCodeCleanUp;
21
import org.eclipse.wst.jsdt.internal.ui.fix.UnusedCodeCleanUp;
20
import org.eclipse.wst.jsdt.internal.ui.fix.UnusedCodeCleanUp;
22
import org.eclipse.wst.jsdt.internal.ui.preferences.formatter.ModifyDialog;
21
import org.eclipse.wst.jsdt.internal.ui.preferences.formatter.ModifyDialog;
Lines 34-41 Link Here
34
    protected ICleanUp[] createPreviewCleanUps(Map values) {
33
    protected ICleanUp[] createPreviewCleanUps(Map values) {
35
    	return new ICleanUp[] {
34
    	return new ICleanUp[] {
36
        		new UnusedCodeCleanUp(values),
35
        		new UnusedCodeCleanUp(values),
37
        		new UnnecessaryCodeCleanUp(values),
36
        		new UnnecessaryCodeCleanUp(values)
38
        		new StringCleanUp(values)
39
        };
37
        };
40
    }
38
    }
41
39
Lines 62-69 Link Here
62
//    	CheckboxPreference casts= createCheckboxPref(unnecessaryGroup, numColumns, CleanUpMessages.UnnecessaryCodeTabPage_CheckboxName_UnnecessaryCasts, CleanUpConstants.REMOVE_UNNECESSARY_CASTS, CleanUpModifyDialog.FALSE_TRUE);
60
//    	CheckboxPreference casts= createCheckboxPref(unnecessaryGroup, numColumns, CleanUpMessages.UnnecessaryCodeTabPage_CheckboxName_UnnecessaryCasts, CleanUpConstants.REMOVE_UNNECESSARY_CASTS, CleanUpModifyDialog.FALSE_TRUE);
63
//    	registerPreference(casts);
61
//    	registerPreference(casts);
64
    	
62
    	
65
    	CheckboxPreference nls= createCheckboxPref(unnecessaryGroup, numColumns, CleanUpMessages.UnnecessaryCodeTabPage_CheckboxName_UnnecessaryNLSTags, CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS, CleanUpModifyDialog.FALSE_TRUE);
66
    	registerPreference(nls);
67
    }
63
    }
68
64
69
}
65
}
(-)src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.java (-1 lines)
Lines 417-423 Link Here
417
	public static String ProblemSeveritiesConfigurationBlock_pb_unused_parameter_label;
417
	public static String ProblemSeveritiesConfigurationBlock_pb_unused_parameter_label;
418
	public static String ProblemSeveritiesConfigurationBlock_pb_signal_param_in_overriding_label;
418
	public static String ProblemSeveritiesConfigurationBlock_pb_signal_param_in_overriding_label;
419
	public static String ProblemSeveritiesConfigurationBlock_pb_unused_private_label;
419
	public static String ProblemSeveritiesConfigurationBlock_pb_unused_private_label;
420
	public static String ProblemSeveritiesConfigurationBlock_pb_non_externalized_strings_label;
421
	public static String ProblemSeveritiesConfigurationBlock_pb_deprecation_label;
420
	public static String ProblemSeveritiesConfigurationBlock_pb_deprecation_label;
422
	public static String ProblemSeveritiesConfigurationBlock_pb_deprecation_in_deprecation_label;
421
	public static String ProblemSeveritiesConfigurationBlock_pb_deprecation_in_deprecation_label;
423
	public static String ProblemSeveritiesConfigurationBlock_pb_deprecation_when_overriding_label;
422
	public static String ProblemSeveritiesConfigurationBlock_pb_deprecation_when_overriding_label;
(-)src/org/eclipse/wst/jsdt/internal/ui/preferences/PreferencesMessages.properties (-1 lines)
Lines 453-459 Link Here
453
ProblemSeveritiesConfigurationBlock_pb_unused_private_label=Unused local or private member:
453
ProblemSeveritiesConfigurationBlock_pb_unused_private_label=Unused local or private member:
454
ProblemSeveritiesConfigurationBlock_pb_parameter_assignment=Parameter assignment:
454
ProblemSeveritiesConfigurationBlock_pb_parameter_assignment=Parameter assignment:
455
ProblemSeveritiesConfigurationBlock_pb_redundant_null_check=Redundant null check:
455
ProblemSeveritiesConfigurationBlock_pb_redundant_null_check=Redundant null check:
456
ProblemSeveritiesConfigurationBlock_pb_non_externalized_strings_label=Non-externalized strings (missing/unused $NON-NLS$ tag):
457
ProblemSeveritiesConfigurationBlock_pb_deprecation_label=Deprecated API:
456
ProblemSeveritiesConfigurationBlock_pb_deprecation_label=Deprecated API:
458
ProblemSeveritiesConfigurationBlock_pb_deprecation_in_deprecation_label=Signal use of deprecated API inside deprecated code
457
ProblemSeveritiesConfigurationBlock_pb_deprecation_in_deprecation_label=Signal use of deprecated API inside deprecated code
459
ProblemSeveritiesConfigurationBlock_pb_deprecation_when_overriding_label=Signal overriding or implementing deprecated function
458
ProblemSeveritiesConfigurationBlock_pb_deprecation_when_overriding_label=Signal overriding or implementing deprecated function
(-)src/org/eclipse/wst/jsdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java (-5 / +1 lines)
Lines 50-56 Link Here
50
	private static final Key PREF_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE= getJDTCoreKey(JavaScriptCore.COMPILER_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE);
50
	private static final Key PREF_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE= getJDTCoreKey(JavaScriptCore.COMPILER_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE);
51
	private static final Key PREF_PB_SIGNAL_PARAMETER_IN_ABSTRACT= getJDTCoreKey(JavaScriptCore.COMPILER_PB_UNUSED_PARAMETER_WHEN_IMPLEMENTING_ABSTRACT);
51
	private static final Key PREF_PB_SIGNAL_PARAMETER_IN_ABSTRACT= getJDTCoreKey(JavaScriptCore.COMPILER_PB_UNUSED_PARAMETER_WHEN_IMPLEMENTING_ABSTRACT);
52
//	private static final Key PREF_PB_SYNTHETIC_ACCESS_EMULATION= getJDTCoreKey(JavaScriptCore.COMPILER_PB_SYNTHETIC_ACCESS_EMULATION);
52
//	private static final Key PREF_PB_SYNTHETIC_ACCESS_EMULATION= getJDTCoreKey(JavaScriptCore.COMPILER_PB_SYNTHETIC_ACCESS_EMULATION);
53
	private static final Key PREF_PB_NON_EXTERNALIZED_STRINGS= getJDTCoreKey(JavaScriptCore.COMPILER_PB_NON_NLS_STRING_LITERAL);
54
//	private static final Key PREF_PB_UNUSED_IMPORT= getJDTCoreKey(JavaScriptCore.COMPILER_PB_UNUSED_IMPORT);
53
//	private static final Key PREF_PB_UNUSED_IMPORT= getJDTCoreKey(JavaScriptCore.COMPILER_PB_UNUSED_IMPORT);
55
	private static final Key PREF_PB_UNUSED_PRIVATE= getJDTCoreKey(JavaScriptCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER);
54
	private static final Key PREF_PB_UNUSED_PRIVATE= getJDTCoreKey(JavaScriptCore.COMPILER_PB_UNUSED_PRIVATE_MEMBER);
56
//	private static final Key PREF_PB_STATIC_ACCESS_RECEIVER= getJDTCoreKey(JavaScriptCore.COMPILER_PB_STATIC_ACCESS_RECEIVER);
55
//	private static final Key PREF_PB_STATIC_ACCESS_RECEIVER= getJDTCoreKey(JavaScriptCore.COMPILER_PB_STATIC_ACCESS_RECEIVER);
Lines 141-147 Link Here
141
				PREF_PB_UNDEFINED_FIELD,
140
				PREF_PB_UNDEFINED_FIELD,
142
				/*PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME,*/ PREF_PB_DEPRECATION, PREF_PB_HIDDEN_CATCH_BLOCK, PREF_PB_UNUSED_LOCAL,
141
				/*PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME,*/ PREF_PB_DEPRECATION, PREF_PB_HIDDEN_CATCH_BLOCK, PREF_PB_UNUSED_LOCAL,
143
				PREF_PB_UNUSED_PARAMETER, PREF_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE,
142
				PREF_PB_UNUSED_PARAMETER, PREF_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE,
144
				/*PREF_PB_SYNTHETIC_ACCESS_EMULATION,*/ PREF_PB_NON_EXTERNALIZED_STRINGS,
143
				/*PREF_PB_SYNTHETIC_ACCESS_EMULATION,*/
145
				/*PREF_PB_UNUSED_IMPORT,*/ PREF_PB_UNUSED_LABEL, 
144
				/*PREF_PB_UNUSED_IMPORT,*/ PREF_PB_UNUSED_LABEL, 
146
				/*PREF_PB_STATIC_ACCESS_RECEIVER, */PREF_PB_DEPRECATION_IN_DEPRECATED_CODE, 
145
				/*PREF_PB_STATIC_ACCESS_RECEIVER, */PREF_PB_DEPRECATION_IN_DEPRECATED_CODE, 
147
				PREF_PB_NO_EFFECT_ASSIGNMENT, /*PREF_PB_INCOMPATIBLE_INTERFACE_METHOD,*/
146
				PREF_PB_NO_EFFECT_ASSIGNMENT, /*PREF_PB_INCOMPATIBLE_INTERFACE_METHOD,*/
Lines 275-283 Link Here
275
274
276
		label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_parameter_assignment; 
275
		label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_parameter_assignment; 
277
		addComboBox(inner, label, PREF_PB_PARAMETER_ASSIGNMENT, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);			
276
		addComboBox(inner, label, PREF_PB_PARAMETER_ASSIGNMENT, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);			
278
279
		label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_non_externalized_strings_label; 
280
		addComboBox(inner, label, PREF_PB_NON_EXTERNALIZED_STRINGS, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
281
		
277
		
282
		// --- potential_programming_problems
278
		// --- potential_programming_problems
283
			
279
			
(-)src/org/eclipse/wst/jsdt/internal/ui/wizards/NewWizardMessages.java (-4 lines)
Lines 157-166 Link Here
157
	public static String NewTypeWizardPage_operationdesc;
157
	public static String NewTypeWizardPage_operationdesc;
158
	public static String NewTypeWizardPage_error_uri_location_unkown;
158
	public static String NewTypeWizardPage_error_uri_location_unkown;
159
	
159
	
160
	//public static String OutputLocation_DotAsLocation;
161
	//public static String OutputLocation_SettingsAsLocation;
162
	//public static String OutputLocationDialog_removeProjectFromBP;
163
	
164
	public static String RemoveFromBuildpathAction_ErrorTitle;
160
	public static String RemoveFromBuildpathAction_ErrorTitle;
165
	
161
	
166
	public static String SuperInterfaceSelectionDialog_addButton_label;
162
	public static String SuperInterfaceSelectionDialog_addButton_label;

Return to bug 268542