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

Type coercion with Map.get() after jitting

    XMLWordPrintable

Details

    • 2019 Week 29-31
      • See PR unit test
    • NEW
    • NEW

    Description

      When comparing an Integer taken from Map.get() with a String, Mvel coerces the type so they are compared as Integers.

      For example, here $map.get("key") returns Integer 5, $status is String "10". So it doesn't match (expected).

      rule R when
        FactWithMap( $map : valueMap )
        Person( $status : status, $map.get("key") >= $status)
      then
      end
      

      However, after jitting, the constraint is evaluated as true so the rule is fired (unexpected).

      Attachments

        Issue Links

          Activity

            People

              mfusco@redhat.com Mario Fusco
              rhn-support-tkobayas Toshiya Kobayashi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: