-
Bug
-
Resolution: Done
-
Major
-
7.10.0.GA
-
False
-
False
-
-
-
-
-
-
CR1
-
+
-
-
-
2021 Week 10-12 (from Mar 8)
When building a rule (*1) that contains a parenthesized expression statement written in MVEL dialect like (*1-1) with executable model enabled, a compilation error occurs with the message like (*3) in RHDM 7.10.0 because the statement (*2) not allowable in Java language [1] is generated from (*1-1).
(*1)
package com.example.reproducer import java.math.BigDecimal dialect "mvel" rule "rule21a1" when $bus : Bus() then BigDecimal bd1 = 0; BigDecimal bd2 = bd1.add($bus.weight); (bd2 *= $bus.weight); // ........................... (\*1-1) System.out.println("***** " + $bus + ", weight = " + $bus.weight); System.out.println("***** bd2 = " + bd2); end
(*2) Java code generated from (*1-1) in RHDM 7.10.0
(bd2 *= $bus.weight);
(*3) Error message
02:46:10.576 [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile-1) @ reproducer_model_compiler_21a --- 02:46:10.579 [INFO] Changes detected - recompiling the module! 02:46:10.580 [INFO] Compiling 6 source files to /work2/testdir/reproducer_model_compiler_21a/target/classes 02:46:10.616 [INFO] ------------------------------------------------------------- 02:46:10.616 [ERROR] COMPILATION ERROR : 02:46:10.617 [INFO] ------------------------------------------------------------- 02:46:10.617 [ERROR] /work2/testdir/reproducer_model_compiler_21a/target/generated-sources/drools-model-compiler/main/java/com/example/reproducer/P9D/LambdaConsequence9D5AE9174B6338FFA1F398238E0AE1A8.java:[23,9] not a statement 02:46:10.617 [INFO] 1 error 02:46:10.617 [INFO] -------------------------------------------------------------
[1] The Java Language Specification Java SE 11 Edition - 14.8. Expression Statements
https://docs.oracle.com/javase/specs/jls/se11/html/jls-14.html#jls-14.8
- is cloned by
-
DROOLS-6091 A statement containing only a parenthesized expression written in MVEL dialect causes compilation error in executable model.
- Closed