Author: manik.surtani(a)jboss.com
Date: 2008-05-01 12:18:03 -0400 (Thu, 01 May 2008)
New Revision: 14617
Modified:
core/trunk/core/src/main/java/org/hibernate/cache/QueryKey.java
Log:
Implement equals to deal with parameters of type other than QueryKey
Modified: core/trunk/core/src/main/java/org/hibernate/cache/QueryKey.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/cache/QueryKey.java 2008-05-01 12:55:52
UTC (rev 14616)
+++ core/trunk/core/src/main/java/org/hibernate/cache/QueryKey.java 2008-05-01 16:18:03
UTC (rev 14617)
@@ -51,7 +51,8 @@
}
public boolean equals(Object other) {
- QueryKey that = (QueryKey) other;
+ if (!(other instanceof QueryKey)) return false;
+ QueryKey that = (QueryKey) other;
if ( !sqlQueryString.equals(that.sqlQueryString) ) return false;
if ( !EqualsHelper.equals(firstRow, that.firstRow) || !EqualsHelper.equals(maxRows,
that.maxRows) ) return false;
if ( !EqualsHelper.equals(customTransformer, that.customTransformer) ) return false;