Regression fix related to Bug 321411 - [hierarchy] Replace OTTypeHierarchy with adapting the original TypeHierarchy:
expect missing focusType (region based h.) and missing typeHandle (inner class) -> 100% pass in JDT's TypeHierarchyTests.
diff --git a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/hierarchy/OTTypeHierarchies.java b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/hierarchy/OTTypeHierarchies.java
index 1e63465..62ce192 100644
--- a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/hierarchy/OTTypeHierarchies.java
+++ b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/hierarchy/OTTypeHierarchies.java
@@ -64,6 +64,8 @@
UNRELATED;
public static FocusRelation compute(ReferenceBinding focusType, ReferenceBinding typeBinding) {
+ if (focusType == null) // happens for region based hierarchy
+ return UNRELATED;
if (focusType.isRole())
focusType = focusType.getRealType();
if (typeBinding.isRole())
@@ -562,7 +564,7 @@
private void connectTSupers(ReferenceBinding focusType, ReferenceBinding typeBinding, IGenericType type, IType typeHandle, boolean isPhantom,
IType superclassHandle, IType[] tsuperclassHandles, boolean[] arePhantoms, IType[] superinterfaceHandles)
{
- if (tsuperclassHandles!= null) {
+ if (typeHandle != null && tsuperclassHandles!= null) {
FocusRelation focusRelation = FocusRelation.compute(focusType, typeBinding);
getHierarchy().connectTSupers(typeHandle, isPhantom, tsuperclassHandles, arePhantoms, focusRelation);
}