Search in sources :

Example 56 with LambdaExpr

use of com.github.javaparser.ast.expr.LambdaExpr in project javaparser by javaparser.

the class StatementContext method solveSymbolAsValue.

@Override
public Optional<Value> solveSymbolAsValue(String name, TypeSolver typeSolver) {
    // if we're in a multiple Variable declaration line (for ex: double a=0, b=a;)
    SymbolDeclarator symbolDeclarator = JavaParserFactory.getSymbolDeclarator(wrappedNode, typeSolver);
    Optional<Value> symbolReference = solveWithAsValue(symbolDeclarator, name, typeSolver);
    if (symbolReference.isPresent()) {
        return symbolReference;
    }
    // we should look in all the statements preceding, treating them as SymbolDeclarators
    if (getParentNode(wrappedNode) instanceof com.github.javaparser.ast.body.MethodDeclaration) {
        return getParent().solveSymbolAsValue(name, typeSolver);
    }
    if (getParentNode(wrappedNode) instanceof LambdaExpr) {
        return getParent().solveSymbolAsValue(name, typeSolver);
    }
    if (getParentNode(wrappedNode) instanceof IfStmt) {
        return getParent().solveSymbolAsValue(name, typeSolver);
    }
    if (!(getParentNode(wrappedNode) instanceof NodeWithStatements)) {
        return getParent().solveSymbolAsValue(name, typeSolver);
    }
    NodeWithStatements<?> nodeWithStmt = (NodeWithStatements<?>) getParentNode(wrappedNode);
    int position = -1;
    for (int i = 0; i < nodeWithStmt.getStatements().size(); i++) {
        if (nodeWithStmt.getStatements().get(i).equals(wrappedNode)) {
            position = i;
        }
    }
    if (position == -1) {
        throw new RuntimeException();
    }
    for (int i = position - 1; i >= 0; i--) {
        symbolDeclarator = JavaParserFactory.getSymbolDeclarator(nodeWithStmt.getStatements().get(i), typeSolver);
        symbolReference = solveWithAsValue(symbolDeclarator, name, typeSolver);
        if (symbolReference.isPresent()) {
            return symbolReference;
        }
    }
    // if nothing is found we should ask the parent context
    Context parentContext = getParent();
    return parentContext.solveSymbolAsValue(name, typeSolver);
}
Also used : Context(com.github.javaparser.symbolsolver.core.resolution.Context) SymbolDeclarator(com.github.javaparser.symbolsolver.resolution.SymbolDeclarator) MethodDeclaration(com.github.javaparser.symbolsolver.model.declarations.MethodDeclaration) NodeWithStatements(com.github.javaparser.ast.nodeTypes.NodeWithStatements) LambdaExpr(com.github.javaparser.ast.expr.LambdaExpr) IfStmt(com.github.javaparser.ast.stmt.IfStmt) Value(com.github.javaparser.symbolsolver.model.resolution.Value)

Example 57 with LambdaExpr

use of com.github.javaparser.ast.expr.LambdaExpr in project javaparser by javaparser.

the class StatementContext method solveSymbol.

@Override
public SymbolReference<? extends ValueDeclaration> solveSymbol(String name, TypeSolver typeSolver) {
    // if we're in a multiple Variable declaration line (for ex: double a=0, b=a;)
    SymbolDeclarator symbolDeclarator = JavaParserFactory.getSymbolDeclarator(wrappedNode, typeSolver);
    SymbolReference<? extends ValueDeclaration> symbolReference = solveWith(symbolDeclarator, name);
    if (symbolReference.isSolved()) {
        return symbolReference;
    }
    // we should look in all the statements preceding, treating them as SymbolDeclarators
    if (getParentNode(wrappedNode) instanceof com.github.javaparser.ast.body.MethodDeclaration) {
        return getParent().solveSymbol(name, typeSolver);
    }
    if (getParentNode(wrappedNode) instanceof com.github.javaparser.ast.body.ConstructorDeclaration) {
        return getParent().solveSymbol(name, typeSolver);
    }
    if (getParentNode(wrappedNode) instanceof LambdaExpr) {
        return getParent().solveSymbol(name, typeSolver);
    }
    if (!(getParentNode(wrappedNode) instanceof NodeWithStatements)) {
        return getParent().solveSymbol(name, typeSolver);
    }
    NodeWithStatements<?> nodeWithStmt = (NodeWithStatements<?>) getParentNode(wrappedNode);
    int position = -1;
    for (int i = 0; i < nodeWithStmt.getStatements().size(); i++) {
        if (nodeWithStmt.getStatements().get(i).equals(wrappedNode)) {
            position = i;
        }
    }
    if (position == -1) {
        throw new RuntimeException();
    }
    for (int i = position - 1; i >= 0; i--) {
        symbolDeclarator = JavaParserFactory.getSymbolDeclarator(nodeWithStmt.getStatements().get(i), typeSolver);
        symbolReference = solveWith(symbolDeclarator, name);
        if (symbolReference.isSolved()) {
            return symbolReference;
        }
    }
    // if nothing is found we should ask the parent context
    return getParent().solveSymbol(name, typeSolver);
}
Also used : SymbolDeclarator(com.github.javaparser.symbolsolver.resolution.SymbolDeclarator) MethodDeclaration(com.github.javaparser.symbolsolver.model.declarations.MethodDeclaration) NodeWithStatements(com.github.javaparser.ast.nodeTypes.NodeWithStatements) LambdaExpr(com.github.javaparser.ast.expr.LambdaExpr)

