private static boolean contains(Collection<ITypeBinding> c, ITypeBinding binding){ for (Iterator<ITypeBinding> it=c.iterator(); it.hasNext(); ){ ITypeBinding b = it.next(); if (Bindings.equals(b, binding)) return true; } return false; }
protected boolean isStaticAccess(Expression exp, ITypeBinding type) { if (!(exp instanceof Name)) return false; return Bindings.equals(type, ((Name)exp).resolveBinding()); }
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 boolean addWrite(Name node, IBinding binding) { if (binding != null && Bindings.equals(getBindingDeclaration(binding), fTarget)) { fWriteUsages.add(node); return true; } return false; }
protected boolean isStaticAccess(Expression exp, ITypeBinding type) { if (!(exp instanceof Name)) return false; return Bindings.equals(type, ((Name)exp).resolveBinding()); }
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; }
public boolean visit(SimpleName node) { if(!fResult) { fResult= Bindings.equals(fBinding, node.resolveBinding()); } return false; } }
public boolean returnTypeMatchesReturnExpressions() { ITypeBinding returnType= getReturnType(); for (Iterator<Expression> iter= fReturnExpressions.iterator(); iter.hasNext();) { Expression expression= iter.next(); if (!Bindings.equals(returnType, expression.resolveTypeBinding())) return false; } return true; }
public boolean returnTypeMatchesReturnExpressions() { ITypeBinding returnType= getReturnType(); for (Iterator<Expression> iter= fReturnExpressions.iterator(); iter.hasNext();) { Expression expression= iter.next(); if (!Bindings.equals(returnType, expression.resolveTypeBinding())) return false; } return true; }
public boolean returnTypeMatchesReturnExpressions() { ITypeBinding returnType= getReturnType(); for (Iterator iter= fReturnExpressions.iterator(); iter.hasNext();) { Expression expression= (Expression)iter.next(); if (!Bindings.equals(returnType, expression.resolveTypeBinding())) return false; } return true; }
private String getName(IVariableBinding binding) { for (Iterator<ParameterInfo> iter = fParameterInfos.iterator(); iter.hasNext();) { ParameterInfo info = iter.next(); if (Bindings.equals(binding, info.getOldBinding())) { return info.getNewName(); } } return binding.getName(); }
private String getName(IVariableBinding binding) { for (Iterator<ParameterInfo> iter= fParameterInfos.iterator(); iter.hasNext();) { ParameterInfo info= iter.next(); if (Bindings.equals(binding, info.getOldBinding())) { return info.getNewName(); } } return binding.getName(); }
private String getName(IVariableBinding binding) { for (Iterator<ParameterInfo> iter= fParameterInfos.iterator(); iter.hasNext();) { ParameterInfo info= iter.next(); if (Bindings.equals(binding, info.getOldBinding())) { return info.getNewName(); } } return binding.getName(); }
private boolean matches(ITypeBinding exception) { if (exception == null) return false; if (isCaught(exception)) return false; while (exception != null) { if (Bindings.equals(fException, exception)) return true; exception= exception.getSuperclass(); } return false; }
private boolean matches(ITypeBinding exception) { if (exception == null) return false; if (isCaught(exception)) return false; while (exception != null) { if (Bindings.equals(fException, exception)) return true; exception= exception.getSuperclass(); } return false; }
@Override public boolean visit(SimpleName node) { if (fIgnoreBinding != null && Bindings.equals(fIgnoreBinding, node.resolveBinding())) { return false; } if (fIgnoreRange != null && fIgnoreRange.covers(node)) { return false; } fScope.addName(node.getIdentifier()); return false; }
public boolean visit(SimpleName node) { if (fIgnoreBinding != null && Bindings.equals(fIgnoreBinding, node.resolveBinding())) return false; if (fIgnoreRange != null && fIgnoreRange.covers(node)) return false; fScope.addName(node.getIdentifier()); return false; }
public boolean visit(final SimpleType node) { Assert.isNotNull(node); if (!(node.getParent() instanceof ClassInstanceCreation)) { final ITypeBinding binding= node.resolveBinding(); if (binding != null) { final ITypeBinding declaring= binding.getDeclaringClass(); if (declaring != null && !Bindings.equals(declaring, fTypeBinding.getDeclaringClass()) && !Bindings.equals(binding, fTypeBinding) && fSourceRewrite.getRoot().findDeclaringNode(binding) != null && Modifier.isStatic(binding.getModifiers())) addTypeQualification(node, fSourceRewrite, fGroup); } } return super.visit(node); }
public boolean visit(MethodInvocation node) { Expression receiver= node.getExpression(); if (receiver == null) { SimpleName name= node.getName(); if (fIgnoreBinding == null || !Bindings.equals(fIgnoreBinding, name.resolveBinding())) node.getName().accept(this); } else { receiver.accept(this); } accept(node.arguments()); return false; }
public final boolean visit(final SimpleName node) { final ITypeBinding binding= node.resolveTypeBinding(); if (binding != null && binding.isTypeVariable() && Bindings.equals(binding, fBinding) && node.getIdentifier().equals(fName.getIdentifier())) { if (node != fName) { if (fUpdateReferences) fRewrite.getASTRewrite().set(node, SimpleName.IDENTIFIER_PROPERTY, getNewElementName(), fRewrite.createGroupDescription(RefactoringCoreMessages.RenameTypeParameterRefactoring_update_type_parameter_reference)); } else fRewrite.getASTRewrite().set(node, SimpleName.IDENTIFIER_PROPERTY, getNewElementName(), fRewrite.createGroupDescription(RefactoringCoreMessages.RenameTypeParameterRefactoring_update_type_parameter_declaration)); } return true; }