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

Second accumulate produces a wrong result

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.46.0.Final
    • 7.45.0.Final
    • core engine
    • None
    • 2020 Week 43-45 (from Okt 19)
    • 2
      • Unit test AccumulateTest.testDoubleAccumulateNPE() is updated in the PR
    • Undefined
    • NEW
    • NEW
    • ---
    • ---

    Description

      DROOLS-5786 solved the NPE but the second accumulate (in AccumulateTest.testDoubleAccumulateNPE()) produces a wrong result (= 0 instead of 2). 2 points to be fixed:

      1. RuleNetworkEvaluator.doUpdatesReorderLeftMemory() causes wrong LeftTupleMemory size when calling TupleList.remove() for a tuple which doesn't exist in the list. (When removed, size becomes -1. Then added, size becomes 0. so the leftTuple is not evaluated in doRightInserts() : https://github.com/kiegroup/drools/blob/master/drools-core/src/main/java/org/drools/core/phreak/PhreakAccumulateNode.java#L215 )

      2. Creating AccumulateContext right before evaluateResultConstraints() is too late. It is used by addMatch() so it needs to be created earlier (e.g. in doLeftUpdates())

      Attachments

        Issue Links

          Activity

            People

              rhn-support-tkobayas Toshiya Kobayashi
              rhn-support-tkobayas Toshiya Kobayashi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: