<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Getting equals() and hashCode() right</title>
	<atom:link href="http://blog.palantirtech.com/2007/09/05/getting-equals-and-hashcode-right/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.palantirtech.com/2007/09/05/getting-equals-and-hashcode-right/</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Tue,  6 Jan 2009 21:46:24 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: cupofjoe</title>
		<link>http://blog.palantirtech.com/2007/09/05/getting-equals-and-hashcode-right/#comment-127</link>
		<dc:creator>cupofjoe</dc:creator>
		<pubDate>Fri, 05 Oct 2007 16:48:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.palantirtech.com/2007/09/05/getting-equals-and-hashcode-right/#comment-127</guid>
		<description>Another good question to add to your list.

How would you allow an object with ALL mutable fields to correctly be placed in a hash collection?

I ran into this once with a server person passing up a Hibernate object and he was using mutable fields for his hashCode.

While a solution for this problem totally destroys the hashes performance characteristics, sometimes you have to use this hack.

BTW

My answer was have hashCode() return .class.getName().hashCode()

This basically puts everything in the same hashbucket of this object type.  Not ideal but in certain edge cases this was the best solution I could come up with.</description>
		<content:encoded><![CDATA[<p>Another good question to add to your list.</p>
<p>How would you allow an object with ALL mutable fields to correctly be placed in a hash collection?</p>
<p>I ran into this once with a server person passing up a Hibernate object and he was using mutable fields for his hashCode.</p>
<p>While a solution for this problem totally destroys the hashes performance characteristics, sometimes you have to use this hack.</p>
<p>BTW</p>
<p>My answer was have hashCode() return .class.getName().hashCode()</p>
<p>This basically puts everything in the same hashbucket of this object type.  Not ideal but in certain edge cases this was the best solution I could come up with.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
