private static boolean isStatic(MethodInvocation invocation) { IMethodBinding methodBinding= invocation.resolveMethodBinding(); if (methodBinding == null) return false; return JdtFlags.isStatic(methodBinding); }
private static boolean isStatic(MethodInvocation invocation) { IMethodBinding methodBinding= invocation.resolveMethodBinding(); if (methodBinding == null) return false; return JdtFlags.isStatic(methodBinding); }
@Override public boolean visit(MethodInvocation node) { if (!isSelected(node)) { return false; } return handleExceptions(node.resolveMethodBinding(), node); }
private boolean isRemovedMethodInvocation(Expression expression) { if (!(expression instanceof MethodInvocation)) { return false; } MethodInvocation invocation = (MethodInvocation) expression; return isTaggedMethodInvocation(invocation, SharpenAnnotations.SHARPEN_REMOVE) || isRemoved(invocation.resolveMethodBinding()); }
@Override public boolean visit(MethodInvocation node) { if (!isSelected(node)) return false; return handleExceptions(node.resolveMethodBinding(), node); }
@Override public boolean visit(MethodInvocation node) { if (fTargetIsStaticMethodImport) { return !addPossibleStaticImport(node.getName(), node.resolveMethodBinding()); } return true; }
private ITypeBinding getExpressionType(MethodInvocation invocation) { Expression expression= invocation.getExpression(); ITypeBinding typeBinding= null; if (expression == null) { typeBinding= invocation.resolveMethodBinding().getDeclaringClass(); } else { typeBinding= expression.resolveTypeBinding(); } Assert.isNotNull(typeBinding, "Type binding of target expression may not be null"); //$NON-NLS-1$ return typeBinding; }
public final boolean visit(final MethodInvocation node) { Assert.isNotNull(node); if (fAnonymousClass > 0) { final IMethodBinding binding= node.resolveMethodBinding(); if (binding != null) { if (node.getExpression() == null && !Modifier.isStatic(binding.getModifiers())) fResult.add(node.getName()); } } return true; }
@Override public final boolean visit(final MethodInvocation node) { Assert.isNotNull(node); if (fAnonymousClass > 0) { final IMethodBinding binding= node.resolveMethodBinding(); if (binding != null) { if (node.getExpression() == null && !Modifier.isStatic(binding.getModifiers())) fResult.add(node.getName()); } } return true; }
@Override public boolean visit(MethodInvocation node) { if (node.resolveTypeBinding() != null && matches(node.resolveMethodBinding()) && fCurrent != null) { fCurrent.addInvocation(node); } return true; } @Override
private String resolveTargetMethodName(CSExpression targetExpression, MethodInvocation node) { final IMethodBinding method = staticImportMethodBinding(node.getName(), _ast.imports()); if(method != null && targetExpression == null){ return mappedTypeName(method.getDeclaringClass()) + "." + mappedMethodName(node.resolveMethodBinding()); } return mappedMethodName(node.resolveMethodBinding()); }
@Override public final boolean visit(final MethodInvocation node) { Assert.isNotNull(node); final IMethodBinding binding= node.resolveMethodBinding(); if (binding != null && !JdtFlags.isStatic(binding) && node.getExpression() == null) { fResult.add(node); fStatus.merge(RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.MoveInstanceMethodProcessor_this_reference, JavaStatusContext.create(fMethod.getCompilationUnit(), node))); } return true; }
@Override public boolean visit(MethodInvocation node) { if (isExitPoint(node.resolveMethodBinding())) { SimpleName name= node.getName(); fResult.add(new OccurrenceLocation(name.getStartPosition(), name.getLength(), 0, fExitDescription)); } return true; }
public static IMethodBinding staticImportMethodBinding(SimpleName node, List imports) { if (node.getLocationInParent() != MethodInvocation.NAME_PROPERTY) return null; final MethodInvocation invocation = parentMethodInvocation(node); if (invocation.getExpression() != null) return null; final IMethodBinding method = invocation.resolveMethodBinding(); if (!isStaticImport(method, imports)) return null; return method; }
public boolean visit(MethodInvocation node) { IMethodBinding binding = originalMethodBinding(node.resolveMethodBinding()); Configuration.MemberMapping mapping = mappingForInvocation(node, binding); if (null != mapping) { processMappedMethodInvocation(node, binding, mapping); } else { processUnmappedMethodInvocation(node); } return false; }
public boolean visit(MethodInvocation node) { IMethodBinding binding= node.resolveMethodBinding(); if (binding != null) { binding= binding.getMethodDeclaration(); if (isMovedMember(binding)) rewrite(node, fTarget); } return super.visit(node); }
@Override public boolean visit(MethodInvocation node) { IMethodBinding binding= node.resolveMethodBinding(); if (binding != null) { binding= binding.getMethodDeclaration(); if (isMovedMember(binding)) rewrite(node, fTarget); } return super.visit(node); }
@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; } }
private void processRemovedInvocation(MethodInvocation node) { TagElement element = javadocTagFor(declaringNode(node.resolveMethodBinding()), SharpenAnnotations.SHARPEN_REMOVE); String exchangeValue = JavadocUtility.singleTextFragmentFrom(element); pushExpression(new CSReferenceExpression(exchangeValue)); }
@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; } }