[jboss-jira] [JBoss JIRA] Updated: (JBRULES-1308) getFactHandle with equality-based assert behavior

Adam Lewandowski (JIRA) jira-events at lists.jboss.org
Mon Oct 29 16:03:01 EDT 2007


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

Adam Lewandowski updated JBRULES-1308:
--------------------------------------

    Attachment: GetFactHandleWithEqualityTest.java

Unit test demonstrating expected behavior

> getFactHandle with equality-based assert behavior
> -------------------------------------------------
>
>                 Key: JBRULES-1308
>                 URL: http://jira.jboss.com/jira/browse/JBRULES-1308
>             Project: JBoss Drools
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 4.0.3
>            Reporter: Adam Lewandowski
>         Attachments: GetFactHandleWithEqualityTest.java
>
>
> If I set my rule base to use equality-based assert behavior, I'm expecting to be able to use the getFactHandle(object) method to retrieve a previously asserted fact by providing an equivalent (by equals() and hashCode()) object as an argument. This appears to not be the case, as AbstractWorkingMemory uses it's identityMap and associated IdentityAssertMapComparator to do the getFactHandle lookup instead of the assertMap and EqualityAssertMapComparator. This causes the lookup to be done with the system hashCode() method and not the overridden version supplied in my fact class. The lookup thus fails and returns null. 
> See attached unit test.

-- 
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