@Override public boolean visit(MethodInvocation node) { Expression exp = node.getExpression(); if (exp != null) { fIgnore.add(node.getName()); } return true; }
@Override public boolean visit(MethodInvocation node) { Expression exp= node.getExpression(); if (exp != null) fIgnore.add(node.getName()); return true; } @Override
@Override public boolean visit(MethodInvocation node) { if (fTypeCounter == 0) { Expression receiver= node.getExpression(); if (receiver == null && !isStaticallyImported(node.getName())) { fImplicitReceivers.add(node); } } return true; } @Override
public boolean isEnumNameMethodInvocation (MethodInvocation node) { return node.getName().getIdentifier().equals("name") && node.getExpression() != null && node.getExpression().resolveTypeBinding().isEnum(); }
public boolean isEnumOrdinalMethodInvocation (MethodInvocation node) { return node.getName().getIdentifier().equals("ordinal") && node.getExpression() != null && node.getExpression().resolveTypeBinding().isEnum(); }
public boolean visit(MethodInvocation invocation) { if (invocation.getExpression() == null) qualifyUnqualifiedMemberNameIfNecessary(invocation.getName()); else invocation.getExpression().accept(this); for (Iterator it= invocation.arguments().iterator(); it.hasNext();) ((Expression) it.next()).accept(this); return false; }
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; }
@Override public boolean visit(MethodInvocation node) { if(node.getExpression() == null) { visitName(node.getName()); } else { fResult&= new LoadTimeConstantChecker((IExpressionFragment) ASTFragmentFactory.createFragmentForFullSubtree(node.getExpression())).check(); } return false; } @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.getExpression() == null) { visitName(node.getName()); } else { fResult &= new LoadTimeConstantChecker((IExpressionFragment) ASTFragmentFactory.createFragmentForFullSubtree(node.getExpression())).check(); } return false; }
@Override public void rewriteAST(CompilationUnitRewrite cuRewrite, LinkedProposalModel model) throws CoreException { ASTRewrite rewrite= cuRewrite.getASTRewrite(); TextEditGroup group= createTextEditGroup(FixMessages.CodeStyleFix_removeThis_groupDescription, cuRewrite); rewrite.remove(node.getExpression(), group); } });
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; }
private void processMappedEventSubscription(MethodInvocation node) { final MethodInvocation event = (MethodInvocation) node.getExpression(); final String eventArgsType = _configuration.mappedEvent(qualifiedName(event)); final String eventHandlerType = buildEventHandlerTypeName(node, eventArgsType); mapEventSubscription(node, eventArgsType, eventHandlerType); }
@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 int treeSize() { return memSize() + (this.optionalExpression == null ? 0 : getExpression().treeSize()) + (this.typeArguments == null ? 0 : this.typeArguments.listSize()) + (this.methodName == null ? 0 : getName().treeSize()) + (this.arguments == null ? 0 : this.arguments.listSize()); } }
ASTNode clone0(AST target) { MethodInvocation result = new MethodInvocation(target); result.setSourceRange(getStartPosition(), getLength()); result.setName((SimpleName) getName().clone(target)); result.setExpression( (Expression) ASTNode.copySubtree(target, getExpression())); if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.typeArguments().addAll(ASTNode.copySubtrees(target, typeArguments())); } result.arguments().addAll(ASTNode.copySubtrees(target, arguments())); return result; }
ASTNode clone0(AST target) { MethodInvocation result = new MethodInvocation(target); result.setSourceRange(getStartPosition(), getLength()); result.setName((SimpleName) getName().clone(target)); result.setExpression( (Expression) ASTNode.copySubtree(target, getExpression())); if (this.ast.apiLevel >= AST.JLS3) { result.typeArguments().addAll(ASTNode.copySubtrees(target, typeArguments())); } result.arguments().addAll(ASTNode.copySubtrees(target, arguments())); return result; }
ASTNode clone0(AST target) { MethodInvocation result = new MethodInvocation(target); result.setSourceRange(getStartPosition(), getLength()); result.setName((SimpleName) getName().clone(target)); result.setExpression( (Expression) ASTNode.copySubtree(target, getExpression())); if (this.ast.apiLevel >= AST.JLS3_INTERNAL) { result.typeArguments().addAll(ASTNode.copySubtrees(target, typeArguments())); } result.arguments().addAll(ASTNode.copySubtrees(target, arguments())); return result; }
private void processMacroInvocation(MethodInvocation node) { final MethodDeclaration declaration = (MethodDeclaration)declaringNode(node.resolveMethodBinding()); final TagElement macro = effectiveAnnotationFor(declaration, SharpenAnnotations.SHARPEN_MACRO); final CSMacro code = new CSMacro(JavadocUtility.singleTextFragmentFrom(macro)); code.addVariable("expression", mapExpression(node.getExpression())); code.addVariable("arguments", mapExpressions(node.arguments())); pushExpression(new CSMacroExpression(code)); }