public ITypeBinding anonymousBaseType() { ITypeBinding binding = nestedTypeBinding(); return binding.getInterfaces().length > 0 ? binding.getInterfaces()[0] : binding.getSuperclass(); }
private void collectInterfaces(Set<ITypeBinding> interfaceList, ITypeBinding binding) { ITypeBinding[] interfaces = binding.getInterfaces(); for (int i = 0; i < interfaces.length; ++i) { ITypeBinding interfaceBinding = interfaces[i]; if (interfaceList.contains(interfaceBinding)) { continue; } collectInterfaces(interfaceList, interfaceBinding); interfaceList.add(interfaceBinding); } }
ITypeBinding mapTypeParameterExtendedType (ITypeBinding tb) { ITypeBinding superc = tb.getSuperclass(); if (superc != null && !superc.getQualifiedName().equals("java.lang.Object") && !superc.getQualifiedName().equals("java.lang.Enum<?>")) { return superc; } ITypeBinding[] ints = tb.getInterfaces(); if (ints.length > 0) return ints[0]; return null; }
private ITypeBinding getSuperTypeBinding() { ITypeBinding types= fAnonymousInnerClassNode.resolveBinding(); ITypeBinding[] interfaces= types.getInterfaces(); if (interfaces.length > 0) return interfaces[0]; else return types.getSuperclass(); }
private ITypeBinding getSuperTypeBinding() { ITypeBinding types= fAnonymousInnerClassNode.resolveBinding(); ITypeBinding[] interfaces= types.getInterfaces(); if (interfaces.length > 0) return interfaces[0]; else return types.getSuperclass(); }
private void buildSuperTypes() { // TODO this is a source entity, but it might actually be the root type // (Object), so assume # intfs + 1 ITypeBinding superType = (fType.getSuperclass() == null) ? fAst.resolveWellKnownType("java.lang.Object") : fType .getSuperclass(); int N = fType.getInterfaces().length + 1; fSuperTypes = new ArrayList<>(N); // Following assumes that noone can call getSupertypes() before we have // created CAstType's for every type in the program being analyzed. fSuperTypes.add(getCAstTypeFor(superType)); for (ITypeBinding t : fType.getInterfaces()) fSuperTypes.add(getCAstTypeFor(t)); }
private ITypeBinding getSuperTypeBinding() { ITypeBinding types= fAnonymousInnerClassNode.resolveBinding(); ITypeBinding[] interfaces= types.getInterfaces(); if (interfaces.length > 0) return interfaces[0]; else return types.getSuperclass(); }
public boolean visit(TypeDeclaration typeDeclaration) { ITypeBinding typeBind = typeDeclaration.resolveBinding(); ITypeBinding superTypeBind = typeBind.getSuperclass(); ITypeBinding[] interfaceBinds = typeBind.getInterfaces(); return true; }
private static void collectSuperTypes(ITypeBinding curr, Set<ITypeBinding> collection) { if (collection.add(curr)) { ITypeBinding[] interfaces= curr.getInterfaces(); for (int i= 0; i < interfaces.length; i++) { collectSuperTypes(interfaces[i], collection); } ITypeBinding superClass= curr.getSuperclass(); if (superClass != null) { collectSuperTypes(superClass, collection); } } }
private static void collectSuperTypes(ITypeBinding curr, Set<ITypeBinding> collection) { if (collection.add(curr)) { ITypeBinding[] interfaces= curr.getInterfaces(); for (int i= 0; i < interfaces.length; i++) { collectSuperTypes(interfaces[i], collection); } ITypeBinding superClass= curr.getSuperclass(); if (superClass != null) { collectSuperTypes(superClass, collection); } } }
private static void collectSuperTypes(ITypeBinding curr, Set collection) { if (collection.add(curr)) { ITypeBinding[] interfaces= curr.getInterfaces(); for (int i= 0; i < interfaces.length; i++) { collectSuperTypes(interfaces[i], collection); } ITypeBinding superClass= curr.getSuperclass(); if (superClass != null) { collectSuperTypes(superClass, collection); } } }
private void collectSuperTypes(ITypeBinding curr, List<ITypeBinding> list) { if (list.add(curr.getTypeDeclaration())) { ITypeBinding[] interfaces= curr.getInterfaces(); for (int i= 0; i < interfaces.length; i++) { collectSuperTypes(interfaces[i], list); } ITypeBinding superClass= curr.getSuperclass(); if (superClass != null) { collectSuperTypes(superClass, list); } } }
private void collectSuperTypes(ITypeBinding curr, List list) { if (list.add(curr.getTypeDeclaration())) { ITypeBinding[] interfaces= curr.getInterfaces(); for (int i= 0; i < interfaces.length; i++) { collectSuperTypes(interfaces[i], list); } ITypeBinding superClass= curr.getSuperclass(); if (superClass != null) { collectSuperTypes(superClass, list); } } }
private void collectSuperTypes(ITypeBinding curr, List<ITypeBinding> list) { if (list.add(curr.getTypeDeclaration())) { ITypeBinding[] interfaces= curr.getInterfaces(); for (int i= 0; i < interfaces.length; i++) { collectSuperTypes(interfaces[i], list); } ITypeBinding superClass= curr.getSuperclass(); if (superClass != null) { collectSuperTypes(superClass, list); } } }
private static void findOverridenMethods(IMethodBinding overridingMethod, Set<IMethodBinding> results, ITypeBinding declaringClass) { final ITypeBinding superclass = declaringClass.getSuperclass(); if (superclass != null && !addOverridenMethods(overridingMethod, superclass, results)) { findOverridenMethods(overridingMethod, results, superclass); } for (ITypeBinding itf : declaringClass.getInterfaces()) { if (!addOverridenMethods(overridingMethod, itf, results)) { findOverridenMethods(overridingMethod, results, itf); } } }
public boolean visit(TypeDeclaration node) { ITypeBinding type = node.resolveBinding(); ITypeBinding binding = type.getSuperclass(); if (binding != null) coupleTo(binding); for (ITypeBinding interfaces : type.getInterfaces()) { coupleTo(interfaces); } return super.visit(node); }
private static void getOverridableMethods(AST ast, ITypeBinding superBinding, List allMethods) { IMethodBinding[] methods= superBinding.getDeclaredMethods(); for (int offset= 0; offset < methods.length; offset++) { final int modifiers= methods[offset].getModifiers(); if (!methods[offset].isConstructor() && !Modifier.isStatic(modifiers) && !Modifier.isPrivate(modifiers)) { if (findOverridingMethod(methods[offset], allMethods) == null && !Modifier.isStatic(modifiers)) allMethods.add(methods[offset]); } } ITypeBinding[] superInterfaces= superBinding.getInterfaces(); for (int index= 0; index < superInterfaces.length; index++) { getOverridableMethods(ast, superInterfaces[index], allMethods); } }
public void checkInput(RefactoringStatus status, String methodName, ASTNode destination) { ITypeBinding[] arguments = getArgumentTypes(); ITypeBinding type = ASTNodes.getEnclosingType(destination); status.merge(Checks.checkMethodInType(type, methodName, arguments)); ITypeBinding superClass = type.getSuperclass(); if (superClass != null) { status.merge(Checks.checkMethodInHierarchy(superClass, methodName, null, arguments)); } for (ITypeBinding superInterface : type.getInterfaces()) { status.merge(Checks.checkMethodInHierarchy(superInterface, methodName, null, arguments)); } }
public void checkInput(RefactoringStatus status, String methodName, ASTNode destination) { ITypeBinding[] arguments= getArgumentTypes(); ITypeBinding type= ASTNodes.getEnclosingType(destination); status.merge(Checks.checkMethodInType(type, methodName, arguments)); ITypeBinding superClass= type.getSuperclass(); if (superClass != null) { status.merge(Checks.checkMethodInHierarchy(superClass, methodName, null, arguments)); } for (ITypeBinding superInterface : type.getInterfaces()) { status.merge(Checks.checkMethodInHierarchy(superInterface, methodName, null, arguments)); } }
public void checkInput(RefactoringStatus status, String methodName, ASTNode destination) { ITypeBinding[] arguments= getArgumentTypes(); ITypeBinding type= ASTNodes.getEnclosingType(destination); status.merge(Checks.checkMethodInType(type, methodName, arguments)); ITypeBinding superClass= type.getSuperclass(); if (superClass != null) { status.merge(Checks.checkMethodInHierarchy(superClass, methodName, null, arguments)); } for (ITypeBinding superInterface : type.getInterfaces()) { status.merge(Checks.checkMethodInHierarchy(superInterface, methodName, null, arguments)); } }