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

Type coercion with Map.get() after jitting

    Details

    • Sprint:
      2019 Week 29-31
    • Steps to Reproduce:
      • See PR unit test
    • Docs QE Status:
      NEW
    • QE Status:
      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).

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mfusco Mario Fusco
                  Reporter:
                  tkobayashi Toshiya Kobayashi
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: