Hi,
I have a similar problem when using
objects from an external framework as facts : the equals method is invoked
despite using the WM_BEHAVIOR_IDENTITYproperty.
Here is an exmple reproducing this with
JBoss Rules 3.0.5 : I have created a JBoss Rules project under Eclipse,
and created 2 classes MyObject and MyObject2.
These classes have hashCode() returning
0 and equals throwing a ClassCastException when comparing 2 object of different
classes
Actually, after debugging a bit, it
seems that the equals method is invoked by the TruthMaintenanceSystem.assertMap,
which has a hardcoded EqualityKeyComparator (never set to IdentityKeyComparator).
The WorkingMemory.assertMap has its
KetComparator set correctly to IdentityKeyComparator
Also, the equals method is not called
when the hashCode() method returns different values for different objects,
which makes it a bit harder to reproduce the issue.
This is a roadblock for using JBoss
Rules in our context ; has someone any idea for a workaround?
Thanks in advance,
Guillaume
*************************************************************************
This message and any attachments (the "message") are confidential and intended solely for the addressee(s).
Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration.
Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified.
************
Ce message et toutes les pieces jointes (ci-apres le "message") sont confidentiels et etablis a l'intention exclusive de ses
destinataires. Toute utilisation ou diffusion non autorisee est interdite. Tout message electronique est susceptible d'alteration.
La SOCIETE GENERALE et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie.
*************************************************************************