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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java (+142 lines)
Lines 1562-1567 Link Here
1562
		        "incorrect classpath: dummy\n",
1562
		        "incorrect classpath: dummy\n",
1563
		        false);
1563
		        false);
1564
		}
1564
		}
1565
// Extraneous auto-build error message - https://bugs.eclipse.org/bugs/show_bug.cgi?id=93377
1566
// More complex test case than _test30
1567
public void _test032(){
1568
	this.runConformTest(
1569
		new String[] {
1570
			"p/X.java",
1571
			"package p;\n" + 
1572
			"import java.io.Serializable;\n" + 
1573
			"public interface X<T extends X<T, U, V>, \n" + 
1574
			"				   U extends X.XX<T, V>, \n" + 
1575
			"				   V extends X.XY> {\n" + 
1576
			"	public interface XX<TT extends X<TT, ?, UU>, \n" + 
1577
			"	                    UU extends X.XY> \n" + 
1578
			"			extends	Serializable {\n" + 
1579
			"	}\n" + 
1580
			"	public interface XY extends Serializable {\n" + 
1581
			"	}\n" + 
1582
			"}\n",
1583
		},
1584
        "\"" + OUTPUT_DIR +  File.separator + "p/X.java\""
1585
        + " -1.5 -g -preserveAllLocals"
1586
        + " -proceedOnError -referenceInfo" 
1587
        + " -d \"" + OUTPUT_DIR + "\"",
1588
        "",
1589
        "",
1590
        true);
1591
	this.runConformTest(
1592
		new String[] {
1593
			"p/Y.java",
1594
			"package p;\n" + 
1595
			"import java.util.*;\n" + 
1596
			"import p.X.*;\n" + 
1597
			"public class Y<T extends X<T, U, V>, \n" + 
1598
			"               U extends X.XX<T, V>, \n" + 
1599
			"               V extends X.XY> {\n" + 
1600
			"	private final Map<U, V> m1 = new HashMap<U, V>();\n" + 
1601
			"	private final Map<U, T> m2 = new HashMap<U, T>();\n" + 
1602
			"	private final Z m3;\n" + 
1603
			"\n" + 
1604
			"	public Y(final Z p1) {\n" + 
1605
			"		this.m3 = p1;\n" + 
1606
			"	}\n" + 
1607
			"\n" + 
1608
			"	public void foo1(final U p1, final V p2, final T p3) {\n" + 
1609
			"		m1.put(p1, p2);\n" + 
1610
			"		m2.put(p1, p3);\n" + 
1611
			"		m3.foo2(p1, p2);\n" + 
1612
			"	}\n" + 
1613
			"\n" + 
1614
			"	public void foo3(final U p1) {\n" + 
1615
			"		assert m1.containsKey(p1);\n" + 
1616
			"		m1.remove(p1);\n" + 
1617
			"		m2.remove(p1);\n" + 
1618
			"		m3.foo2(p1, null);\n" + 
1619
			"	}\n" + 
1620
			"\n" + 
1621
			"	public Collection<T> foo4() {\n" + 
1622
			"		return Collections.unmodifiableCollection(m2.values());\n" + 
1623
			"	}\n" + 
1624
			"\n" + 
1625
			"	public void foo5(final Map<XX<?, ?>, XY> p1) {\n" + 
1626
			"		p1.putAll(m1);\n" + 
1627
			"	}\n" + 
1628
			"\n" + 
1629
			"	public void foo6(final Map<XX<?, ?>, XY> p1) {\n" + 
1630
			"		m1.keySet().retainAll(p1.keySet());\n" + 
1631
			"		m2.keySet().retainAll(p1.keySet());\n" + 
1632
			"	}\n" + 
1633
			"}\n",
1634
			"p/Z.java",
1635
			"package p;\n" + 
1636
			"\n" + 
1637
			"import java.util.*;\n" + 
1638
			"\n" + 
1639
			"import p.X.*;\n" + 
1640
			"\n" + 
1641
			"public class Z {\n" + 
1642
			"	private final Map<Class<? extends X>, \n" + 
1643
			"		              Y<?, ? extends XX<?, ?>, ? extends XY>> \n" + 
1644
			"		m1 = new HashMap<Class<? extends X>, \n" + 
1645
			"		                 Y<?, ? extends XX<?, ?>, ? extends XY>>();\n" + 
1646
			"\n" + 
1647
			"	private Map<X.XX<?, XY>, \n" + 
1648
			"	            X.XY> \n" + 
1649
			"		m2 = new HashMap<X.XX<?, XY>, \n" + 
1650
			"		                 X.XY>();\n" + 
1651
			"\n" + 
1652
			"	public <T extends X<T, U, V>, \n" + 
1653
			"	        U extends X.XX<T, V>, \n" + 
1654
			"	        V extends X.XY> \n" + 
1655
			"	Y<T, U, V> foo1(final Class<T> p1) {\n" + 
1656
			"		Y l1 = m1.get(p1);\n" + 
1657
			"		if (l1 == null) {\n" + 
1658
			"			l1 = new Y<T, U, V>(this);\n" + 
1659
			"			m1.put(p1, l1);\n" + 
1660
			"		}\n" + 
1661
			"		return l1;\n" + 
1662
			"	}\n" + 
1663
			"\n" + 
1664
			"	public <TT extends X.XX<?, UU>, \n" + 
1665
			"	        UU extends X.XY> \n" + 
1666
			"	void foo2(final TT p1, final UU p2) {\n" + 
1667
			"		m2.put((XX<?, XY>) p1, p2);\n" + 
1668
			"	}\n" + 
1669
			"\n" + 
1670
			"	public Map<XX<?, ?>, XY> foo3() {\n" + 
1671
			"		final Map<XX<?, ?>, \n" + 
1672
			"		          XY> l1 = new HashMap<XX<?, ?>, \n" + 
1673
			"		                               XY>();\n" + 
1674
			"		for (final Y<?, \n" + 
1675
			"				     ? extends XX<?, ?>, \n" + 
1676
			"				     ? extends XY> \n" + 
1677
			"				i : m1.values()) {\n" + 
1678
			"			i.foo5(l1);\n" + 
1679
			"		}\n" + 
1680
			"		return l1;\n" + 
1681
			"	}\n" + 
1682
			"\n" + 
1683
			"	public void foo4(final Object p1, final Map<XX<?, ?>, \n" + 
1684
			"			                                    XY> p2) {\n" + 
1685
			"		for (final Y<?, \n" + 
1686
			"				     ? extends XX<?, ?>, \n" + 
1687
			"				     ? extends XY> i : m1.values()) {\n" + 
1688
			"			i.foo6(p2);\n" + 
1689
			"		}\n" + 
1690
			"		for (final Map.Entry<XX<?, ?>, \n" + 
1691
			"				             XY> i : p2.entrySet()) {\n" + 
1692
			"			final XX<?, XY> l1 = (XX<?, XY>) i.getKey();\n" + 
1693
			"		}\n" + 
1694
			"	}\n" + 
1695
			"}\n"
1696
		},
1697
        "\"" + OUTPUT_DIR +  File.separator + "p/Y.java\""
1698
        + " \"" + OUTPUT_DIR +  File.separator + "p/Z.java\""
1699
        + " -1.5 -g -preserveAllLocals"
1700
        + " -cp \"" + OUTPUT_DIR + File.separator + "\""
1701
        + " -proceedOnError -referenceInfo"
1702
        + " -d \"" + OUTPUT_DIR + "\"",
1703
        "",
1704
        "",
1705
        false);
1706
}
1565
public static Class testClass() {
1707
public static Class testClass() {
1566
	return BatchCompilerTest.class;
1708
	return BatchCompilerTest.class;
1567
}
1709
}

Return to bug 93377