apache / incubator-kie-drools

Drools is a rule engine, DMN engine and complex event processing (CEP) engine for Java.
http://www.drools.org
Apache License 2.0
5.88k stars 2.5k forks source link

[new-parser] Declared entry-point ID is stored with quotes in the AST #5904

Closed yurloc closed 6 months ago

yurloc commented 6 months ago

Parent issue

Failing tests

Notes

Rule code snippet

declare entry-point "DMNImports" end

Error output

[WARNING] 
java.lang.reflect.InvocationTargetException
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:119)
    at java.lang.reflect.Method.invoke (Method.java:577)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:294)
    at java.lang.Thread.run (Thread.java:833)
Caused by: com.github.javaparser.ParseProblemException: (line 3,col 53) Parse error. Found  "DMNImports" <IDENTIFIER>, expected one of  "!=" "%" "%=" "&" "&&" "&=" ")" "*" "*=" "+" "+=" "," "-" "-=" "->" "/" "/=" "::" "<" "<<=" "<=" "=" "==" ">" ">=" ">>=" ">>>=" "?" "^" "^=" "instanceof" "|" "|=" "||"
Problem stacktrace : 
  com.github.javaparser.GeneratedJavaParser.generateParseException(GeneratedJavaParser.java:13933)
  com.github.javaparser.GeneratedJavaParser.jj_consume_token(GeneratedJavaParser.java:13778)
  com.github.javaparser.GeneratedJavaParser.Arguments(GeneratedJavaParser.java:5252)
  com.github.javaparser.GeneratedJavaParser.PrimarySuffixWithoutSuper(GeneratedJavaParser.java:5041)
  com.github.javaparser.GeneratedJavaParser.PrimarySuffix(GeneratedJavaParser.java:4986)
  com.github.javaparser.GeneratedJavaParser.PrimaryExpression(GeneratedJavaParser.java:4663)
  com.github.javaparser.GeneratedJavaParser.PostfixExpression(GeneratedJavaParser.java:4520)
  com.github.javaparser.GeneratedJavaParser.UnaryExpressionNotPlusMinus(GeneratedJavaParser.java:4490)
  com.github.javaparser.GeneratedJavaParser.UnaryExpression(GeneratedJavaParser.java:4363)
  com.github.javaparser.GeneratedJavaParser.MultiplicativeExpression(GeneratedJavaParser.java:4226)
  com.github.javaparser.GeneratedJavaParser.AdditiveExpression(GeneratedJavaParser.java:4178)
  com.github.javaparser.GeneratedJavaParser.ShiftExpression(GeneratedJavaParser.java:4133)
  com.github.javaparser.GeneratedJavaParser.RelationalExpression(GeneratedJavaParser.java:4073)
  com.github.javaparser.GeneratedJavaParser.InstanceOfExpression(GeneratedJavaParser.java:3992)
  com.github.javaparser.GeneratedJavaParser.EqualityExpression(GeneratedJavaParser.java:3922)
  com.github.javaparser.GeneratedJavaParser.AndExpression(GeneratedJavaParser.java:3877)
  com.github.javaparser.GeneratedJavaParser.ExclusiveOrExpression(GeneratedJavaParser.java:3837)
  com.github.javaparser.GeneratedJavaParser.InclusiveOrExpression(GeneratedJavaParser.java:3797)
  com.github.javaparser.GeneratedJavaParser.ConditionalAndExpression(GeneratedJavaParser.java:3757)
  com.github.javaparser.GeneratedJavaParser.ConditionalOrExpression(GeneratedJavaParser.java:3712)
  com.github.javaparser.GeneratedJavaParser.ConditionalExpression(GeneratedJavaParser.java:3680)
  com.github.javaparser.GeneratedJavaParser.Expression(GeneratedJavaParser.java:3493)
  com.github.javaparser.GeneratedJavaParser.ArgumentList(GeneratedJavaParser.java:5266)
  com.github.javaparser.GeneratedJavaParser.Arguments(GeneratedJavaParser.java:5245)
  com.github.javaparser.GeneratedJavaParser.PrimarySuffixWithoutSuper(GeneratedJavaParser.java:5041)
  com.github.javaparser.GeneratedJavaParser.PrimarySuffix(GeneratedJavaParser.java:4986)
  com.github.javaparser.GeneratedJavaParser.PrimaryExpression(GeneratedJavaParser.java:4663)
  com.github.javaparser.GeneratedJavaParser.PostfixExpression(GeneratedJavaParser.java:4520)
  com.github.javaparser.GeneratedJavaParser.UnaryExpressionNotPlusMinus(GeneratedJavaParser.java:4490)
  com.github.javaparser.GeneratedJavaParser.UnaryExpression(GeneratedJavaParser.java:4363)
  com.github.javaparser.GeneratedJavaParser.MultiplicativeExpression(GeneratedJavaParser.java:4226)
  com.github.javaparser.GeneratedJavaParser.AdditiveExpression(GeneratedJavaParser.java:4178)
  com.github.javaparser.GeneratedJavaParser.ShiftExpression(GeneratedJavaParser.java:4133)
  com.github.javaparser.GeneratedJavaParser.RelationalExpression(GeneratedJavaParser.java:4073)
  com.github.javaparser.GeneratedJavaParser.InstanceOfExpression(GeneratedJavaParser.java:3992)
  com.github.javaparser.GeneratedJavaParser.EqualityExpression(GeneratedJavaParser.java:3922)
  com.github.javaparser.GeneratedJavaParser.AndExpression(GeneratedJavaParser.java:3877)
  com.github.javaparser.GeneratedJavaParser.ExclusiveOrExpression(GeneratedJavaParser.java:3837)
  com.github.javaparser.GeneratedJavaParser.InclusiveOrExpression(GeneratedJavaParser.java:3797)
  com.github.javaparser.GeneratedJavaParser.ConditionalAndExpression(GeneratedJavaParser.java:3757)
  com.github.javaparser.GeneratedJavaParser.ConditionalOrExpression(GeneratedJavaParser.java:3712)
  com.github.javaparser.GeneratedJavaParser.ConditionalExpression(GeneratedJavaParser.java:3680)
  com.github.javaparser.GeneratedJavaParser.Expression(GeneratedJavaParser.java:3493)
  com.github.javaparser.GeneratedJavaParser.ReturnStatement(GeneratedJavaParser.java:7024)
  com.github.javaparser.GeneratedJavaParser.Statement(GeneratedJavaParser.java:5645)
  com.github.javaparser.GeneratedJavaParser.BlockStatement(GeneratedJavaParser.java:5865)
  com.github.javaparser.GeneratedJavaParser.Statements(GeneratedJavaParser.java:2773)
  com.github.javaparser.GeneratedJavaParser.Block(GeneratedJavaParser.java:5744)
  com.github.javaparser.GeneratedJavaParser.MethodDeclaration(GeneratedJavaParser.java:2170)
  com.github.javaparser.GeneratedJavaParser.ClassOrInterfaceBodyDeclaration(GeneratedJavaParser.java:1771)
  com.github.javaparser.GeneratedJavaParser.ClassOrInterfaceBodyDeclarationParseStart(GeneratedJavaParser.java:8331)
  com.github.javaparser.JavaParser.parse(JavaParser.java:125)
  com.github.javaparser.JavaParser.parseBodyDeclaration(JavaParser.java:391)
  com.github.javaparser.JavaParserAdapter.parseBodyDeclaration(JavaParserAdapter.java:139)
  com.github.javaparser.StaticJavaParser.parseBodyDeclaration(StaticJavaParser.java:344)
  org.drools.model.codegen.execmodel.PackageModel.generateGetEntryPointsMethod(PackageModel.java:683)
  org.drools.model.codegen.execmodel.PackageModel.getRulesSource(PackageModel.java:668)
  org.drools.model.codegen.execmodel.PackageModelWriter.<init>(PackageModelWriter.java:39)
  org.drools.model.codegen.execmodel.PackageSources.dumpSources(PackageSources.java:50)
  org.drools.model.codegen.execmodel.processors.SourceCodeGenerationPhase.process(SourceCodeGenerationPhase.java:54)
  org.drools.compiler.builder.impl.processors.IteratingPhase.process(IteratingPhase.java:53)
  org.drools.model.codegen.execmodel.processors.ModelMainCompilationPhase.process(ModelMainCompilationPhase.java:104)
  org.drools.model.codegen.execmodel.ModelBuilderImpl.doSecondBuildStep(ModelBuilderImpl.java:114)
  org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:125)
  org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:109)
  org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages(AbstractKieProject.java:274)
  org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages(AbstractKieProject.java:220)
  org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:84)
  org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject(KieBuilderImpl.java:285)
  org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:251)
  org.kie.dmn.validation.bootstrap.GenerateModel.generate(GenerateModel.java:66)
  org.kie.dmn.validation.bootstrap.ValidationBootstrapMain.main(ValidationBootstrapMain.java:51)
  java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
  java.base/java.lang.reflect.Method.invoke(Method.java:577)
  org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:294)
  java.base/java.lang.Thread.run(Thread.java:833)

    at com.github.javaparser.JavaParserAdapter.handleResult (JavaParserAdapter.java:83)
    at com.github.javaparser.JavaParserAdapter.parseBodyDeclaration (JavaParserAdapter.java:139)
    at com.github.javaparser.StaticJavaParser.parseBodyDeclaration (StaticJavaParser.java:344)
    at org.drools.model.codegen.execmodel.PackageModel.generateGetEntryPointsMethod (PackageModel.java:683)
    at org.drools.model.codegen.execmodel.PackageModel.getRulesSource (PackageModel.java:668)
    at org.drools.model.codegen.execmodel.PackageModelWriter.<init> (PackageModelWriter.java:39)
    at org.drools.model.codegen.execmodel.PackageSources.dumpSources (PackageSources.java:50)
    at org.drools.model.codegen.execmodel.processors.SourceCodeGenerationPhase.process (SourceCodeGenerationPhase.java:54)
    at org.drools.compiler.builder.impl.processors.IteratingPhase.process (IteratingPhase.java:53)
    at org.drools.model.codegen.execmodel.processors.ModelMainCompilationPhase.process (ModelMainCompilationPhase.java:104)
    at org.drools.model.codegen.execmodel.ModelBuilderImpl.doSecondBuildStep (ModelBuilderImpl.java:114)
    at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build (CompositeKnowledgeBuilderImpl.java:125)
    at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build (CompositeKnowledgeBuilderImpl.java:109)
    at org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages (AbstractKieProject.java:274)
    at org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages (AbstractKieProject.java:220)
    at org.drools.compiler.kie.builder.impl.AbstractKieProject.verify (AbstractKieProject.java:84)
    at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject (KieBuilderImpl.java:285)
    at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll (KieBuilderImpl.java:251)
    at org.kie.dmn.validation.bootstrap.GenerateModel.generate (GenerateModel.java:66)
    at org.kie.dmn.validation.bootstrap.ValidationBootstrapMain.main (ValidationBootstrapMain.java:51)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
    at java.lang.reflect.Method.invoke (Method.java:577)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:294)
    at java.lang.Thread.run (Thread.java:833)
yurloc commented 6 months ago

/take