Package com.strobel.decompiler.patterns

Examples of com.strobel.decompiler.patterns.Match.success()


            final Expression firstArgument;

            if (arguments.hasSingleElement()) {
                final Match m = STRING_BUILDER_ARGUMENT_PATTERN.match(arguments.firstOrNullObject());

                if (!m.success()) {
                    return super.visitObjectCreationExpression(node, data);
                }

                firstArgument = firstOrDefault(m.<Expression>get("firstArgument"));
            }
View Full Code Here


            return;
        }

        final Match m = ASSERTIONS_DISABLED_PATTERN.match(node);

        if (!m.success()) {
            return;
        }

        final AstNode parent = node.getParent();
View Full Code Here

    }

    private AssertStatement transformAssert(final IfElseStatement ifElse) {
        final Match m = ASSERT_PATTERN.match(ifElse);

        if (!m.success()) {
            return null;
        }

        final Expression condition = m.<Expression>get("condition").iterator().next();
        final AssertStatement assertStatement = new AssertStatement();
View Full Code Here

            return null;
        }

        final Match m1 = TABLE_SWITCH_INPUT.match(previous);

        if (!m1.success()) {
            return null;
        }

        final Expression input = node.getExpression();
View Full Code Here

            return null;
        }

        final Match m2 = HASH_CODE_PATTERN.match(input);

        if (!m2.success()) {
            return null;
        }

        final InvocationExpression hashCodeCall = first(m2.<InvocationExpression>get("hashCodeCall"));
        final MemberReference hashCodeMethod = hashCodeCall.getUserData(Keys.MEMBER_REFERENCE);
View Full Code Here

        IdentifierExpression tableSwitchInput = null;

        for (final SwitchSection section : node.getSwitchSections()) {
            final Match m3 = CASE_BODY_PATTERN.match(section.getStatements().firstOrNullObject());

            if (!m3.success()) {
                return null;
            }

            if (tableSwitchInput == null) {
                tableSwitchInput = first(m3.<IdentifierExpression>get("tableSwitchInput"));
View Full Code Here

    }

    public final ForEachStatement transformForEachInArray(final ForStatement loop) {
        Match m = FOR_ARRAY_PATTERN_1.match(loop);

        if (!m.success()) {
            m = FOR_ARRAY_PATTERN_2.match(loop);

            if (!m.success()) {
                m = FOR_ARRAY_PATTERN_3.match(loop);
View Full Code Here

        Match m = FOR_ARRAY_PATTERN_1.match(loop);

        if (!m.success()) {
            m = FOR_ARRAY_PATTERN_2.match(loop);

            if (!m.success()) {
                m = FOR_ARRAY_PATTERN_3.match(loop);

                if (!m.success()) {
                    return null;
                }
View Full Code Here

            m = FOR_ARRAY_PATTERN_2.match(loop);

            if (!m.success()) {
                m = FOR_ARRAY_PATTERN_3.match(loop);

                if (!m.success()) {
                    return null;
                }
            }
        }
View Full Code Here

        }

        if (previous != null) {
            final Match m2 = ARRAY_INIT_PATTERN.match(previous);

            if (m2.success()) {
                final Expression initializer = m2.<Expression>get("initializer").iterator().next();
                final IdentifierExpression array2 = m2.<IdentifierExpression>get("array").iterator().next();

                if (StringUtilities.equals(array2.getIdentifier(), array.getIdentifier())) {
                    final BlockStatement tempOuter = new BlockStatement();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.