public BlockStatement(final Statement... statements) { super(Expression.MYSTERY_OFFSET); Collections.addAll(getStatements(), statements); }
public BlockStatement(final Statement... statements) { super(Expression.MYSTERY_OFFSET); Collections.addAll(getStatements(), statements); }
public BlockStatement(final Statement... statements) { super(Expression.MYSTERY_OFFSET); Collections.addAll(getStatements(), statements); }
public BlockStatement(final Iterable<Statement> statements) { super(Expression.MYSTERY_OFFSET); if (statements != null) { for (final Statement statement : statements) { getStatements().add(statement); } } }
@Override public boolean matches(final INode other, final Match match) { return other instanceof BlockStatement && !other.isNull() && getStatements().matches(((BlockStatement) other).getStatements(), match); }
public BlockStatement(final Iterable<Statement> statements) { super(Expression.MYSTERY_OFFSET); if (statements != null) { for (final Statement statement : statements) { getStatements().add(statement); } } }
@Override public boolean matches(final INode other, final Match match) { return other instanceof BlockStatement && !other.isNull() && getStatements().matches(((BlockStatement) other).getStatements(), match); }
@Override public boolean matches(final INode other, final Match match) { return other instanceof BlockStatement && !other.isNull() && getStatements().matches(((BlockStatement) other).getStatements(), match); }
public BlockStatement(final Iterable<Statement> statements) { super(Expression.MYSTERY_OFFSET); if (statements != null) { for (final Statement statement : statements) { getStatements().add(statement); } } }
@Override public final Iterator<Statement> iterator() { return getStatements().iterator(); }
@Override public final Iterator<Statement> iterator() { return getStatements().iterator(); }
@Override public final Iterator<Statement> iterator() { return getStatements().iterator(); }
@Override public ControlFlowNode visitBlockStatement(final BlockStatement node, final ControlFlowNode data) { final ControlFlowNode childNode = handleStatementList(node.getStatements(), data); return createConnectedEndNode(node, childNode); }
@Override public ControlFlowNode visitBlockStatement(final BlockStatement node, final ControlFlowNode data) { final ControlFlowNode childNode = handleStatementList(node.getStatements(), data); return createConnectedEndNode(node, childNode); }
@Override public ControlFlowNode visitBlockStatement(final BlockStatement node, final ControlFlowNode data) { final ControlFlowNode childNode = handleStatementList(node.getStatements(), data); return createConnectedEndNode(node, childNode); }
private BlockStatement transformBlock(final Block block) { final BlockStatement astBlock = new BlockStatement(); if (block != null) { final List<Node> children = block.getChildren(); for (int i = 0; i < children.size(); i++) { final Node node = children.get(i); final Statement statement = transformNode( node, i < children.size() - 1 ? children.get(i + 1) : null ); astBlock.getStatements().add(statement); if (statement instanceof SynchronizedStatement) { i++; } } } return astBlock; }
@Override public AstNode visitSwitchSection(final SwitchSection node, final Void p) { if (node.getStatements().size() != 1) { return super.visitSwitchSection(node, p); } final Statement firstStatement = node.getStatements().firstOrNullObject(); if (firstStatement instanceof BlockStatement) { final BlockStatement block = (BlockStatement) firstStatement; if (any(ofType(block.getStatements(), VariableDeclarationStatement.class))) { return super.visitSwitchSection(node, p); } block.remove(); block.getStatements().moveTo(node.getStatements()); } return super.visitSwitchSection(node, p); } }
@Override public Void visitMethodDeclaration(final MethodDeclaration node, final Void p) { final MethodDefinition method = node.getUserData(Keys.METHOD_DEFINITION); if (method != null) { if (AstBuilder.isMemberHidden(method, context)) { node.remove(); return null; } if (method.isTypeInitializer()) { if (node.getBody().getStatements().isEmpty()) { node.remove(); return null; } } } return super.visitMethodDeclaration(node, p); }
@Override public Void visitMethodDeclaration(final MethodDeclaration node, final Void _) { final MethodDefinition method = node.getUserData(Keys.METHOD_DEFINITION); if (method != null) { if (AstBuilder.isMemberHidden(method, context)) { node.remove(); return null; } if (method.isTypeInitializer()) { if (node.getBody().getStatements().isEmpty()) { node.remove(); return null; } } } return super.visitMethodDeclaration(node, _); }
@Override public Void visitMethodDeclaration(final MethodDeclaration node, final Void _) { final MethodDefinition method = node.getUserData(Keys.METHOD_DEFINITION); if (method != null) { if (AstBuilder.isMemberHidden(method, context)) { node.remove(); return null; } if (method.isTypeInitializer()) { if (node.getBody().getStatements().isEmpty()) { node.remove(); return null; } } } return super.visitMethodDeclaration(node, _); }