-
Bug
-
Resolution: Done
-
Minor
-
None
-
7.24.0.Final
-
2019 Week 29-31, 2019 Week 32-34
-
3
-
-
NEW
-
NEW
If we miss a semicolon in init() of "from accumulate",
for example)
import org.drools.modelcompiler.domain.Person; rule R when $sum : Integer() from accumulate ( Person( age > 18, $age : age ), init( int sum = 0 ), action( sum += $age; ), reverse( sum -= $age; ), result( sum ) ) then insert($sum); end
- Not executable-model -> The DRL is compiled and executed successfully
- Executable-model -> Throws ParseProblemException
com.github.javaparser.ParseProblemException: (line 1,col 12) Parse error. Found "}", expected one of "!=" "%" "%=" "&" "&&" "&=" "*" "*=" "+" "+=" "," "-" "-=" "->" "/" "/=" "::" ";" "<" "<<=" "<=" "=" "==" ">" ">=" ">>=" ">>>=" "?" "^" "^=" "instanceof" "|" "|=" "||" Problem stacktrace : com.github.javaparser.GeneratedJavaParser.generateParseException(GeneratedJavaParser.java:10567) com.github.javaparser.GeneratedJavaParser.jj_consume_token(GeneratedJavaParser.java:10426) com.github.javaparser.GeneratedJavaParser.BlockStatement(GeneratedJavaParser.java:3847) com.github.javaparser.GeneratedJavaParser.Statements(GeneratedJavaParser.java:1644) com.github.javaparser.GeneratedJavaParser.Block(GeneratedJavaParser.java:3822) com.github.javaparser.GeneratedJavaParser.BlockParseStart(GeneratedJavaParser.java:5687) com.github.javaparser.JavaParser.parse(JavaParser.java:115) com.github.javaparser.JavaParser.parseBlock(JavaParser.java:309) com.github.javaparser.StaticJavaParser.parseBlock(StaticJavaParser.java:240) org.drools.modelcompiler.builder.generator.visitor.accumulate.AccumulateVisitor.visitAccInlineCustomCode(AccumulateVisitor.java:434) ...
I'm not very sure how it should be fixed. I filed this because of discrepancy between Executable-model and Not executable-model
Poosible choices are:
- Fail even in case of Not executable-model
- Success in case of Executable-model
Additonal Note: If we miss a semicolon in action(), a more understandable error message is thrown.
[Message [id=1, kieBase=defaultKieBase, level=ERROR, path=r0.drl, line=2, column=0 text=Rule Compilation error Syntax error, insert ":: IdentifierOrNew" to complete Expression Syntax error, insert ";" to complete Statement]]
- is incorporated by
-
RHDM-1032 Compilation error for "from accumulate" init() with executable-model or not
- Closed