|
Lines 1712-1717
Link Here
|
| 1712 |
deleteProject("P"); |
1712 |
deleteProject("P"); |
| 1713 |
} |
1713 |
} |
| 1714 |
} |
1714 |
} |
|
|
1715 |
/* |
| 1716 |
* Ensures that a potential subtype in a dependent project doesn't appear in the hierarchy |
| 1717 |
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=169678 ) |
| 1718 |
*/ |
| 1719 |
public void testPotentialSubtypeInDependentProject() throws Exception { |
| 1720 |
try { |
| 1721 |
createJavaProject("P1", new String[] {""}, new String[] {"JCL_LIB"}, ""); |
| 1722 |
createFolder("/P1/p1"); |
| 1723 |
createFile( |
| 1724 |
"/P1/p1/X169678.java", |
| 1725 |
"package p1;\n" + |
| 1726 |
"public class X169678 {\n" + |
| 1727 |
" public static class Y169678 {\n" + |
| 1728 |
" }\n" + |
| 1729 |
"}" |
| 1730 |
); |
| 1731 |
createFile( |
| 1732 |
"/P1/p1/Z169678.java", |
| 1733 |
"package p1;\n" + |
| 1734 |
"public class Z169678 extends X169678.Y169678 {\n" + |
| 1735 |
"}" |
| 1736 |
); |
| 1737 |
createJavaProject("P2", new String[] {""}, new String[] {"JCL_LIB"}, new String[] {"/P1"}, ""); |
| 1738 |
createFolder("/P2/p2"); |
| 1739 |
createFile( |
| 1740 |
"/P2/p2/Y169678.java", |
| 1741 |
"package p2;\n" + |
| 1742 |
"public class Y169678 {\n" + |
| 1743 |
"}\n" + |
| 1744 |
"class Z169678 extends Y169678 {\n" + |
| 1745 |
"}" |
| 1746 |
); |
| 1747 |
IType type = getCompilationUnit("/P1/p1/X169678.java").getType("X169678").getType("Y169678"); |
| 1748 |
ITypeHierarchy hierarchy = type.newTypeHierarchy(null); |
| 1749 |
IType[] allTypes = hierarchy.getAllTypes(); |
| 1750 |
assertSortedElementsEqual( |
| 1751 |
"Unexpected types in hierarchy", |
| 1752 |
"Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" + |
| 1753 |
"Y169678 [in X169678 [in X169678.java [in p1 [in <project root> [in P1]]]]]\n" + |
| 1754 |
"Z169678 [in Z169678.java [in p1 [in <project root> [in P1]]]]", |
| 1755 |
allTypes); |
| 1756 |
} finally { |
| 1757 |
deleteProjects(new String[] {"P1", "P2"}); |
| 1758 |
} |
| 1759 |
} |
| 1715 |
/** |
1760 |
/** |
| 1716 |
* Ensures that a potential subtype that is not in the classpth is handle correctly. |
1761 |
* Ensures that a potential subtype that is not in the classpth is handle correctly. |
| 1717 |
* (Regression test for PR #1G4GL9R) |
1762 |
* (Regression test for PR #1G4GL9R) |