Example 58 with LambdaExpr

use of com.github.javaparser.ast.expr.LambdaExpr in project javaparser by javaparser.

the class JavaParserSymbolDeclaration method getType.

@Override
public Type getType() {
    if (wrappedNode instanceof Parameter) {
        Parameter parameter = (Parameter) wrappedNode;
        if (getParentNode(wrappedNode) instanceof LambdaExpr) {
            int pos = getParamPos(parameter);
            Type lambdaType = JavaParserFacade.get(typeSolver).getType(getParentNode(wrappedNode));
            // MethodDeclaration methodCalled = JavaParserFacade.get(typeSolver).solve()
            throw new UnsupportedOperationException(wrappedNode.getClass().getCanonicalName());
        } else {
            Type rawType = null;
            if (parameter.getType() instanceof com.github.javaparser.ast.type.PrimitiveType) {
                rawType = PrimitiveType.byName(((com.github.javaparser.ast.type.PrimitiveType) parameter.getType()).getType().name());
            } else {
                rawType = JavaParserFacade.get(typeSolver).convertToUsage(parameter.getType(), wrappedNode);
            }
            if (parameter.isVarArgs()) {
                return new ArrayType(rawType);
            } else {
                return rawType;
            }
        }
    } else if (wrappedNode instanceof VariableDeclarator) {
        VariableDeclarator variableDeclarator = (VariableDeclarator) wrappedNode;
        if (getParentNode(wrappedNode) instanceof VariableDeclarationExpr) {
            Type type = JavaParserFacade.get(typeSolver).convert(variableDeclarator.getType(), JavaParserFactory.getContext(wrappedNode, typeSolver));
            return type;
        } else if (getParentNode(wrappedNode) instanceof FieldDeclaration) {
            return JavaParserFacade.get(typeSolver).convert(variableDeclarator.getType(), JavaParserFactory.getContext(wrappedNode, typeSolver));
        } else {
            throw new UnsupportedOperationException(getParentNode(wrappedNode).getClass().getCanonicalName());
        }
    } else {
        throw new UnsupportedOperationException(wrappedNode.getClass().getCanonicalName());
    }
}
Also used : VariableDeclarationExpr(com.github.javaparser.ast.expr.VariableDeclarationExpr) LambdaExpr(com.github.javaparser.ast.expr.LambdaExpr) FieldDeclaration(com.github.javaparser.ast.body.FieldDeclaration) VariableDeclarator(com.github.javaparser.ast.body.VariableDeclarator) ArrayType(com.github.javaparser.symbolsolver.model.typesystem.ArrayType) Type(com.github.javaparser.symbolsolver.model.typesystem.Type) ArrayType(com.github.javaparser.symbolsolver.model.typesystem.ArrayType) PrimitiveType(com.github.javaparser.symbolsolver.model.typesystem.PrimitiveType) Parameter(com.github.javaparser.ast.body.Parameter) PrimitiveType(com.github.javaparser.symbolsolver.model.typesystem.PrimitiveType)

Example 59 with LambdaExpr

use of com.github.javaparser.ast.expr.LambdaExpr in project javaparser by javaparser.

the class ContextTest method parametersExposedToChildForLambda.

