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

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


        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();
View Full Code Here


        }

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

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

            final boolean declaresVariables = any(
                block.getStatements(),
                new Predicate<Statement>() {
                    @Override
                    public boolean test(final Statement s) {
                        return s instanceof VariableDeclarationStatement;
                    }
                }
            );

            if (!declaresVariables) {
                block.remove();
                block.getStatements().moveTo(node.getStatements());
            }
        }

        return super.visitSwitchSection(node, _);
    }
View Full Code Here

TOP

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

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.