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

(-)a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/MultiProjectTests.java (+63 lines)
Lines 57-62 public class MultiProjectTests extends BuilderTests { Link Here
57
		suite.addTest(new MultiProjectTests("test101_class_folder_non_exported"));
57
		suite.addTest(new MultiProjectTests("test101_class_folder_non_exported"));
58
		suite.addTest(new MultiProjectTests("test102_missing_required_binaries"));
58
		suite.addTest(new MultiProjectTests("test102_missing_required_binaries"));
59
		suite.addTest(new MultiProjectTests("test103_missing_required_binaries"));
59
		suite.addTest(new MultiProjectTests("test103_missing_required_binaries"));
60
		suite.addTest(new MultiProjectTests("test438923"));
60
		return suite;
61
		return suite;
61
	}
62
	}
62
63
Lines 1606-1609 public void test103_missing_required_binaries() throws JavaModelException { Link Here
1606
		env.setBuildOrder(null);
1607
		env.setBuildOrder(null);
1607
	}
1608
	}
1608
}
1609
}
1610
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=438923, [compiler]Type is inappropriately considered "indirectly referenced"
1611
public void test438923() throws JavaModelException {
1612
	//----------------------------
1613
	//         Project1
1614
	//----------------------------
1615
	IPath p1 = env.addProject("P1"); //$NON-NLS-1$
1616
	env.addExternalJars(p1, Util.getJavaClassLibs());
1617
	// remove old package fragment root so that names don't collide
1618
	env.removePackageFragmentRoot(p1, ""); //$NON-NLS-1$
1619
	IPath root1 = env.addPackageFragmentRoot(p1, "src"); //$NON-NLS-1$
1620
	env.setOutputFolder(p1, "bin"); //$NON-NLS-1$
1621
1622
	env.addClass(root1, "p1", "P1I0", //$NON-NLS-1$ //$NON-NLS-2$
1623
			"package p1;\n" + 
1624
			"public interface P1I0 {\n" +
1625
			"  interface II {/*empty*/}\n" +
1626
			"}\n"
1627
		);
1628
1629
	//----------------------------
1630
	//         Project2
1631
	//----------------------------
1632
	IPath p2 = env.addProject("P2"); //$NON-NLS-1$
1633
	env.addExternalJars(p2, Util.getJavaClassLibs());
1634
	// remove old package fragment root so that names don't collide
1635
	env.removePackageFragmentRoot(p2, ""); //$NON-NLS-1$
1636
	IPath root2 = env.addPackageFragmentRoot(p2, "src"); //$NON-NLS-1$
1637
	env.setOutputFolder(p2, "bin"); //$NON-NLS-1$
1638
1639
	env.addClass(root2, "p2", "P2C0", //$NON-NLS-1$ //$NON-NLS-2$
1640
			"package p2;\n" + 
1641
			"import p1.P1I0;\n" +
1642
			"public class P2C0 {\n" +
1643
			"  public void z(final P1I0.II [] ii) {/*empty*/}\n" +
1644
			"}\n"
1645
		);
1646
1647
	
1648
	//----------------------------
1649
	//         Project3
1650
	//----------------------------
1651
	IPath p3 = env.addProject("P3"); //$NON-NLS-1$
1652
	env.addExternalJars(p3, Util.getJavaClassLibs());
1653
	// remove old package fragment root so that names don't collide
1654
	env.removePackageFragmentRoot(p3, ""); //$NON-NLS-1$
1655
	IPath root3 = env.addPackageFragmentRoot(p3, "src"); //$NON-NLS-1$
1656
	env.setOutputFolder(p3, "bin"); //$NON-NLS-1$
1657
1658
	env.addClass(root3, "p3", "P3C0", //$NON-NLS-1$ //$NON-NLS-2$
1659
			"package p3;\n" +
1660
			"import p2.P2C0;\n" +
1661
			"public class P3C0\n" +
1662
			"  extends P2C0 {/*empty*/}\n"
1663
		);
1664
1665
	// for Project1
1666
	env.addRequiredProject(p2, p1);
1667
	env.addRequiredProject(p3, p2);
1668
1669
	fullBuild();
1670
	expectingNoProblems();
1671
}
1609
}
1672
}
(-)a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeSystem.java (-2 / +9 lines)
Lines 69-76 public class TypeSystem { Link Here
69
69
70
	// Given a type, answer its unannotated aka naked prototype. This is also a convenient way to "register" a type with TypeSystem and have it id stamped.
70
	// Given a type, answer its unannotated aka naked prototype. This is also a convenient way to "register" a type with TypeSystem and have it id stamped.
71
	public final TypeBinding getUnannotatedType(TypeBinding type) {
71
	public final TypeBinding getUnannotatedType(TypeBinding type) {
72
		if (type.isUnresolvedType() && CharOperation.indexOf('$', type.sourceName()) > 0)
72
		if (type.isUnresolvedType() && CharOperation.indexOf('$', type.sourceName()) > 0) {
73
			type = BinaryTypeBinding.resolveType(type, this.environment, true); // to ensure unique id assignment (when enclosing type is parameterized, inner type is also) 
73
			boolean mayTolerateMissingType = this.environment.mayTolerateMissingType;
74
			this.environment.mayTolerateMissingType = true;
75
			try {
76
				type = BinaryTypeBinding.resolveType(type, this.environment, true); // to ensure unique id assignment (when enclosing type is parameterized, inner type is also) 
77
			} finally {
78
				this.environment.mayTolerateMissingType = mayTolerateMissingType;
79
			}
80
		}
74
		if (type.id == TypeIds.NoId) {
81
		if (type.id == TypeIds.NoId) {
75
			if (type.hasTypeAnnotations())
82
			if (type.hasTypeAnnotations())
76
				throw new IllegalStateException();
83
				throw new IllegalStateException();

Return to bug 438923