@Override public EntityDeclaration clone() { final EntityDeclaration copy = (EntityDeclaration) super.clone(); copy._anyModifiers = _anyModifiers; return copy; }
@Override public EntityDeclaration clone() { final EntityDeclaration copy = (EntityDeclaration) super.clone(); copy._anyModifiers = _anyModifiers; return copy; }
@Override public EntityDeclaration clone() { final EntityDeclaration copy = (EntityDeclaration) super.clone(); copy._anyModifiers = _anyModifiers; return copy; }
@Override public Expression clone() { return (Expression) super.clone(); }
@Override public Expression clone() { return (Expression) super.clone(); }
@Override public Expression clone() { return (Expression) super.clone(); }
public AstType clone() { return (AstType) super.clone(); }
public AstType clone() { return (AstType) super.clone(); }
@Override public Statement clone() { return (Statement) super.clone(); }
@Override public Statement clone() { return (Statement) super.clone(); }
@Override public Statement clone() { return (Statement) super.clone(); }
public AstType clone() { return (AstType) super.clone(); }
@Override @SuppressWarnings("CloneDoesntDeclareCloneNotSupportedException") public AstNode clone() { try { final AstNode clone = (AstNode) super.clone(); clone._parent = null; clone._firstChild = null; clone._lastChild = null; clone._previousSibling = null; clone._nextSibling = null; clone.flags &= ~FROZEN_BIT; for (final Key<?> key : Keys.ALL_KEYS) { copyKey(this, clone, key); } for (AstNode current = _firstChild; current != null; current = current._nextSibling) { clone.addChildUnsafe(current.clone(), current.getRole()); } // clone.cloneAnnotations(); return clone; } catch (CloneNotSupportedException e) { throw new UndeclaredThrowableException(e); } }
@Override @SuppressWarnings("CloneDoesntDeclareCloneNotSupportedException") public AstNode clone() { try { final AstNode clone = (AstNode) super.clone(); clone._parent = null; clone._firstChild = null; clone._lastChild = null; clone._previousSibling = null; clone._nextSibling = null; clone.flags &= ~FROZEN_BIT; for (final Key<?> key : Keys.ALL_KEYS) { copyKey(this, clone, key); } for (AstNode current = _firstChild; current != null; current = current._nextSibling) { clone.addChildUnsafe(current.clone(), current.getRole()); } // clone.cloneAnnotations(); return clone; } catch (CloneNotSupportedException e) { throw new UndeclaredThrowableException(e); } }
@Override public Void visitIdentifierExpression(final IdentifierExpression node, final Void _) { final Variable variable = node.getUserData(Keys.VARIABLE); if (variable != null && variable.isParameter()) { final ParameterDefinition parameter = variable.getOriginalParameter(); if (areMethodsEquivalent((MethodReference) parameter.getMethod(), context.getCurrentMethod())) { final AstNode replacement = _argumentMappings.get(parameter); if (replacement != null) { node.replaceWith(replacement.clone()); return null; } } } return super.visitIdentifierExpression(node, _); }
@Override public Void visitIdentifierExpression(final IdentifierExpression node, final Void _) { final Variable variable = node.getUserData(Keys.VARIABLE); if (variable != null && variable.isParameter()) { final ParameterDefinition parameter = variable.getOriginalParameter(); if (areMethodsEquivalent((MethodReference) parameter.getMethod(), context.getCurrentMethod())) { final AstNode replacement = _argumentMappings.get(parameter); if (replacement != null) { node.replaceWith(replacement.clone()); return null; } } } return super.visitIdentifierExpression(node, _); }
@Override public Void visitIdentifierExpression(final IdentifierExpression node, final Void p) { final Variable variable = node.getUserData(Keys.VARIABLE); if (variable != null && variable.isParameter()) { final ParameterDefinition parameter = variable.getOriginalParameter(); assert parameter != null; if (areMethodsEquivalent((MethodReference) parameter.getMethod(), context.getCurrentMethod())) { final AstNode replacement = _argumentMappings.get(parameter); if (replacement != null) { node.replaceWith(replacement.clone()); return null; } } } return super.visitIdentifierExpression(node, p); }
public void run(final AstNode root) { if (!(root instanceof MethodDeclaration)) { throw new IllegalArgumentException("InliningVisitor must be run against a MethodDeclaration."); } final MethodDeclaration clone = (MethodDeclaration) root.clone(); super.run(clone); final BlockStatement body = clone.getBody(); final AstNodeCollection<Statement> statements = body.getStatements(); if (statements.size() == 1) { final Statement firstStatement = statements.firstOrNullObject(); if (firstStatement instanceof ExpressionStatement || firstStatement instanceof ReturnStatement) { _result = firstStatement.getChildByRole(Roles.EXPRESSION); _result.remove(); return; } } _result = body; _result.remove(); }
public void run(final AstNode root) { if (!(root instanceof MethodDeclaration)) { throw new IllegalArgumentException("InliningVisitor must be run against a MethodDeclaration."); } final MethodDeclaration clone = (MethodDeclaration) root.clone(); super.run(clone); final BlockStatement body = clone.getBody(); final AstNodeCollection<Statement> statements = body.getStatements(); if (statements.size() == 1) { final Statement firstStatement = statements.firstOrNullObject(); if (firstStatement instanceof ExpressionStatement || firstStatement instanceof ReturnStatement) { _result = firstStatement.getChildByRole(Roles.EXPRESSION); _result.remove(); return; } } _result = body; _result.remove(); }
public void run(final AstNode root) { if (!(root instanceof MethodDeclaration)) { throw new IllegalArgumentException("InliningVisitor must be run against a MethodDeclaration."); } final MethodDeclaration clone = (MethodDeclaration) root.clone(); super.run(clone); final BlockStatement body = clone.getBody(); final AstNodeCollection<Statement> statements = body.getStatements(); if (statements.size() == 1) { final Statement firstStatement = statements.firstOrNullObject(); if (firstStatement instanceof ExpressionStatement || firstStatement instanceof ReturnStatement) { _result = firstStatement.getChildByRole(Roles.EXPRESSION); _result.remove(); return; } } _result = body; _result.remove(); }