@Test
void parametersExposedToChildForLambda() {
    LambdaExpr lambda = (LambdaExpr) parse("Object myLambda = (myParam) -> myParam * 2;", ParseStart.STATEMENT).asExpressionStmt().getExpression().asVariableDeclarationExpr().getVariables().get(0).getInitializer().get();
    assertOneParamExposedToChildInContextNamed(lambda, lambda.getBody(), "myParam");
    assertNoParamsExposedToChildInContextNamed(lambda, lambda.getParameter(0), "myParam");
}
Also used : LambdaExpr(com.github.javaparser.ast.expr.LambdaExpr) Test(org.junit.jupiter.api.Test) AbstractSymbolResolutionTest(com.github.javaparser.symbolsolver.AbstractSymbolResolutionTest)

Example 60 with LambdaExpr

use of com.github.javaparser.ast.expr.LambdaExpr in project automatiko-engine by automatiko-io.

the class ProcessGenerator method internalConfigure.

private MethodDeclaration internalConfigure(ProcessMetaData processMetaData) {
    BlockStmt body = new BlockStmt();
    MethodDeclaration internalConfigure = new MethodDeclaration().setModifiers(Modifier.Keyword.PUBLIC).setType(targetTypeName).setName("configure").setBody(body);
    // always call super.configure
    body.addStatement(new MethodCallExpr(new SuperExpr(), "configure"));
    if (!processMetaData.getGeneratedHandlers().isEmpty()) {
        processMetaData.getGeneratedHandlers().forEach((name, descriptor) -> {
            CompilationUnit handler = descriptor.generateHandlerClassForService();
            ClassOrInterfaceDeclaration clazz = handler.findFirst(ClassOrInterfaceDeclaration.class).get();
            if (useInjection()) {
                boolean tracingAvailable = context.getBuildContext().hasClassAvailable("org.eclipse.microprofile.opentracing.Traced");
                if (tracingAvailable) {
                    FieldDeclaration tracerField = new FieldDeclaration().addVariable(new VariableDeclarator(new ClassOrInterfaceType(null, "io.automatiko.engine.service.tracing.TracingAdds"), "tracer"));
                    annotator.withInjection(tracerField);
                    clazz.addMember(tracerField);
                    clazz.findAll(MethodDeclaration.class).stream().filter(md -> md.getNameAsString().equals("executeWorkItem")).forEach(md -> {
                        // add Traced nnotation on method level
                        md.addAnnotation("org.eclipse.microprofile.opentracing.Traced");
                        // next update method body to include extra tags
                        BlockStmt mbody = md.getBody().get();
                        MethodCallExpr tracer = new MethodCallExpr(new NameExpr("tracer"), "addTags").addArgument(new MethodCallExpr(new NameExpr("workItem"), "getProcessInstance"));
                        BlockStmt updatedBody = new BlockStmt();
                        updatedBody.addStatement(tracer);
                        mbody.getStatements().forEach(s -> updatedBody.addStatement(s));
                        md.setBody(updatedBody);
                    });
                }
                boolean faultToleranceAvailable = context.getBuildContext().hasClassAvailable("io.automatiko.addons.fault.tolerance.CircuitClosedEvent");
                if (faultToleranceAvailable) {
                    Boolean disabled = Boolean.parseBoolean(descriptor.metadata("faultToleranceDisabled", "false").toString());
                    if (!disabled) {
                        Long timeout = Long.valueOf(descriptor.metadata("timeout", "-1").toString());
                        Long delay = Long.valueOf(descriptor.metadata("delay", "5000").toString());
                        Integer threshold = Integer.valueOf(descriptor.metadata("requestThreshold", "20").toString());
                        Double ratio = Double.valueOf(descriptor.metadata("failureRatio", ".50").toString());
                        NormalAnnotationExpr circuitBrakerAnnotation = new NormalAnnotationExpr(new Name("org.eclipse.microprofile.faulttolerance.CircuitBreaker"), NodeList.nodeList(new MemberValuePair("delay", new LongLiteralExpr(delay)), new MemberValuePair("requestVolumeThreshold", new IntegerLiteralExpr(threshold)), new MemberValuePair("failureRatio", new DoubleLiteralExpr(ratio)), new MemberValuePair("skipOn", new NameExpr("io.automatiko.engine.api.workflow.HandledServiceExecutionError.class"))));
                        clazz.findAll(MethodDeclaration.class).stream().filter(md -> md.getNameAsString().equals("executeWorkItem")).forEach(md -> {
                            // add CircuitBreaker annotation on method level
                            md.addAnnotation(circuitBrakerAnnotation);
                            md.addSingleMemberAnnotation("io.smallrye.faulttolerance.api.CircuitBreakerName", new StringLiteralExpr(name));
                            if (timeout > 0) {
                                md.addSingleMemberAnnotation("org.eclipse.microprofile.faulttolerance.Timeout", new LongLiteralExpr(timeout));
                            }
                        });
                        context.setApplicationProperty("quarkus.arc.selected-alternatives", context.getApplicationProperty("quarkus.arc.selected-alternatives").filter(s -> !s.contains("io.automatiko.addons.fault.tolerance.internal.AutomatikoStrategyCache")).map(s -> s + ",io.automatiko.addons.fault.tolerance.internal.AutomatikoStrategyCache").orElse("io.automatiko.addons.fault.tolerance.internal.AutomatikoStrategyCache"));
                    }
                }
                annotator.withApplicationComponent(clazz);
            } else {
                String packageName = handler.getPackageDeclaration().map(pd -> pd.getName().toString()).orElse("");
                String clazzName = clazz.getName().toString();
                MethodCallExpr workItemManager = new MethodCallExpr(new NameExpr("services"), "getWorkItemManager");
                MethodCallExpr registerHandler = new MethodCallExpr(workItemManager, "registerWorkItemHandler").addArgument(new StringLiteralExpr(name)).addArgument(new ObjectCreationExpr(null, new ClassOrInterfaceType(null, packageName + "." + clazzName), NodeList.nodeList()));
                body.addStatement(registerHandler);
            }
            // annotate for injection or add constructor for initialization
            handler.findAll(FieldDeclaration.class, fd -> !fd.getVariable(0).getNameAsString().equals("tracer")).forEach(fd -> {
                if (useInjection()) {
                    annotator.withInjection(fd);
                }
                if (descriptor.implementation().equalsIgnoreCase("##webservice") && !fd.getVariable(0).getNameAsString().equals("completionHandler") && annotator != null) {
                    annotator.withRestClientInjection(fd);
                } else if (!descriptor.implementation().equalsIgnoreCase("##webservice") && !fd.getVariable(0).getNameAsString().equals("completionHandler")) {
                    BlockStmt constructorBody = new BlockStmt();
                    AssignExpr assignExpr = new AssignExpr(new FieldAccessExpr(new ThisExpr(), fd.getVariable(0).getNameAsString()), new ObjectCreationExpr().setType(fd.getVariable(0).getType().toString()), AssignExpr.Operator.ASSIGN);
                    constructorBody.addStatement(assignExpr);
                    clazz.addConstructor(Keyword.PUBLIC).setBody(constructorBody);
                }
            });
            additionalClasses.add(handler);
        });
        if (useInjection()) {
            BlockStmt actionBody = new BlockStmt();
            LambdaExpr forachBody = new LambdaExpr(new Parameter(new UnknownType(), "h"), actionBody);
            MethodCallExpr forachHandler = new MethodCallExpr(new NameExpr("handlers"), "forEach");
            forachHandler.addArgument(forachBody);
            MethodCallExpr workItemManager = new MethodCallExpr(new NameExpr("services"), "getWorkItemManager");
            MethodCallExpr registerHandler = new MethodCallExpr(workItemManager, "registerWorkItemHandler").addArgument(new MethodCallExpr(new NameExpr("h"), "getName")).addArgument(new NameExpr("h"));
            actionBody.addStatement(registerHandler);
            body.addStatement(forachHandler);
        }
    }
    if (!processMetaData.getGeneratedListeners().isEmpty()) {
        processMetaData.getGeneratedListeners().forEach(listener -> {
            ClassOrInterfaceDeclaration clazz = listener.findFirst(ClassOrInterfaceDeclaration.class).get();
            String packageName = listener.getPackageDeclaration().map(pd -> pd.getName().toString()).orElse("");
            String clazzName = clazz.getName().toString();
            MethodCallExpr eventSupport = new MethodCallExpr(new NameExpr("services"), "getEventSupport");
            MethodCallExpr registerListener = new MethodCallExpr(eventSupport, "addEventListener").addArgument(new ObjectCreationExpr(null, new ClassOrInterfaceType(null, packageName + "." + clazzName), NodeList.nodeList()));
            body.addStatement(registerListener);
            additionalClasses.add(listener);
        });
    }
    body.addStatement(new ReturnStmt(new ThisExpr()));
    return internalConfigure;
}
Also used : Arrays(java.util.Arrays) ClassOrInterfaceType(com.github.javaparser.ast.type.ClassOrInterfaceType) GeneratorContext(io.automatiko.engine.codegen.GeneratorContext) ThisExpr(com.github.javaparser.ast.expr.ThisExpr) ImportDeclaration(com.github.javaparser.ast.ImportDeclaration) ConstructorDeclaration(com.github.javaparser.ast.body.ConstructorDeclaration) NullLiteralExpr(com.github.javaparser.ast.expr.NullLiteralExpr) ObjectCreationExpr(com.github.javaparser.ast.expr.ObjectCreationExpr) Map(java.util.Map) CompilationUnit(com.github.javaparser.ast.CompilationUnit) TriggerMetaData(io.automatiko.engine.workflow.compiler.canonical.TriggerMetaData) DependencyInjectionAnnotator(io.automatiko.engine.codegen.di.DependencyInjectionAnnotator) Process(io.automatiko.engine.api.definition.process.Process) NodeList(com.github.javaparser.ast.NodeList) SimpleName(com.github.javaparser.ast.expr.SimpleName) UnknownType(com.github.javaparser.ast.type.UnknownType) Model(io.automatiko.engine.api.Model) Collection(java.util.Collection) MethodCallExpr(com.github.javaparser.ast.expr.MethodCallExpr) SvgServerlessProcessImageGenerator(io.automatiko.engine.codegen.process.image.SvgServerlessProcessImageGenerator) StringLiteralExpr(com.github.javaparser.ast.expr.StringLiteralExpr) Modifier(com.github.javaparser.ast.Modifier) SourceVersion(javax.lang.model.SourceVersion) List(java.util.List) Entry(java.util.Map.Entry) Operator(com.github.javaparser.ast.expr.AssignExpr.Operator) LongLiteralExpr(com.github.javaparser.ast.expr.LongLiteralExpr) BlockStmt(com.github.javaparser.ast.stmt.BlockStmt) FieldAccessExpr(com.github.javaparser.ast.expr.FieldAccessExpr) ClassOrInterfaceDeclaration(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration) LambdaExpr(com.github.javaparser.ast.expr.LambdaExpr) ReturnStmt(com.github.javaparser.ast.stmt.ReturnStmt) Parameter(com.github.javaparser.ast.body.Parameter) Name(com.github.javaparser.ast.expr.Name) CastExpr(com.github.javaparser.ast.expr.CastExpr) EndOfInstanceStrategy(io.automatiko.engine.api.workflow.EndOfInstanceStrategy) ArrayList(java.util.ArrayList) VariableDeclarator(com.github.javaparser.ast.body.VariableDeclarator) SvgProcessImageGenerator(io.automatiko.engine.codegen.process.image.SvgProcessImageGenerator) DoubleLiteralExpr(com.github.javaparser.ast.expr.DoubleLiteralExpr) SuperExpr(com.github.javaparser.ast.expr.SuperExpr) StringUtils(io.automatiko.engine.services.utils.StringUtils) SvgBpmnProcessImageGenerator(io.automatiko.engine.codegen.process.image.SvgBpmnProcessImageGenerator) NoSuchElementException(java.util.NoSuchElementException) Keyword(com.github.javaparser.ast.Modifier.Keyword) WorkItemHandler(io.automatiko.engine.api.runtime.process.WorkItemHandler) AbstractProcess(io.automatiko.engine.workflow.AbstractProcess) UserTaskModelMetaData(io.automatiko.engine.workflow.compiler.canonical.UserTaskModelMetaData) CodegenUtils(io.automatiko.engine.codegen.CodegenUtils) BaseFunctions(io.automatiko.engine.services.execution.BaseFunctions) WorkflowProcess(io.automatiko.engine.api.definition.process.WorkflowProcess) AssignExpr(com.github.javaparser.ast.expr.AssignExpr) BodyDeclarationComparator(io.automatiko.engine.codegen.BodyDeclarationComparator) WorkflowProcessInstance(io.automatiko.engine.api.runtime.process.WorkflowProcessInstance) NameExpr(com.github.javaparser.ast.expr.NameExpr) IfStmt(com.github.javaparser.ast.stmt.IfStmt) NormalAnnotationExpr(com.github.javaparser.ast.expr.NormalAnnotationExpr) ProcessMetaData(io.automatiko.engine.workflow.compiler.canonical.ProcessMetaData) FieldDeclaration(com.github.javaparser.ast.body.FieldDeclaration) MethodDeclaration(com.github.javaparser.ast.body.MethodDeclaration) MemberValuePair(com.github.javaparser.ast.expr.MemberValuePair) WildcardType(com.github.javaparser.ast.type.WildcardType) Functions(io.automatiko.engine.api.Functions) ServerlessFunctions(io.automatiko.engine.workflow.sw.ServerlessFunctions) IntegerLiteralExpr(com.github.javaparser.ast.expr.IntegerLiteralExpr) IntegerLiteralExpr(com.github.javaparser.ast.expr.IntegerLiteralExpr) ObjectCreationExpr(com.github.javaparser.ast.expr.ObjectCreationExpr) ClassOrInterfaceDeclaration(com.github.javaparser.ast.body.ClassOrInterfaceDeclaration) NameExpr(com.github.javaparser.ast.expr.NameExpr) StringLiteralExpr(com.github.javaparser.ast.expr.StringLiteralExpr) ClassOrInterfaceType(com.github.javaparser.ast.type.ClassOrInterfaceType) FieldDeclaration(com.github.javaparser.ast.body.FieldDeclaration) VariableDeclarator(com.github.javaparser.ast.body.VariableDeclarator) SimpleName(com.github.javaparser.ast.expr.SimpleName) Name(com.github.javaparser.ast.expr.Name) AssignExpr(com.github.javaparser.ast.expr.AssignExpr) MemberValuePair(com.github.javaparser.ast.expr.MemberValuePair) LongLiteralExpr(com.github.javaparser.ast.expr.LongLiteralExpr) FieldAccessExpr(com.github.javaparser.ast.expr.FieldAccessExpr) NormalAnnotationExpr(com.github.javaparser.ast.expr.NormalAnnotationExpr) ThisExpr(com.github.javaparser.ast.expr.ThisExpr) CompilationUnit(com.github.javaparser.ast.CompilationUnit) SuperExpr(com.github.javaparser.ast.expr.SuperExpr) MethodDeclaration(com.github.javaparser.ast.body.MethodDeclaration) BlockStmt(com.github.javaparser.ast.stmt.BlockStmt) LambdaExpr(com.github.javaparser.ast.expr.LambdaExpr) UnknownType(com.github.javaparser.ast.type.UnknownType) DoubleLiteralExpr(com.github.javaparser.ast.expr.DoubleLiteralExpr) Parameter(com.github.javaparser.ast.body.Parameter) ReturnStmt(com.github.javaparser.ast.stmt.ReturnStmt) MethodCallExpr(com.github.javaparser.ast.expr.MethodCallExpr)

