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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/AutoBoxingTest.java (+110 lines)
Lines 3859-3862 Link Here
3859
		"Zork cannot be resolved to a type\n" + 
3859
		"Zork cannot be resolved to a type\n" + 
3860
		"----------\n");
3860
		"----------\n");
3861
}
3861
}
3862
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=174879
3863
public void test130() {
3864
	this.runConformTest(
3865
		new String[] {
3866
			"X.java",
3867
			"public class X {\n" + 
3868
			"	Boolean[] myBool = new Boolean[1];\n" + 
3869
			"	void foo() {\n" + 
3870
			"		if (this.myBool[0]) {}\n" + 
3871
			"	}\n" + 
3872
			"	public static void main(String[] args) {\n" + 
3873
			"		try {\n" + 
3874
			"			new X().foo();\n" + 
3875
			"			System.out.println(\"FAILURE\");\n" + 
3876
			"		} catch(NullPointerException e) {\n" + 
3877
			"			System.out.println(\"SUCCESS\");\n" + 
3878
			"		}\n" + 
3879
			"	}\n" + 
3880
			"}",
3881
		},
3882
		"SUCCESS");
3883
}
3884
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=174879
3885
public void test131() {
3886
	this.runConformTest(
3887
		new String[] {
3888
			"X.java",
3889
			"public class X {\n" + 
3890
			"	Boolean myBool = null;\n" + 
3891
			"	void foo() {\n" + 
3892
			"		if (myBool) {}\n" + 
3893
			"	}\n" + 
3894
			"	public static void main(String[] args) {\n" + 
3895
			"		try {\n" + 
3896
			"			new X().foo();\n" + 
3897
			"			System.out.println(\"FAILURE\");\n" + 
3898
			"		} catch(NullPointerException e) {\n" + 
3899
			"			System.out.println(\"SUCCESS\");\n" + 
3900
			"		}\n" + 
3901
			"	}\n" + 
3902
			"}",
3903
		},
3904
		"SUCCESS");
3905
}
3906
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=174879
3907
public void test132() {
3908
	this.runConformTest(
3909
		new String[] {
3910
			"X.java",
3911
			"public class X {\n" + 
3912
			"	static Boolean myBool = null;\n" + 
3913
			"	static void foo() {\n" + 
3914
			"		if (myBool) {}\n" + 
3915
			"	}\n" + 
3916
			"	public static void main(String[] args) {\n" + 
3917
			"		try {\n" + 
3918
			"			foo();\n" + 
3919
			"			System.out.println(\"FAILURE\");\n" + 
3920
			"		} catch(NullPointerException e) {\n" + 
3921
			"			System.out.println(\"SUCCESS\");\n" + 
3922
			"		}\n" + 
3923
			"	}\n" + 
3924
			"}",
3925
		},
3926
		"SUCCESS");
3927
}
3928
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=174879
3929
public void test133() {
3930
	this.runConformTest(
3931
		new String[] {
3932
			"X.java",
3933
			"public class X {\n" + 
3934
			"	Boolean myBool = null;\n" + 
3935
			"	void foo() {\n" + 
3936
			"		if (this.myBool) {}\n" + 
3937
			"	}\n" + 
3938
			"	public static void main(String[] args) {\n" + 
3939
			"		try {\n" + 
3940
			"			new X().foo();\n" + 
3941
			"			System.out.println(\"FAILURE\");\n" + 
3942
			"		} catch(NullPointerException e) {\n" + 
3943
			"			System.out.println(\"SUCCESS\");\n" + 
3944
			"		}\n" + 
3945
			"	}\n" + 
3946
			"}",
3947
		},
3948
		"SUCCESS");
3949
}
3950
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=174879
3951
public void test134() {
3952
	this.runConformTest(
3953
		new String[] {
3954
			"X.java",
3955
			"public class X {\n" + 
3956
			"	static Boolean MyBool = null;\n" + 
3957
			"	static void foo() {\n" + 
3958
			"		if (X.MyBool) {}\n" + 
3959
			"	}\n" + 
3960
			"	public static void main(String[] args) {\n" + 
3961
			"		try {\n" + 
3962
			"			foo();\n" + 
3963
			"			System.out.println(\"FAILURE\");\n" + 
3964
			"		} catch(NullPointerException e) {\n" + 
3965
			"			System.out.println(\"SUCCESS\");\n" + 
3966
			"		}\n" + 
3967
			"	}\n" + 
3968
			"}",
3969
		},
3970
		"SUCCESS");
3971
}
3862
}
3972
}

Return to bug 174879