Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3584

String comparison fails when using the "==" comparator

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Hide

      See attached unit test. It is a netbeans project. You will have to modify the properties to reference your own system's jars. the project includes 4 drl files. One "adjustmentsFail.drl" reproduces the bug. The other 3 drl files demonstrate syntax changes that will work around the bug.

      Show
      See attached unit test. It is a netbeans project. You will have to modify the properties to reference your own system's jars. the project includes 4 drl files. One "adjustmentsFail.drl" reproduces the bug. The other 3 drl files demonstrate syntax changes that will work around the bug.

    Description

      String comparison using the == operator fails in some cases. "Fails" means the comparison should match but does not. Changing the condition to use equals() operator causes a successful match. I have observed this in both decision tables and in drl rules. I will attach a test case that reproduces the bug. There are workarounds to avoid the bug - the test case demonstrates 3 of them.

      Attachments

        Activity

          People

            mproctor@redhat.com Mark Proctor
            lhorton_jira Lisa Horton (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty