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

Avoid alpha node sharing with static method

XMLWordPrintable

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

      See SharingTest.testShouldAlphaShareBecauseSameConstantDespiteDifferentSyntax().

      value == 1
      

      and

      value == TestStaticUtils.return1()
      

      are shared when standard-drl. They have the same hashCode because it's calculated by fieldValue.

      This is wrong because we cannot guarantee that TestStaticUtils.return1() always returns 1. So we should not share the node in the case.

      Also the static method constraint should not be indexable (for both hash and range)

      age < StaticUtil.getThirty()
      

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

                Created:
                Updated:
                Resolved: