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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java (+38 lines)
Lines 1559-1564 Link Here
1559
		"Zork cannot be resolved to a type\n" + 
1559
		"Zork cannot be resolved to a type\n" + 
1560
		"----------\n");
1560
		"----------\n");
1561
}
1561
}
1562
public void test042() {
1563
	this.runConformTest(
1564
		new String[] {
1565
			"X.java",
1566
			"import java.util.List;\n" + 
1567
			"public class X {\n" + 
1568
			"	public static void main(String[] args) {\n" + 
1569
			"		System.out.print(\"SUCCESS\");	\n" +
1570
			"	}\n" + 
1571
			"	\n" + 
1572
			"	public static void foo(boolean b, List l) {\n" + 
1573
			"		if (b) {\n" + 
1574
			"			String s = (String) l.get(0);\n" + 
1575
			"		}\n" + 
1576
			"	}\n" + 
1577
			"}",
1578
		},
1579
		"SUCCESS");
1580
}
1581
public void test043() {
1582
	this.runConformTest(
1583
		new String[] {
1584
			"X.java",
1585
			"import java.util.List;\n" + 
1586
			"public class X {\n" + 
1587
			"	public static void main(String[] args) {\n" + 
1588
			"		System.out.print(\"SUCCESS\");	\n" +
1589
			"	}\n" + 
1590
			"	\n" + 
1591
			"	public static void foo(boolean b, List l) {\n" + 
1592
			"		if (b) {\n" + 
1593
			"			Object o = (Object) l.get(0);\n" + 
1594
			"		}\n" + 
1595
			"	}\n" + 
1596
			"}",
1597
		},
1598
		"SUCCESS");
1599
}
1562
public static Class testClass() {
1600
public static Class testClass() {
1563
	return CastTest.class;
1601
	return CastTest.class;
1564
}
1602
}

Return to bug 159654