@Override public boolean matches(final INode other, final Match match) { if (other instanceof ObjectCreationExpression) { final ObjectCreationExpression otherExpression = (ObjectCreationExpression) other; return !otherExpression.isNull() && getTarget().matches(otherExpression.getTarget(), match) && getType().matches(otherExpression.getType(), match) && getArguments().matches(otherExpression.getArguments(), match); } return false; } }
@Override public boolean matches(final INode other, final Match match) { if (other instanceof ObjectCreationExpression) { final ObjectCreationExpression otherExpression = (ObjectCreationExpression) other; return !otherExpression.isNull() && getTarget().matches(otherExpression.getTarget(), match) && getType().matches(otherExpression.getType(), match) && getArguments().matches(otherExpression.getArguments(), match); } return false; } }
@Override public boolean matches(final INode other, final Match match) { if (other instanceof ObjectCreationExpression) { final ObjectCreationExpression otherExpression = (ObjectCreationExpression) other; return !otherExpression.isNull() && getTarget().matches(otherExpression.getTarget(), match) && getType().matches(otherExpression.getType(), match) && getArguments().matches(otherExpression.getArguments(), match); } return false; } }
!((ObjectCreationExpression) parent).getTarget().isNull()) {
@Override public Void visitObjectCreationExpression(final ObjectCreationExpression node, final Void ignored) { startNode(node); final Expression target = node.getTarget(); if (target != null && !target.isNull()) { target.acceptVisitor(this, ignored); writeToken(Roles.DOT); } writeKeyword(ObjectCreationExpression.NEW_KEYWORD_ROLE); node.getType().acceptVisitor(this, ignored); space(policy.SpaceBeforeMethodCallParentheses); writeCommaSeparatedListInParenthesis(node.getArguments(), policy.SpaceWithinMethodCallParentheses); endNode(node); return null; }
@Override public Void visitObjectCreationExpression(final ObjectCreationExpression node, final Void ignored) { startNode(node); final Expression target = node.getTarget(); if (target != null && !target.isNull()) { target.acceptVisitor(this, ignored); writeToken(Roles.DOT); } writeKeyword(ObjectCreationExpression.NEW_KEYWORD_ROLE); node.getType().acceptVisitor(this, ignored); space(policy.SpaceBeforeMethodCallParentheses); writeCommaSeparatedListInParenthesis(node.getArguments(), policy.SpaceWithinMethodCallParentheses); endNode(node); return null; }
@Override public Void visitObjectCreationExpression(final ObjectCreationExpression node, final Void ignored) { startNode(node); final Expression target = node.getTarget(); if (target != null && !target.isNull()) { target.acceptVisitor(this, ignored); writeToken(Roles.DOT); } writeKeyword(ObjectCreationExpression.NEW_KEYWORD_ROLE); node.getType().acceptVisitor(this, ignored); space(policy.SpaceBeforeMethodCallParentheses); writeCommaSeparatedListInParenthesis(node.getArguments(), policy.SpaceWithinMethodCallParentheses); endNode(node); return null; }