@Override public boolean matches(final INode other, final Match match) { if (other instanceof InvocationExpression) { final InvocationExpression otherExpression = (InvocationExpression) other; return getTarget().matches(otherExpression.getTarget(), match) && getArguments().matches(otherExpression.getArguments(), match); } return false; } }
@Override public boolean matches(final INode other, final Match match) { if (other instanceof InvocationExpression) { final InvocationExpression otherExpression = (InvocationExpression) other; return getTarget().matches(otherExpression.getTarget(), match) && getArguments().matches(otherExpression.getArguments(), match); } return false; } }
@Override public boolean matches(final INode other, final Match match) { if (other instanceof InvocationExpression) { final InvocationExpression otherExpression = (InvocationExpression) other; return getTarget().matches(otherExpression.getTarget(), match) && getArguments().matches(otherExpression.getArguments(), match); } return false; } }
@Override public Void visitInvocationExpression(final InvocationExpression node, final Void data) { super.visitInvocationExpression(node, data); if (node.getArguments().size() == 1 && node.getTarget() instanceof MemberReferenceExpression) { removeBoxing(node); } else { removeUnboxing(node); } return null; }
@Override public Void visitInvocationExpression(final InvocationExpression node, final Void data) { super.visitInvocationExpression(node, data); if (node.getArguments().size() == 1 && node.getTarget() instanceof MemberReferenceExpression) { removeBoxing(node); } else { removeUnboxing(node); } return null; }
@Override public Void visitInvocationExpression(final InvocationExpression node, final Void data) { super.visitInvocationExpression(node, data); if (node.getArguments().size() == 1 && node.getTarget() instanceof MemberReferenceExpression) { removeBoxing(node); } else { removeUnboxing(node); } return null; }
@Override public Void visitInvocationExpression(final InvocationExpression node, final Void ignored) { startNode(node); node.getTarget().acceptVisitor(this, null); space(policy.SpaceBeforeMethodCallParentheses); writeCommaSeparatedListInParenthesis(node.getArguments(), policy.SpaceWithinMethodCallParentheses); endNode(node); return null; }
@Override public Void visitInvocationExpression(final InvocationExpression node, final Void ignored) { startNode(node); node.getTarget().acceptVisitor(this, null); space(policy.SpaceBeforeMethodCallParentheses); writeCommaSeparatedListInParenthesis(node.getArguments(), policy.SpaceWithinMethodCallParentheses); endNode(node); return null; }
@Override public Void visitInvocationExpression(final InvocationExpression node, final Void ignored) { startNode(node); node.getTarget().acceptVisitor(this, null); space(policy.SpaceBeforeMethodCallParentheses); writeCommaSeparatedListInParenthesis(node.getArguments(), policy.SpaceWithinMethodCallParentheses); endNode(node); return null; }
final AstNodeCollection<Expression> arguments = ((InvocationExpression) parent).getArguments(); !(parent.getParent() instanceof ExpressionStatement) && StringUtilities.equals(((MemberReferenceExpression) current).getMemberName(), "toString") && ((InvocationExpression) parent).getArguments().isEmpty()) {
final AstNodeCollection<Expression> arguments = ((InvocationExpression) parent).getArguments(); !(parent.getParent() instanceof ExpressionStatement) && StringUtilities.equals(((MemberReferenceExpression) current).getMemberName(), "toString") && ((InvocationExpression) parent).getArguments().isEmpty()) {
final AstNodeCollection<Expression> arguments = ((InvocationExpression) parent).getArguments(); !(parent.getParent() instanceof ExpressionStatement) && StringUtilities.equals(((MemberReferenceExpression) current).getMemberName(), "toString") && ((InvocationExpression) parent).getArguments().isEmpty()) {
final AstNodeCollection<Expression> arguments = node.getArguments();
final AstNodeCollection<Expression> arguments = node.getArguments();
final AstNodeCollection<Expression> arguments = node.getArguments();
@Override @SuppressWarnings("ConstantConditions") public Void visitSuperReferenceExpression(final SuperReferenceExpression node, final Void data) { super.visitSuperReferenceExpression(node, data); if (node.getParent() instanceof InvocationExpression) { final InvocationExpression parent = (InvocationExpression) node.getParent(); if (!parent.getArguments().isEmpty()) { final Expression firstArgument = parent.getArguments().firstOrNullObject(); final ResolveResult resolvedArgument = _resolver.apply(firstArgument); if (resolvedArgument != null) { final TypeReference superType = node.getUserData(Keys.TYPE_REFERENCE); final TypeReference argumentType = resolvedArgument.getType(); if (superType != null && argumentType != null) { final TypeDefinition resolvedSuperType = superType.resolve(); if (resolvedSuperType != null && resolvedSuperType.isInnerClass() && !resolvedSuperType.isStatic() && isEnclosedBy(context.getCurrentType(), argumentType)) { firstArgument.remove(); if (!(firstArgument instanceof ThisReferenceExpression)) { node.setTarget(firstArgument); } } } } } } return null; }
@Override @SuppressWarnings("ConstantConditions") public Void visitSuperReferenceExpression(final SuperReferenceExpression node, final Void data) { super.visitSuperReferenceExpression(node, data); if (node.getParent() instanceof InvocationExpression) { final InvocationExpression parent = (InvocationExpression) node.getParent(); if (!parent.getArguments().isEmpty()) { final Expression firstArgument = parent.getArguments().firstOrNullObject(); final ResolveResult resolvedArgument = _resolver.apply(firstArgument); if (resolvedArgument != null) { final TypeReference superType = node.getUserData(Keys.TYPE_REFERENCE); final TypeReference argumentType = resolvedArgument.getType(); if (superType != null && argumentType != null) { final TypeDefinition resolvedSuperType = superType.resolve(); if (resolvedSuperType != null && resolvedSuperType.isInnerClass() && !resolvedSuperType.isStatic() && isEnclosedBy(context.getCurrentType(), argumentType)) { firstArgument.remove(); if (!(firstArgument instanceof ThisReferenceExpression)) { node.setTarget(firstArgument); } } } } } } return null; }
@Override @SuppressWarnings("ConstantConditions") public Void visitSuperReferenceExpression(final SuperReferenceExpression node, final Void data) { super.visitSuperReferenceExpression(node, data); if (node.getParent() instanceof InvocationExpression) { final InvocationExpression parent = (InvocationExpression) node.getParent(); if (!parent.getArguments().isEmpty()) { final Expression firstArgument = parent.getArguments().firstOrNullObject(); final ResolveResult resolvedArgument = _resolver.apply(firstArgument); if (resolvedArgument != null) { final TypeReference superType = node.getUserData(Keys.TYPE_REFERENCE); final TypeReference argumentType = resolvedArgument.getType(); if (superType != null && argumentType != null) { final TypeDefinition resolvedSuperType = superType.resolve(); if (resolvedSuperType != null && resolvedSuperType.isInnerClass() && !resolvedSuperType.isStatic() && isEnclosedBy(context.getCurrentType(), argumentType)) { firstArgument.remove(); if (!(firstArgument instanceof ThisReferenceExpression)) { node.setTarget(firstArgument); } } } } } } return null; }
final AstNodeCollection<Expression> arguments = node.getArguments(); final Expression underlyingValue = arguments.firstOrNullObject(); final ResolveResult valueResult = _resolver.apply(underlyingValue);
final AstNodeCollection<Expression> arguments = node.getArguments(); final Expression underlyingValue = arguments.firstOrNullObject(); final ResolveResult valueResult = _resolver.apply(underlyingValue);