<?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: Easy toString/equals/hashcode</title>
	<atom:link href="http://technology.amis.nl/2004/08/30/easy-tostringequalshashcode/feed/" rel="self" type="application/rss+xml" />
	<link>http://technology.amis.nl/2004/08/30/easy-tostringequalshashcode/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=easy-tostringequalshashcode</link>
	<description></description>
	<lastBuildDate>Fri, 12 Apr 2013 10:04:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Free Credit Report</title>
		<link>http://technology.amis.nl/2004/08/30/easy-tostringequalshashcode/#comment-701</link>
		<dc:creator>Free Credit Report</dc:creator>
		<pubDate>Wed, 25 Apr 2007 16:59:55 +0000</pubDate>
		<guid isPermaLink="false">/?p=142#comment-701</guid>
		<description><![CDATA[&lt;strong&gt;Free Credit Report&lt;/strong&gt;

Nice blog! Great design and cool topics.]]></description>
		<content:encoded><![CDATA[<p><strong>Free Credit Report</strong></p>
<p>Nice blog! Great design and cool topics.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cyrill</title>
		<link>http://technology.amis.nl/2004/08/30/easy-tostringequalshashcode/#comment-700</link>
		<dc:creator>Cyrill</dc:creator>
		<pubDate>Tue, 12 Oct 2004 08:06:08 +0000</pubDate>
		<guid isPermaLink="false">/?p=142#comment-700</guid>
		<description><![CDATA[Mark your collections with the transient keyword and do not include them into the hash code.

public int hashCode() {
        return HashCodeBuilder.reflectionHashCode(this, false);
    }

Regards,

Cyrill]]></description>
		<content:encoded><![CDATA[<p>Mark your collections with the transient keyword and do not include them into the hash code.</p>
<p>public int hashCode() {<br />
        return HashCodeBuilder.reflectionHashCode(this, false);<br />
    }</p>
<p>Regards,</p>
<p>Cyrill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leon van Tegelen</title>
		<link>http://technology.amis.nl/2004/08/30/easy-tostringequalshashcode/#comment-699</link>
		<dc:creator>Leon van Tegelen</dc:creator>
		<pubDate>Mon, 30 Aug 2004 21:37:16 +0000</pubDate>
		<guid isPermaLink="false">/?p=142#comment-699</guid>
		<description><![CDATA[On the StringBuffer vs &quot;+&quot; issue. Check out these sites:
&lt;a href=&quot;http://www.javaworld.com/javaworld/jw-03-2000/jw-0324-javaperf.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;old (2000)&lt;/a&gt;
&lt;a href=&quot;http://wiki.java.net/bin/view/Javapedia/AlwaysUseStringBufferMisconception&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;newer (2003)&lt;/a&gt;
Or even &lt;a href=&quot;http://www.javaspecialists.co.za/archive/Issue068.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;this one &lt;/a&gt;. The compiler used also has an impact. I measured it and it checks out.

Using the StringBuffer or the &quot;+&quot; method depends on what you are doing. If you are appending in a loop use StringBuffer, if not the difference is neglectable. So when in doubt use StringBuffer I would say...]]></description>
		<content:encoded><![CDATA[<p>On the StringBuffer vs &#8220;+&#8221; issue. Check out these sites:<br />
<a href="http://www.javaworld.com/javaworld/jw-03-2000/jw-0324-javaperf.html" target="_blank" rel="nofollow">old (2000)</a><br />
<a href="http://wiki.java.net/bin/view/Javapedia/AlwaysUseStringBufferMisconception" target="_blank" rel="nofollow">newer (2003)</a><br />
Or even <a href="http://www.javaspecialists.co.za/archive/Issue068.html" target="_blank" rel="nofollow">this one </a>. The compiler used also has an impact. I measured it and it checks out.</p>
<p>Using the StringBuffer or the &#8220;+&#8221; method depends on what you are doing. If you are appending in a loop use StringBuffer, if not the difference is neglectable. So when in doubt use StringBuffer I would say&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leon van Tegelen</title>
		<link>http://technology.amis.nl/2004/08/30/easy-tostringequalshashcode/#comment-698</link>
		<dc:creator>Leon van Tegelen</dc:creator>
		<pubDate>Mon, 30 Aug 2004 18:29:36 +0000</pubDate>
		<guid isPermaLink="false">/?p=142#comment-698</guid>
		<description><![CDATA[Be sure to use commons-lang version 2.0. Oracle JDeveloper ships with an older version which does not have the builder package, I spend  a few frustrating moments figuring out what Ant was trying to tell me...]]></description>
		<content:encoded><![CDATA[<p>Be sure to use commons-lang version 2.0. Oracle JDeveloper ships with an older version which does not have the builder package, I spend  a few frustrating moments figuring out what Ant was trying to tell me&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AH</title>
		<link>http://technology.amis.nl/2004/08/30/easy-tostringequalshashcode/#comment-697</link>
		<dc:creator>AH</dc:creator>
		<pubDate>Mon, 30 Aug 2004 12:43:40 +0000</pubDate>
		<guid isPermaLink="false">/?p=142#comment-697</guid>
		<description><![CDATA[Using StringBuffer.append instead of + for efficiency reasons worked well for JDK 1.1. But the compiler is much better now.
This sequence String s = &quot;a&quot; + &quot;b&quot; + variable + &quot;x&quot;; is the same efficiency as using a StringBuffer.]]></description>
		<content:encoded><![CDATA[<p>Using StringBuffer.append instead of + for efficiency reasons worked well for JDK 1.1. But the compiler is much better now.<br />
This sequence String s = &#8220;a&#8221; + &#8220;b&#8221; + variable + &#8220;x&#8221;; is the same efficiency as using a StringBuffer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zeger Hendrikse</title>
		<link>http://technology.amis.nl/2004/08/30/easy-tostringequalshashcode/#comment-696</link>
		<dc:creator>Zeger Hendrikse</dc:creator>
		<pubDate>Mon, 30 Aug 2004 12:26:41 +0000</pubDate>
		<guid isPermaLink="false">/?p=142#comment-696</guid>
		<description><![CDATA[I also like Rod Johnson&#039;s approach, e.g.:

&lt;code&gt;
public String toString()
{
    StringBuffer sb = new StringBuffer(getClass().getName() + &quot;: &quot;);
    sb.append(&quot;Primary key=&quot; + id + &quot;; &quot;);
    sb.append(&quot;Surname=&#039;&quot; + getSurname() + &quot;&#039;; &quot;);
    sb.append(&quot;Forename=&#039;&quot; + getForename() + &quot;&#039;; &quot;);
    sb.append(&quot; systemHashcode=&quot; + System.identityHashCode());
    return sb.toString();
}
&lt;/code&gt;

Note the use of StringBuffer instead of using the &quot;+&quot; operator (efficiency!). I like the use of the apostrophes in particular, very useful in detecting leading or trailing white spaces!

But of course, if you have the avail over the Jakarta common&#039;s lang package, the posted version is much less work!]]></description>
		<content:encoded><![CDATA[<p>I also like Rod Johnson&#8217;s approach, e.g.:</p>
<p><code><br />
public String toString()<br />
{<br />
    StringBuffer sb = new StringBuffer(getClass().getName() + ": ");<br />
    sb.append("Primary key=" + id + "; ");<br />
    sb.append("Surname='" + getSurname() + "'; ");<br />
    sb.append("Forename='" + getForename() + "'; ");<br />
    sb.append(" systemHashcode=" + System.identityHashCode());<br />
    return sb.toString();<br />
}<br />
</code></p>
<p>Note the use of StringBuffer instead of using the &#8220;+&#8221; operator (efficiency!). I like the use of the apostrophes in particular, very useful in detecting leading or trailing white spaces!</p>
<p>But of course, if you have the avail over the Jakarta common&#8217;s lang package, the posted version is much less work!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
