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

condition without variable sometimes generates wrong variable name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.41.0.Final
    • 8.39.0.Final
    • core engine
    • None
    • 2023 Week 24-26 (from Jun 12)
    • Hide

      Run testloop.bat until compilation fails

      Show
      Run testloop.bat until compilation fails
    • NEW
    • NEW
    • ---
    • ---

      We're using boolean conditions that are not bound to variables in our rules, e.g

      Boolean(this==false) from $Ist_ZAST 

      where $Ist_ZAST is defined in a parent rule.

      The generator sometimes produces a wrong variable name for this condition in the generated Java class, failing compilation with an error message like this

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project drl-condition-poc: Compilation failure: Compilation failure:
      [ERROR] /C:/Users/olmes/Desktop/drl-condition-poc/target/generated-sources/kogito/poc/Rules68afa638a7324764a84c84af0df88a9d_rule___15260__pruefe__Genehmigungszeitraum.java:[73,56] cannot find symbol
      [ERROR]   symbol:   variable var_GENERATED_$pattern_Boolean$2$
      [ERROR]   location: class poc.Rules68afa638a7324764a84c84af0df88a9d_rule___15260__pruefe__Genehmigungszeitraum
      [ERROR] /C:/Users/olmes/Desktop/drl-condition-poc/target/generated-sources/kogito/poc/Rules68afa638a7324764a84c84af0df88a9d_rule___15260__LerIkIst602561467.java:[73,56] cannot find symbol
      [ERROR]   symbol:   variable var_GENERATED_$pattern_Boolean$2$
      [ERROR]   location: class poc.Rules68afa638a7324764a84c84af0df88a9d_rule___15260__LerIkIst602561467
      [ERROR] /C:/Users/olmes/Desktop/drl-condition-poc/target/generated-sources/kogito/poc/Rules68afa638a7324764a84c84af0df88a9d_rule___15260__LerIkIst__nicht__602561467.java:[73,56] cannot find symbol
      [ERROR]   symbol:   variable var_GENERATED_$pattern_Boolean$2$
      [ERROR]   location: class poc.Rules68afa638a7324764a84c84af0df88a9d_rule___15260__LerIkIst__nicht__602561467 

      This error does not happen on every generator/compilation cycle but only "sometimes". It happens in our reproducer (see attached zip file) far less often than in our production code - the reproducer fails every third build while our production code only succeeds every fifth build.

              mfusco@redhat.com Mario Fusco
              dirk.olmes Dirk Olmes (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: