[
http://jira.jboss.com/jira/browse/JBRULES-573?page=comments#action_12367832 ]
Mark Proctor commented on JBRULES-573:
--------------------------------------
yes that is incorrect, but it looks like that method isn't used at all.
Also we've changed it to instanceof FactHandle - so should be ok now. This was because
we believed that "object.getClass() == MyClass.class" was faster than an
instanceof, this is no longer the case for modern JVMs.
EqualityAssertMapComparator does not work with JSR94 Fact Handles
-----------------------------------------------------------------
Key: JBRULES-573
URL:
http://jira.jboss.com/jira/browse/JBRULES-573
Project: JBoss Rules
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Affects Versions: 3.0.5
Environment: java 1.5.0_09
Reporter: Juergen none
Assigned To: Mark Proctor
Fix For: 4.0.0.MR4
Equal objects are asserted multiple times via jsr94 interface
Using jsr94 interface to use drools stateful rule session
Assert behaviour set to equality:
PROPERTY_ASSERT_BEHAVIOR = RuleBaseConfiguration.WM_BEHAVIOR_EQUALITY
fact handle factory creates org.drools.jsr94.rules.Jsr94FactHandle objects
BUT:
org.drools.common.EqualityAssertMapComparator::hashCodeOf()
obj.getClass() == this.factHandleClass is false because
this.factHandleClass is DefaultFactHandle and
obj.getClass() is Jsr94FactHandle
--> so instead of hashcode of object wrapped by handle, hashcode of facthandle object
is used --> equal objects are asserted multiple times
GUESS: either
- obj.getClass() instanceof this.factHandleClass or
- this.factHandleClass should be set to Jsr94FactHandle?
--
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