Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-6421

More Constraints with Complex Abbreviated Combined Relations Fail to Compile with Executable Model

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 7.55.0.Final
    • core engine
    • None
    • 2021 Week 25-27 (from Jun 21), 2021 Week 28-30 (from Jul 12)
    • Hide

      Run:

      mvn clean test
      

      on attached reproducer.

      Show
      Run: mvn clean test on attached reproducer.
    • Undefined
    • NEW
    • NEW

      This is related to DROOLS-6006.

      Constraints with complex abbreviated combined relations such as:

          declare Fact1
              x : String
          end
          Fact1(x ((>= "340000" && <= "340000")||(>= "370000" && <= "370000")))
      

      fail to compile with executable model due to the following error:

          Message [id=1, level=ERROR, path=src/main/java/org/build/example/rules/P5B/LambdaPredicate5B28F641C1CB4D09E0C10863EFC1EFB3.java, line=20, column=29
             text=bad operand types for binary operator '>='
             first type:  java.lang.String
             second type: java.lang.String
      

      Constraints with complex abbreviated combined relations such as:

          declare Fact2
              y : String
          end
          declare Fact1
              x : Fact2
          end
          Fact1(x!.y ((>= \"340000\" && <= \"340000\") || ( >= \"370000\" && <= \"370000\")))
      

      fail to compile with executable model due to the following StackOverflowError:

          java.lang.StackOverflowError
      	at java.base/java.util.LinkedList.get(LinkedList.java:481)
      	at com.github.javaparser.ast.Node.setParentNode(Node.java:388)
      	at com.github.javaparser.ast.Node.setAsParentNodeOf(Node.java:403)
      	at com.github.javaparser.ast.expr.BinaryExpr.setLeft(BinaryExpr.java:174)
      	at com.github.javaparser.ast.expr.BinaryExpr.<init>(BinaryExpr.java:131)
      	at com.github.javaparser.ast.expr.BinaryExpr.<init>(BinaryExpr.java:122)
      	at org.drools.modelcompiler.builder.generator.DrlxParseUtil.trasformHalfBinaryToBinary(DrlxParseUtil.java:360)
      	at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpressionRec(ExpressionTyper.java:208)
      	at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpressionRec(ExpressionTyper.java:199)
      	at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpressionRec(ExpressionTyper.java:209)
      	at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpressionRec(ExpressionTyper.java:199)
      	at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpressionRec(ExpressionTyper.java:209)
      	at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpressionRec(ExpressionTyper.java:199)
      	at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpressionRec(ExpressionTyper.java:209)
      	at org.drools.modelcompiler.builder.generator.expressiontyper.ExpressionTyper.toTypedExpressionRec(ExpressionTyper.java:199)
          ...
      

      The compilation works fine without executable model.

              mfusco@redhat.com Mario Fusco
              mcasalino Matteo Casalino (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: