<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Hashtable Collisions and String Hashcode</title>
	<atom:link href="http://www.shankh.com/2010/05/13/hashtable-collisions-and-string-hashcode/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shankh.com/2010/05/13/hashtable-collisions-and-string-hashcode/</link>
	<description>Where you search Begins...</description>
	<lastBuildDate>Thu, 12 Jan 2012 19:28:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: admin</title>
		<link>http://www.shankh.com/2010/05/13/hashtable-collisions-and-string-hashcode/comment-page-1/#comment-7480</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sun, 09 Jan 2011 12:42:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.shankh.com/?p=159#comment-7480</guid>
		<description>@hixxxxx . You are absolutely correct.  System.identityHashcode is not guaranteed to produce unique hashcodes and in a 64 bit system there is high chance of collisions.  One has to implement a proper equals method to maintain hashtable data integrity.  My example was just to explain hashtable collisions and I made it clear that people should use the proper way of equals implementation as mentioned here http://www.ibm.com/developerworks/java/library/j-jtp05273.html</description>
		<content:encoded><![CDATA[<p>@hixxxxx . You are absolutely correct.  System.identityHashcode is not guaranteed to produce unique hashcodes and in a 64 bit system there is high chance of collisions.  One has to implement a proper equals method to maintain hashtable data integrity.  My example was just to explain hashtable collisions and I made it clear that people should use the proper way of equals implementation as mentioned here <a href="http://www.ibm.com/developerworks/java/library/j-jtp05273.html" rel="nofollow">http://www.ibm.com/developerworks/java/library/j-jtp05273.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hixxxxx</title>
		<link>http://www.shankh.com/2010/05/13/hashtable-collisions-and-string-hashcode/comment-page-1/#comment-5772</link>
		<dc:creator>hixxxxx</dc:creator>
		<pubDate>Thu, 02 Dec 2010 10:23:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.shankh.com/?p=159#comment-5772</guid>
		<description>Hi,

your implementation with the hashcode= System.identityHashCode(this);  is still combersome! identityHashCode(this), which falls back to Object.hashCode is still a hashcode and may collide (to different Objects (here: key1 &amp; key2) can have the same hashcode! This is rare but happens if you deal with loads of data). Since your equals method does not look into a value, but only operates with the hashcode, you would get a problem when you deal with several tens of thousands of objects (it might be, that on 64bit systems where the object pointer is a long collisions become extremly rare, but there is no guaranty for that!)

Best
 g</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>your implementation with the hashcode= System.identityHashCode(this);  is still combersome! identityHashCode(this), which falls back to Object.hashCode is still a hashcode and may collide (to different Objects (here: key1 &amp; key2) can have the same hashcode! This is rare but happens if you deal with loads of data). Since your equals method does not look into a value, but only operates with the hashcode, you would get a problem when you deal with several tens of thousands of objects (it might be, that on 64bit systems where the object pointer is a long collisions become extremly rare, but there is no guaranty for that!)</p>
<p>Best<br />
 g</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.shankh.com/2010/05/13/hashtable-collisions-and-string-hashcode/comment-page-1/#comment-1717</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 14 May 2010 16:13:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.shankh.com/?p=159#comment-1717</guid>
		<description>Program updated and entry rewritten. As usual your comments are welcome</description>
		<content:encoded><![CDATA[<p>Program updated and entry rewritten. As usual your comments are welcome</p>
]]></content:encoded>
	</item>
</channel>
</rss>

