[jboss-svn-commits] JBL Code SVN: r9497 - labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Feb 14 12:54:56 EST 2007


Author: tirelli
Date: 2007-02-14 12:54:56 -0500 (Wed, 14 Feb 2007)
New Revision: 9497

Modified:
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/BetaNode.java
Log:
JBRULES-675: fixing BetaNode equals method

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/BetaNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/BetaNode.java	2007-02-14 17:54:22 UTC (rev 9496)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/BetaNode.java	2007-02-14 17:54:56 UTC (rev 9497)
@@ -104,7 +104,7 @@
         this.leftInput = leftInput;
         this.rightInput = rightInput;
         this.constraints = constraints;
-        
+
         if ( this.constraints == null ) {
             throw new RuntimeException( "cannot have null constraints, must atleast be an instanceof EmptyBetaCosntraints" );
         }
@@ -218,13 +218,16 @@
             return true;
         }
 
-        if ( object == null || !( object instanceof BetaNode) ) {
+        if ( object == null || !(object instanceof BetaNode) ) {
             return false;
         }
 
         final BetaNode other = (BetaNode) object;
 
-        return this.leftInput.equals( other.leftInput ) && this.rightInput.equals( other.rightInput ) && this.constraints.equals( other.constraints );
+        return this.getClass() == other.getClass() &&
+               this.leftInput.equals( other.leftInput ) && 
+               this.rightInput.equals( other.rightInput ) && 
+               this.constraints.equals( other.constraints );
     }
 
     /**




More information about the jboss-svn-commits mailing list