Package com.strobel.decompiler.patterns

Examples of com.strobel.decompiler.patterns.Match


        }

        final Statement initializeResource = pp;
        final Statement clearCaughtException = p;

        final Match m = Match.createNew();

        if (RESOURCE_INIT_PATTERN.matches(initializeResource, m) &&
            CLEAR_SAVED_EXCEPTION_PATTERN.matches(clearCaughtException, m) &&
            _tryPattern.matches(node, m)) {

            final IdentifierExpression resource = first(m.<IdentifierExpression>get("resource"));
            final ResolveResult resourceResult = _resolver.apply(resource);

            if (resourceResult == null || resourceResult.getType() == null) {
                return null;
            }

            final BlockStatement tryContent = first(m.<BlockStatement>get("tryContent"));
            final Expression resourceInitializer = first(m.<Expression>get("resourceInitializer"));
            final IdentifierExpression caughtException = first(m.<IdentifierExpression>get("caughtException"));
            final IdentifierExpression caughtOnClose = first(m.<IdentifierExpression>get("caughtOnClose"));
            final CatchClause caughtParent = first(caughtException.getAncestors(CatchClause.class));
            final CatchClause caughtOnCloseParent = first(caughtOnClose.getAncestors(CatchClause.class));

            if (caughtParent == null ||
                caughtOnCloseParent == null ||
View Full Code Here

TOP

Related Classes of com.strobel.decompiler.patterns.Match

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.