Skip to content

Commit

Permalink
Ensuring that RuleTerminalNodeLeftTuple.equals never throws ClassCast…
Browse files Browse the repository at this point in the history
…Execption
  • Loading branch information
Marco Rietveld committed Dec 5, 2011
1 parent dacf528 commit 161365a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,12 @@ public boolean equals(final LeftTuple other) {
* @see org.drools.reteoo.LeftTuple#equals(java.lang.Object)
*/
public boolean equals(final Object object) {
// we know the object is never null and always of the type ReteTuple
return equals( (LeftTuple) object );
if( object instanceof LeftTuple ) {
return equals( (LeftTuple) object );
}
else {
return false;
}
}

/* (non-Javadoc)
Expand Down

0 comments on commit 161365a

Please sign in to comment.