Aggregations

LambdaExpr (com.github.javaparser.ast.expr.LambdaExpr)70 Parameter (com.github.javaparser.ast.body.Parameter)37 NameExpr (com.github.javaparser.ast.expr.NameExpr)30 MethodCallExpr (com.github.javaparser.ast.expr.MethodCallExpr)29 Expression (com.github.javaparser.ast.expr.Expression)27 BlockStmt (com.github.javaparser.ast.stmt.BlockStmt)25 UnknownType (com.github.javaparser.ast.type.UnknownType)24 StringLiteralExpr (com.github.javaparser.ast.expr.StringLiteralExpr)19 ExpressionStmt (com.github.javaparser.ast.stmt.ExpressionStmt)16 ReturnStmt (com.github.javaparser.ast.stmt.ReturnStmt)15 ClassOrInterfaceType (com.github.javaparser.ast.type.ClassOrInterfaceType)12 CompilationUnit (com.github.javaparser.ast.CompilationUnit)10 MethodDeclaration (com.github.javaparser.ast.body.MethodDeclaration)10 NullLiteralExpr (com.github.javaparser.ast.expr.NullLiteralExpr)10 Test (org.junit.jupiter.api.Test)10 VariableDeclarator (com.github.javaparser.ast.body.VariableDeclarator)9 LongLiteralExpr (com.github.javaparser.ast.expr.LongLiteralExpr)9 CastExpr (com.github.javaparser.ast.expr.CastExpr)8 ArrayList (java.util.ArrayList)8 TypedExpression (org.drools.modelcompiler.builder.generator.TypedExpression)8