List of usage examples for org.eclipse.jdt.core ITypeHierarchy getCachedFlags
int getCachedFlags(IType type);
IMember.getFlags()
), or -1
if this information wasn't cached on the hierarchy during its computation. From source file:org.eclipse.jst.j2ee.internal.common.operations.JavaModelUtil.java
License:Open Source License
public static boolean isSuperType(ITypeHierarchy hierarchy, IType possibleSuperType, IType type) { // filed bug 112635 to add this method to ITypeHierarchy IType superClass = hierarchy.getSuperclass(type); if (superClass != null && (possibleSuperType.equals(superClass) || isSuperType(hierarchy, possibleSuperType, superClass))) { return true; }/*from w ww .ja v a 2 s. c om*/ if (Flags.isInterface(hierarchy.getCachedFlags(possibleSuperType))) { IType[] superInterfaces = hierarchy.getSuperInterfaces(type); for (int i = 0; i < superInterfaces.length; i++) { IType curr = superInterfaces[i]; if (possibleSuperType.equals(curr) || isSuperType(hierarchy, possibleSuperType, curr)) { return true; } } } return false; }