private static boolean isDeclaredException(ITypeBinding curr, ITypeBinding[] declared) { for (int i= 0; i < declared.length; i++) { if (Bindings.isSuperType(declared[i], curr)) { return true; } } return false; }
private static boolean isDeclaredException(ITypeBinding curr, ITypeBinding[] declared) { for (int i= 0; i < declared.length; i++) { if (Bindings.isSuperType(declared[i], curr)) { return true; } } return false; }
private static boolean isDeclaredException(ITypeBinding curr, ITypeBinding[] declared) { for (int i= 0; i < declared.length; i++) { if (Bindings.isSuperType(declared[i], curr)) { return true; } } return false; }
private static boolean isDeclaredException(ITypeBinding curr, ITypeBinding[] declared) { for (int i= 0; i < declared.length; i++) { if (Bindings.isSuperType(declared[i], curr)) { return true; } } return false; }
private static boolean isNotYetThrown(ITypeBinding binding, List<Type> thrownExceptions) { for (Type thrownException : thrownExceptions) { ITypeBinding elem = thrownException.resolveBinding(); if (elem != null) { if (Bindings.isSuperType(elem, binding)) { // existing exception is base class of new return false; } } } return true; }
private static boolean isNotYetThrown(ITypeBinding binding, List thrownExcpetions) { for (int i= 0; i < thrownExcpetions.size(); i++) { Name name= (Name) thrownExcpetions.get(i); ITypeBinding elem= (ITypeBinding) name.resolveBinding(); if (elem != null) { if (Bindings.isSuperType(elem, binding)) { // existing exception is base class of new return false; } } } return true; }
private static boolean containsASuperType(ITypeBinding type, Set declaringSuperTypes) { for (Iterator iter= declaringSuperTypes.iterator(); iter.hasNext();) { ITypeBinding maybeSuperType= (ITypeBinding) iter.next(); if (! Bindings.equals(maybeSuperType, type) && Bindings.isSuperType(maybeSuperType, type)) return true; } return false; }
private static boolean containsASuperType(ITypeBinding type, Set<ITypeBinding> declaringSuperTypes) { for (Iterator<ITypeBinding> iter= declaringSuperTypes.iterator(); iter.hasNext();) { ITypeBinding maybeSuperType= iter.next(); if (! Bindings.equals(maybeSuperType, type) && Bindings.isSuperType(maybeSuperType, type)) return true; } return false; }
private static boolean containsASuperType(ITypeBinding type, Set<ITypeBinding> declaringSuperTypes) { for (Iterator<ITypeBinding> iter= declaringSuperTypes.iterator(); iter.hasNext();) { ITypeBinding maybeSuperType= iter.next(); if (! Bindings.equals(maybeSuperType, type) && Bindings.isSuperType(maybeSuperType, type)) return true; } return false; }
private static boolean isNotYetThrown(ITypeBinding binding, List<Type> thrownExceptions) { for (int i= 0; i < thrownExceptions.size(); i++) { Type name= thrownExceptions.get(i); ITypeBinding elem= name.resolveBinding(); if (elem != null) { if (Bindings.isSuperType(elem, binding)) { // existing exception is base class of new return false; } } } return true; }
private static boolean isTypeInScope(ITypeBinding declaring, ITypeBinding context, boolean includeHierarchy) { ITypeBinding curr= context; while (curr != null && curr != declaring) { if (includeHierarchy && Bindings.isSuperType(declaring, curr)) { return true; } curr= curr.getDeclaringClass(); } return curr == declaring; }
private static boolean isNotYetThrown(ITypeBinding binding, List<Type> thrownExceptions) { for (int i= 0; i < thrownExceptions.size(); i++) { Type name= thrownExceptions.get(i); ITypeBinding elem= name.resolveBinding(); if (elem != null) { if (Bindings.isSuperType(elem, binding)) { // existing exception is base class of new return false; } } } return true; }
private boolean isAccessToOuter(ITypeBinding binding) { binding= binding.getTypeDeclaration(); if (Bindings.isSuperType(binding, fCurrentType, false)) { return false; } ITypeBinding outer= fCurrentType.getDeclaringClass(); while (outer != null) { if (Bindings.isSuperType(binding, outer, false)) { return true; } outer= outer.getDeclaringClass(); } return false; }
private boolean isAccessToOuter(ITypeBinding binding) { binding= binding.getTypeDeclaration(); if (Bindings.isSuperType(binding, fCurrentType, false)) { return false; } ITypeBinding outer= fCurrentType.getDeclaringClass(); while (outer != null) { if (Bindings.isSuperType(binding, outer, false)) { return true; } outer= outer.getDeclaringClass(); } return false; }
private static int getNeededVisibility(ASTNode currNode, ITypeBinding targetType) { ITypeBinding currNodeBinding= Bindings.getBindingOfParentType(currNode); if (currNodeBinding == null) { // import return Modifier.PUBLIC; } if (Bindings.isSuperType(targetType, currNodeBinding)) { return Modifier.PROTECTED; } if (currNodeBinding.getPackage().getKey().equals(targetType.getPackage().getKey())) { return 0; } return Modifier.PUBLIC; }
@Override public boolean visit(MethodInvocation node) { IMethodBinding binding = node.resolveMethodBinding(); if (binding != null && !JdtFlags.isStatic(binding) && node.getExpression() == null && Bindings.isSuperType(binding.getDeclaringClass(), fFunctionalInterface, false)) { throw new AbortSearchException(); } return true; } }
@Override public boolean visit(MethodInvocation node) { IMethodBinding binding= node.resolveMethodBinding(); if (binding != null && !JdtFlags.isStatic(binding) && node.getExpression() == null && Bindings.isSuperType(binding.getDeclaringClass(), fFunctionalInterface, false)) throw new AbortSearchException(); return true; } }
@Override public boolean visit(MethodInvocation node) { IMethodBinding binding= node.resolveMethodBinding(); if (binding != null && !JdtFlags.isStatic(binding) && node.getExpression() == null && Bindings.isSuperType(binding.getDeclaringClass(), fFunctionalInterface, false)) throw new AbortSearchException(); return true; } }
public boolean consumes(SemanticToken token) { SimpleName node= token.getNode(); if (node.isDeclaration()) return false; IBinding binding= token.getBinding(); if (binding == null || binding.getKind() != IBinding.METHOD) return false; ITypeBinding currentType= Bindings.getBindingOfParentType(node); ITypeBinding declaringType= ((IMethodBinding) binding).getDeclaringClass(); if (currentType == declaringType || currentType == null) return false; return Bindings.isSuperType(declaringType, currentType); } }
@Override public boolean consumes(SemanticToken token) { SimpleName node= token.getNode(); if (node.isDeclaration()) return false; IBinding binding= token.getBinding(); if (binding == null || binding.getKind() != IBinding.METHOD) return false; ITypeBinding currentType= Bindings.getBindingOfParentType(node); ITypeBinding declaringType= ((IMethodBinding) binding).getDeclaringClass(); if (currentType == declaringType || currentType == null) return false; return Bindings.isSuperType(declaringType, currentType); } }