diff options
author | Mark Spruiell <mes@zeroc.com> | 2006-01-11 22:20:47 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2006-01-11 22:20:47 +0000 |
commit | 9ce7664c50e5a3a7076b223fa9fafe11cc3d0fee (patch) | |
tree | da8e49c37aa6d2122b49ddde0ff7298e1b92b3ac /java/src/Ice/ProxyIdentityKey.java | |
parent | file rtf.hdr was initially added on branch R3_0_branch. (diff) | |
download | ice-9ce7664c50e5a3a7076b223fa9fafe11cc3d0fee.tar.bz2 ice-9ce7664c50e5a3a7076b223fa9fafe11cc3d0fee.tar.xz ice-9ce7664c50e5a3a7076b223fa9fafe11cc3d0fee.zip |
fixing bug 732: equals() can raise ClassCastException
Diffstat (limited to 'java/src/Ice/ProxyIdentityKey.java')
-rw-r--r-- | java/src/Ice/ProxyIdentityKey.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/java/src/Ice/ProxyIdentityKey.java b/java/src/Ice/ProxyIdentityKey.java index 316bbefd7c1..e3e394091f9 100644 --- a/java/src/Ice/ProxyIdentityKey.java +++ b/java/src/Ice/ProxyIdentityKey.java @@ -37,8 +37,18 @@ public class ProxyIdentityKey public boolean equals(java.lang.Object obj) { - ProxyIdentityKey other = (ProxyIdentityKey)obj; - return (_hashCode == other._hashCode) && _identity.equals(other._identity); + if(this == obj) + { + return true; + } + + if(obj instanceof ProxyIdentityKey) + { + ProxyIdentityKey other = (ProxyIdentityKey)obj; + return (_hashCode == other._hashCode) && _identity.equals(other._identity); + } + + return false; } public Ice.ObjectPrx |