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

getQueryResults behavior: return null

    XMLWordPrintable

    Details

      Description

      AS REPORTED BY GEOFFREY DE SMET:
      ---------------------------------------------------------
      Thanks Edson for fixing the getQueryResults() method in JBRULES-539.
      I found something interesting I'd like to bring under discussion:

      WorkingMemory.getQueryResults() returns null when:

      • no such query exists in the drl's. I would have expected an IllegalArgumentException, in the spirit of fail-fast,
        but it's not that big a deal.
      • but it also returns null when the query has 0 results.
        I would have expected a QueryResults instance with .size() == 0.
        It seems inconsistent with WorkingMemory.getObjects(X.class) which does return an empty list, instead of null.

      [tested on the branch for 3.0.x for Rete]

      What do you think?


      With kind regards,
      Geoffrey De Smet

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                tirelli Edson Tirelli
                Reporter:
                tirelli Edson Tirelli
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: