[
http://jira.jboss.com/jira/browse/JBRULES-1308?page=all ]
Edson Tirelli closed JBRULES-1308.
----------------------------------
Fix Version/s: 4.0.4
4.1.0
Resolution: Done
Fixed.
Thanks for reporting and providing test case.
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
Assigned To: Edson Tirelli
Fix For: 4.0.4, 4.1.0
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