[jboss-jira] [JBoss JIRA] Resolved: (JBRULES-544) getQueryResults behavior: return null

Edson Tirelli (JIRA) jira-events at jboss.com
Wed Nov 8 17:09:41 EST 2006


     [ http://jira.jboss.com/jira/browse/JBRULES-544?page=all ]

Edson Tirelli resolved JBRULES-544.
-----------------------------------

    Resolution: Done

As discussed in the mail list, QueryResults will now return an empty list instead of null when the query returns no results and WorkingMemory will raise an IllegalArgumentException when getQueryResults is called with a non-existing query name.

Commited into 3.0.x branch in revision #7486:
----------------------------------------------------
Sending        drools-core/src/main/java/org/drools/reteoo/QueryTerminalNode.java
Sending        drools-core/src/main/java/org/drools/reteoo/ReteooWorkingMemory.java
Sending        drools-core/src/test/java/org/drools/reteoo/QueryTerminalNodeTest.java
Transmitting file data ...
Committed revision 7486.
----------------------------------------------------

Commited into trunk in revision #7488:
----------------------------------------------------
Sending        drools-core/src/main/java/org/drools/reteoo/QueryTerminalNode.java
Sending        drools-core/src/main/java/org/drools/reteoo/ReteooWorkingMemory.java
Sending        drools-core/src/test/java/org/drools/reteoo/QueryTerminalNodeTest.java
Transmitting file data ...
Committed revision 7488.
----------------------------------------------------


> getQueryResults behavior: return null 
> --------------------------------------
>
>                 Key: JBRULES-544
>                 URL: http://jira.jboss.com/jira/browse/JBRULES-544
>             Project: JBoss Rules
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: Reteoo
>    Affects Versions: 3.0.4
>            Reporter: Edson Tirelli
>         Assigned To: Edson Tirelli
>             Fix For: 3.0.5, 3.1-m1
>
>
> 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 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list