View | Details | Raw Unified | Return to bug 170595
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java (-56 / +60 lines)
Lines 36-44 Link Here
36
36
37
	static {
37
	static {
38
//	TESTS_NAMES = new String[] { "test000" };
38
//	TESTS_NAMES = new String[] { "test000" };
39
//	TESTS_NUMBERS = new int[] { 59 };
39
//	TESTS_NUMBERS = new int[] { 24 };
40
//	TESTS_RANGE = new int[] { 107, -1 };
40
//	TESTS_RANGE = new int[] { 107, -1 };
41
}
41
	}
42
public BatchCompilerTest(String name) {
42
public BatchCompilerTest(String name) {
43
	super(name);
43
	super(name);
44
}
44
}
Lines 1116-1123 Link Here
1116
        "      maskedCatchBlock   + hidden catch block\n" +
1116
        "      maskedCatchBlock   + hidden catch block\n" +
1117
        "      nls                  string literal lacking non-nls tag //$NON-NLS-<n>$\n" +
1117
        "      nls                  string literal lacking non-nls tag //$NON-NLS-<n>$\n" +
1118
        "      noEffectAssign     + assignment without effect\n" +
1118
        "      noEffectAssign     + assignment without effect\n" +
1119
        "      null                 potential missing or redundant null check\n" + 
1119
        "      null                 potential missing or redundant null check\n" +
1120
        "      nullDereference      missing null check\n" + 
1120
        "      nullDereference      missing null check\n" +
1121
        "      over-ann             missing @Override annotation\n" +
1121
        "      over-ann             missing @Override annotation\n" +
1122
        "      paramAssign          assignment to a parameter\n" +
1122
        "      paramAssign          assignment to a parameter\n" +
1123
        "      pkgDefaultMethod   + attempt to override package-default method\n" +
1123
        "      pkgDefaultMethod   + attempt to override package-default method\n" +
Lines 1264-1270 Link Here
1264
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.parameterAssignment\" value=\"ignore\"/>\n" +
1264
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.parameterAssignment\" value=\"ignore\"/>\n" +
1265
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment\" value=\"ignore\"/>\n" +
1265
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment\" value=\"ignore\"/>\n" +
1266
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.potentialNullReference\" value=\"ignore\"/>\n" +
1266
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.potentialNullReference\" value=\"ignore\"/>\n" +
1267
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.rawTypeReference\" value=\"warning\"/>\n" + 
1267
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.rawTypeReference\" value=\"warning\"/>\n" +
1268
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.redundantNullCheck\" value=\"ignore\"/>\n" +
1268
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.redundantNullCheck\" value=\"ignore\"/>\n" +
1269
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.specialParameterHidingField\" value=\"disabled\"/>\n" +
1269
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.specialParameterHidingField\" value=\"disabled\"/>\n" +
1270
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver\" value=\"warning\"/>\n" +
1270
			"		<option key=\"org.eclipse.jdt.core.compiler.problem.staticAccessReceiver\" value=\"warning\"/>\n" +
Lines 1731-1758 Link Here
1731
	}
1731
	}
1732
//	 https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - explicit empty -extdirs removes extensions
1732
//	 https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - explicit empty -extdirs removes extensions
1733
	public void test024(){
1733
	public void test024(){
1734
		if (!System.getProperty("java.vm.vendor").equals("Sun Microsystems Inc.")) return;
1735
		/* this tests is using Sun vm layout. The type sun.net.spi.nameservice.dns.DNSNameService
1736
		 * is located in the ext dir.
1737
		 */
1734
		this.runNegativeTest(
1738
		this.runNegativeTest(
1735
			new String[] {
1739
				new String[] {
1736
					"X.java",
1740
						"X.java",
1737
					"/** */\n" +
1741
						"/** */\n" +
1738
					"public class X {\n" +
1742
						"public class X {\n" +
1739
					"  my.pkg.Zork dummy;\n" +
1743
						"  sun.net.spi.nameservice.dns.DNSNameService dummy;\n" +
1740
					"}",
1744
						"}",
1741
			},
1745
				},
1742
	        "\"" + OUTPUT_DIR +  File.separator + "X.java\""
1746
				"\"" + OUTPUT_DIR +  File.separator + "X.java\""
1743
			+ " -extdirs \"\""
1747
				+ " -extdirs \"\""
1744
	        + " -1.5 -g -preserveAllLocals"
1748
				+ " -1.5 -g -preserveAllLocals"
1745
	        + " -proceedOnError -referenceInfo"
1749
				+ " -proceedOnError -referenceInfo"
1746
	        + " -d \"" + OUTPUT_DIR + "\" ",
1750
				+ " -d \"" + OUTPUT_DIR + "\" ",
1747
	        "",
1751
				"",
1748
	        "----------\n" +
1752
				"----------\n" +
1749
	        "1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
1753
				"1. ERROR in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 3)\n" +
1750
	        "	my.pkg.Zork dummy;\n" +
1754
				"	sun.net.spi.nameservice.dns.DNSNameService dummy;\n" +
1751
	        "	^^\n" +
1755
				"	^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
1752
	        "my cannot be resolved to a type\n" +
1756
				"sun.net.spi.nameservice.dns cannot be resolved to a type\n" +
1753
	        "----------\n" +
1757
				"----------\n" +
1754
	        "1 problem (1 error)",
1758
				"1 problem (1 error)",
1755
	        true);
1759
				true);
1756
	}
1760
	}
1757
//	 https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - cumulative -extdirs extends the classpath
1761
//	 https://bugs.eclipse.org/bugs/show_bug.cgi?id=88364 - cumulative -extdirs extends the classpath
1758
	public void test025(){
1762
	public void test025(){
Lines 5199-5209 Link Here
5199
	this.runConformTest(
5203
	this.runConformTest(
5200
		new String[] {
5204
		new String[] {
5201
			"X.java",
5205
			"X.java",
5202
			"public class X {\n" + 
5206
			"public class X {\n" +
5203
			"  void foo() {\n" + 
5207
			"  void foo() {\n" +
5204
			"    Object o = null;\n" + 
5208
			"    Object o = null;\n" +
5205
			"    o.toString();\n" + 
5209
			"    o.toString();\n" +
5206
			"  }\n" + 
5210
			"  }\n" +
5207
			"}"},
5211
			"}"},
5208
     "\"" + OUTPUT_DIR +  File.separator + "X.java\""
5212
     "\"" + OUTPUT_DIR +  File.separator + "X.java\""
5209
     + " -1.5 -g -preserveAllLocals"
5213
     + " -1.5 -g -preserveAllLocals"
Lines 5211-5223 Link Here
5211
     + " -cp " + getJCEJar()
5215
     + " -cp " + getJCEJar()
5212
     + " -warn:+nullDereference"
5216
     + " -warn:+nullDereference"
5213
     + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
5217
     + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
5214
     "", 
5218
     "",
5215
     "----------\n" + 
5219
     "----------\n" +
5216
     "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 4)\n" + 
5220
     "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 4)\n" +
5217
     "	o.toString();\n" + 
5221
     "	o.toString();\n" +
5218
     "	^\n" + 
5222
     "	^\n" +
5219
     "Null pointer access: The variable o can only be null at this location\n" + 
5223
     "Null pointer access: The variable o can only be null at this location\n" +
5220
     "----------\n" + 
5224
     "----------\n" +
5221
     "1 problem (1 warning)",
5225
     "1 problem (1 warning)",
5222
     true);
5226
     true);
5223
}
5227
}
Lines 5228-5238 Link Here
5228
	this.runConformTest(
5232
	this.runConformTest(
5229
		new String[] {
5233
		new String[] {
5230
			"X.java",
5234
			"X.java",
5231
			"public class X {\n" + 
5235
			"public class X {\n" +
5232
			"  void foo() {\n" + 
5236
			"  void foo() {\n" +
5233
			"    Object o = null;\n" + 
5237
			"    Object o = null;\n" +
5234
			"    if (o == null) {}\n" + 
5238
			"    if (o == null) {}\n" +
5235
			"  }\n" + 
5239
			"  }\n" +
5236
			"}"},
5240
			"}"},
5237
  "\"" + OUTPUT_DIR +  File.separator + "X.java\""
5241
  "\"" + OUTPUT_DIR +  File.separator + "X.java\""
5238
  + " -1.5 -g -preserveAllLocals"
5242
  + " -1.5 -g -preserveAllLocals"
Lines 5240-5252 Link Here
5240
  + " -cp " + getJCEJar()
5244
  + " -cp " + getJCEJar()
5241
  + " -warn:+null"
5245
  + " -warn:+null"
5242
  + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
5246
  + " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
5243
  "", 
5247
  "",
5244
  "----------\n" + 
5248
  "----------\n" +
5245
  "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 4)\n" + 
5249
  "1. WARNING in ---OUTPUT_DIR_PLACEHOLDER---/X.java (at line 4)\n" +
5246
  "	if (o == null) {}\n" + 
5250
  "	if (o == null) {}\n" +
5247
  "	    ^\n" + 
5251
  "	    ^\n" +
5248
  "Redundant null check: The variable o can only be null at this location\n" + 
5252
  "Redundant null check: The variable o can only be null at this location\n" +
5249
  "----------\n" + 
5253
  "----------\n" +
5250
  "1 problem (1 warning)",
5254
  "1 problem (1 warning)",
5251
  true);
5255
  true);
5252
}
5256
}
Lines 5257-5267 Link Here
5257
	this.runConformTest(
5261
	this.runConformTest(
5258
		new String[] {
5262
		new String[] {
5259
			"X.java",
5263
			"X.java",
5260
			"public class X {\n" + 
5264
			"public class X {\n" +
5261
			"  void foo() {\n" + 
5265
			"  void foo() {\n" +
5262
			"    Object o = null;\n" + 
5266
			"    Object o = null;\n" +
5263
			"    if (o == null) {}\n" + 
5267
			"    if (o == null) {}\n" +
5264
			"  }\n" + 
5268
			"  }\n" +
5265
			"}"},
5269
			"}"},
5266
"\"" + OUTPUT_DIR +  File.separator + "X.java\""
5270
"\"" + OUTPUT_DIR +  File.separator + "X.java\""
5267
+ " -1.5 -g -preserveAllLocals"
5271
+ " -1.5 -g -preserveAllLocals"
Lines 5269-5275 Link Here
5269
+ " -cp " + getJCEJar()
5273
+ " -cp " + getJCEJar()
5270
+ " -warn:+nullDereference"
5274
+ " -warn:+nullDereference"
5271
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
5275
+ " -proceedOnError -referenceInfo -d \"" + OUTPUT_DIR + "\"",
5272
"", 
5276
"",
5273
"",
5277
"",
5274
true);
5278
true);
5275
}
5279
}

Return to bug 170595