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

String comparison fails when using the "==" comparator

    XMLWordPrintable

    Details

    • Steps to Reproduce:
      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

            Assignee:
            mproctor@redhat.com Mark Proctor
            Reporter:
            lhorton_jira Lisa Horton (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: