Eeek!<br><br>Assume this: A is a field of B is a field of C is a field of D is a... <br><br>Object references remain the same, in all objects; I simply modify A, and<br>"when you change [A] you are also changing [B], so I must notify the<br>
engine for [B]" but that's a field of C... D... E... and so on, until<br>'I' for infinity?!<br><br><u><b><i>It's just a change in some fact object's hashCode that causes this problem.</i></b></u><br>
<br>-W<br><br><br><br>On 22 June 2011 22:37, Mark Proctor <<a href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>> wrote:<br>> As One is a field of Two. When you change One you are also changing Two, so<br>
> you most notify the engine for Two too.<br>><br>> MArk<br>> On 22/06/2011 14:37, Wolfgang Laun wrote:<br>><br>> To avoid misunderstandings: yes, equals() is written according to hashCode,<br>> i.e., according to the usual Java conventions.<br>
><br>> If<br>><br>> - an object of class Two contains a member of class One, and<br>> - one object Two and one object One are facts, and<br>> - a rule modifies One, changing its hashCode<br>><br>
> then<br>><br>> another rule containing the patterns<br>> $one: One()<br>> $two: Two( $x: one == $one )<br>><br>> does NOT fire (any more).<br>><br>> If you use the constraint<br>> one == $one || != $one<br>
> the rule will fire, and you can observe that hashCode results for $one and<br>> $x are the same and that $one.equals( $x ) returns true.<br>><br>> Reproduced using 5.1.1 and 5.2.x<br>><br>> -W<br>><br>
><br>><br>><br>> _______________________________________________<br>> rules-dev mailing list<br>> <a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>> <a href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
><br>><br>> _______________________________________________<br>> rules-dev mailing list<br>> <a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>> <a href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
><br>><br><br>