Package com.strobel.decompiler.languages.java.ast

Examples of com.strobel.decompiler.languages.java.ast.Statement


    @Override
    public Void visitIfElseStatement(final IfElseStatement node, final Void data) {
        super.visitIfElseStatement(node, data);

        final Statement falseStatement = node.getFalseStatement();

        if (falseStatement instanceof BlockStatement) {
            final BlockStatement falseBlock = (BlockStatement) falseStatement;
            final AstNodeCollection<Statement> falseStatements = falseBlock.getStatements();

            if (falseStatements.hasSingleElement() &&
                falseStatements.firstOrNullObject() instanceof IfElseStatement) {

                final Statement elseIf = falseStatements.firstOrNullObject();

                elseIf.remove();
                falseStatement.replaceWith(elseIf);
            }
        }

        return null;
View Full Code Here


    public AstNode visitSwitchSection(final SwitchSection node, final Void _) {
        if (node.getStatements().size() != 1) {
            return super.visitSwitchSection(node, _);
        }

        final Statement firstStatement = node.getStatements().firstOrNullObject();

        if (firstStatement instanceof BlockStatement) {
            final BlockStatement block = (BlockStatement) firstStatement;

            final boolean declaresVariables = any(
View Full Code Here

TOP

Related Classes of com.strobel.decompiler.languages.java.ast.Statement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.