From ae40e5a70f62456ed89b263f9c5cb4542487fc78 Mon Sep 17 00:00:00 2001 From: Manik Surtani Date: Thu, 1 May 2008 16:18:03 +0000 Subject: [PATCH] Implement equals to deal with parameters of type other than QueryKey git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@14617 1b8cb986-b30d-0410-93ca-fae66ebed9b2 --- core/src/main/java/org/hibernate/cache/QueryKey.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/hibernate/cache/QueryKey.java b/core/src/main/java/org/hibernate/cache/QueryKey.java index 8bb5a806aa..7d774cad21 100644 --- a/core/src/main/java/org/hibernate/cache/QueryKey.java +++ b/core/src/main/java/org/hibernate/cache/QueryKey.java @@ -51,7 +51,8 @@ public class QueryKey implements Serializable { } 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;