Package com.strobel.decompiler.patterns

Examples of com.strobel.decompiler.patterns.NamedNode


                    new ReturnStatement(
                        Expression.MYSTERY_OFFSET,
                        new Choice(
                            new MemberReferenceExpression(
                                Expression.MYSTERY_OFFSET,
                                new NamedNode(
                                    "valuesField",
                                    new TypeReferenceExpression(
                                        Expression.MYSTERY_OFFSET,
                                        astBuilder.convertType(definition)
                                    ).member(Pattern.ANY_STRING)
                                ).toExpression(),
                                "clone"
                            ).invoke(),
                            new CastExpression(
                                astBuilder.convertType(definition.makeArrayType()),
                                new MemberReferenceExpression(
                                    Expression.MYSTERY_OFFSET,
                                    new NamedNode(
                                        "valuesField",
                                        new TypeReferenceExpression(
                                            Expression.MYSTERY_OFFSET,
                                            astBuilder.convertType(definition)
                                        ).member(Pattern.ANY_STRING)
View Full Code Here


                size.setName(Pattern.ANY_STRING);
                size.setAnyModifiers(true);
                size.setType(new OptionalNode(new SimpleType("int")).toType());

                pattern.getParameters().add(new NamedNode("size", size).toParameterDeclaration());

                final ArrayCreationExpression arrayCreation = new ArrayCreationExpression(Expression.MYSTERY_OFFSET);

                arrayCreation.getDimensions().add(new IdentifierExpressionBackReference("size").toExpression());
                arrayCreation.setType(new NamedNode("type", new AnyNode()).toType());

                pattern.setBody(arrayCreation);

                final Match match = pattern.match(node);
View Full Code Here

        final CatchClause catchClause = new CatchClause(
            new BlockStatement(
                new ExpressionStatement(
                    new AssignmentExpression(
                        new IdentifierExpressionBackReference("savedException").toExpression(),
                        new NamedNode("caughtException", new IdentifierExpression(Expression.MYSTERY_OFFSET, Pattern.ANY_STRING)).toExpression()
                    )
                ),
                new ThrowStatement(new IdentifierExpressionBackReference("caughtException").toExpression())
            )
        );

        catchClause.setVariableName(Pattern.ANY_STRING);
        catchClause.getExceptionTypes().add(new SimpleType("Throwable"));

        tryPattern.getCatchClauses().add(catchClause);

        final TryCatchStatement disposeTry = new TryCatchStatement(Expression.MYSTERY_OFFSET);

        disposeTry.setTryBlock(
            new BlockStatement(
                new ExpressionStatement(
                    new IdentifierExpressionBackReference("resource").toExpression().invoke("close")
                )
            )
        );

        final CatchClause disposeCatch = new CatchClause(
            new BlockStatement(
                new ExpressionStatement(
                    new IdentifierExpressionBackReference("savedException").toExpression().invoke(
                        "addSuppressed",
                        new NamedNode("caughtOnClose", new IdentifierExpression(Expression.MYSTERY_OFFSET, Pattern.ANY_STRING)).toExpression()
                    )
                )
            )
        );
View Full Code Here

TOP

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

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.