protected final boolean isAnonymousFromInterface(IType type) { return isAnonymous(type) && fTypeHierarchy.getHierarchy().getSuperInterfaces(type).length != 0; }
IType[] superInterfaces= typeHierarchy.getSuperInterfaces(currentType); for (int i= 0; i < superInterfaces.length; i++) { IType superInterface= superInterfaces[i];
protected final boolean isAnonymousFromInterface(IType type) { return isAnonymous(type) && fTypeHierarchy.getHierarchy().getSuperInterfaces(type).length != 0; }
protected final boolean isAnonymousFromInterface(IType type) { return isAnonymous(type) && fTypeHierarchy.getHierarchy().getSuperInterfaces(type).length != 0; }
public Set/*<IType>*/ getDirectSuperTypes(IType type){ Set/*<IType>*/ result= new HashSet(); final IType superclass= fHierarchy.getSuperclass(type); if (superclass != null) { result.add(superclass); } IType[] superInterface= fHierarchy.getSuperInterfaces(type); for (int i=0; i < superInterface.length; i++){ result.add(superInterface[i]); } try { if (type.isInterface()) { IType found= type.getJavaProject().findType("java.lang.Object"); //$NON-NLS-1$ result.add(found); } } catch (JavaModelException exception) { JavaPlugin.log(exception); } return result; }
public Set<IType> getDirectSuperTypes(IType type){ Set<IType> result= new HashSet<>(); final IType superclass= fHierarchy.getSuperclass(type); if (superclass != null) { result.add(superclass); } IType[] superInterface= fHierarchy.getSuperInterfaces(type); for (int i=0; i < superInterface.length; i++){ result.add(superInterface[i]); } try { if (type.isInterface()) { IType found= type.getJavaProject().findType("java.lang.Object"); //$NON-NLS-1$ result.add(found); } } catch (JavaModelException exception) { JavaPlugin.log(exception); } return result; }
public Set<IType> getDirectSuperTypes(IType type){ Set<IType> result= new HashSet<>(); final IType superclass= fHierarchy.getSuperclass(type); if (superclass != null) { result.add(superclass); } IType[] superInterface= fHierarchy.getSuperInterfaces(type); for (int i=0; i < superInterface.length; i++){ result.add(superInterface[i]); } try { if (type.isInterface()) { IType found= type.getJavaProject().findType("java.lang.Object"); //$NON-NLS-1$ result.add(found); } } catch (JavaModelException exception) { JavaPlugin.log(exception); } return result; }
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; } 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; }
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; } 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; }
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; } 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; }
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; } 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; }
res.add(input); } else if (isAnonymousFromInterface(input)) { res.add(hierarchy.getSuperInterfaces(input)[0]); } else { IType[] roots= hierarchy.getRootClasses();
res.add(input); } else if (isAnonymousFromInterface(input)) { res.add(hierarchy.getSuperInterfaces(input)[0]); } else { IType[] roots= hierarchy.getRootClasses();
res.add(input); } else if (isAnonymousFromInterface(input)) { res.add(hierarchy.getSuperInterfaces(input)[0]); } else { IType[] roots= hierarchy.getRootClasses();
/** * Finds the directly overridden method in a type and its super types. First the super class is examined and then the implemented interfaces. * With generics it is possible that 2 methods in the same type are overidden at the same time. In that case, the first overridden method found is returned. * @param type The type to find methods in * @param overriding The overriding method * @return The first overridden method or <code>null</code> if no method is overridden * @throws JavaModelException if a problem occurs */ public IMethod findOverriddenMethodInHierarchy(IType type, IMethod overriding) throws JavaModelException { IMethod method= findOverriddenMethodInType(type, overriding); if (method != null) { return method; } IType superClass= fHierarchy.getSuperclass(type); if (superClass != null) { IMethod res= findOverriddenMethodInHierarchy(superClass, overriding); if (res != null) { return res; } } IType[] superInterfaces= fHierarchy.getSuperInterfaces(type); for (int i= 0; i < superInterfaces.length; i++) { IMethod res= findOverriddenMethodInHierarchy(superInterfaces[i], overriding); if (res != null) { return res; } } return method; }
IType[] superInterfaces= hierarchy.getSuperInterfaces(type); for (int i= 0; i < superInterfaces.length; i++) { IMethod res= findMethodInHierarchy(hierarchy, superInterfaces[i], name, paramTypes, false);
/** * Finds the directly overridden method in a type and its super types. First the super class is examined and then the implemented interfaces. * With generics it is possible that 2 methods in the same type are overidden at the same time. In that case, the first overridden method found is returned. * @param type The type to find methods in * @param overriding The overriding method * @return The first overridden method or <code>null</code> if no method is overridden * @throws JavaModelException if a problem occurs */ public IMethod findOverriddenMethodInHierarchy(IType type, IMethod overriding) throws JavaModelException { IMethod method= findOverriddenMethodInType(type, overriding); if (method != null) { return method; } IType superClass= fHierarchy.getSuperclass(type); if (superClass != null) { IMethod res= findOverriddenMethodInHierarchy(superClass, overriding); if (res != null) { return res; } } IType[] superInterfaces= fHierarchy.getSuperInterfaces(type); for (int i= 0; i < superInterfaces.length; i++) { IMethod res= findOverriddenMethodInHierarchy(superInterfaces[i], overriding); if (res != null) { return res; } } return method; }
IType[] superInterfaces= fHierarchy.getSuperInterfaces(type); for (int i= 0; i < superInterfaces.length; i++) { IMethod res= findOverriddenMethodInHierarchy(superInterfaces[i], overriding);
IType[] interfaces= fHierarchy.getSuperInterfaces(type); for (int i= 0; i < interfaces.length; i++) { IMethod res= findOverriddenMethodInHierarchy(interfaces[i], overriding);
IType[] interfaces= fHierarchy.getSuperInterfaces(type); for (int i= 0; i < interfaces.length; i++) { IMethod res= findOverriddenMethodInHierarchy(interfaces[i], overriding);