<?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 for Piotr Jagielski&#039;s Blog</title>
	<atom:link href="http://piotrjagielski.com/blog/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://piotrjagielski.com/blog</link>
	<description>Java Programming Tips &#38; Tricks</description>
	<lastBuildDate>Mon, 26 Mar 2012 23:07:11 +0200</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>Comment on Maintainable HashCode and Equals Using Apache Commons by Robert Sullivan</title>
		<link>http://piotrjagielski.com/blog/more-maintainable-hashcode-and-equals-using-apache-commons/comment-page-1/#comment-9637</link>
		<dc:creator>Robert Sullivan</dc:creator>
		<pubDate>Mon, 26 Mar 2012 23:07:11 +0000</pubDate>
		<guid isPermaLink="false">http://piotrjagielski.com/blog/?p=71#comment-9637</guid>
		<description>Thanks for this concise and succinct post!</description>
		<content:encoded><![CDATA[<p>Thanks for this concise and succinct post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Google Guava vs Apache Commons for Argument Validation by Naveen</title>
		<link>http://piotrjagielski.com/blog/google-guava-vs-apache-commons-for-argument-validation/comment-page-1/#comment-5629</link>
		<dc:creator>Naveen</dc:creator>
		<pubDate>Fri, 30 Sep 2011 13:11:27 +0000</pubDate>
		<guid isPermaLink="false">http://piotrjagielski.com/blog/?p=385#comment-5629</guid>
		<description>I want to do something like this:

checkNotNull(participantForExperiment, new ParticipantForExperimentNotFoundException(participantId, experimentId));

Instead of using an IF condition to check whether participantForExperiment is null and then throw Exception, i want a one-liner in Guava like i mentioned above. 

But i want to throw my own exception instead of NullPointerException if it is Null.

How can i do that in Guava?</description>
		<content:encoded><![CDATA[<p>I want to do something like this:</p>
<p>checkNotNull(participantForExperiment, new ParticipantForExperimentNotFoundException(participantId, experimentId));</p>
<p>Instead of using an IF condition to check whether participantForExperiment is null and then throw Exception, i want a one-liner in Guava like i mentioned above. </p>
<p>But i want to throw my own exception instead of NullPointerException if it is Null.</p>
<p>How can i do that in Guava?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Google Guava vs Apache Commons for Argument Validation by Rich</title>
		<link>http://piotrjagielski.com/blog/google-guava-vs-apache-commons-for-argument-validation/comment-page-1/#comment-5420</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Wed, 07 Sep 2011 15:08:50 +0000</pubDate>
		<guid isPermaLink="false">http://piotrjagielski.com/blog/?p=385#comment-5420</guid>
		<description>(I did end up here because of a Guava issue though, so clearly I&#039;m a fan of that too!)</description>
		<content:encoded><![CDATA[<p>(I did end up here because of a Guava issue though, so clearly I&#8217;m a fan of that too!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Google Guava vs Apache Commons for Argument Validation by Rich</title>
		<link>http://piotrjagielski.com/blog/google-guava-vs-apache-commons-for-argument-validation/comment-page-1/#comment-5419</link>
		<dc:creator>Rich</dc:creator>
		<pubDate>Wed, 07 Sep 2011 15:07:33 +0000</pubDate>
		<guid isPermaLink="false">http://piotrjagielski.com/blog/?p=385#comment-5419</guid>
		<description>(Late to the party...)

For commonly used validation I&#039;d be more inclined to use JSR 303 (Bean Validation) for which the reference implementation is Hibernate Validator 4. It uses similar annotations to OVal ... e.g. @NotNull and is a standard so various web, persistence, etc. frameworks can help maintain your validation requirements.

Validation on method parameters (and return types) didn&#039;t make it into that JSR, but there&#039;s a pending JSR349 which is looking at adding it, and there&#039;s an existing implementation in Hibernate Validator 4.2.</description>
		<content:encoded><![CDATA[<p>(Late to the party&#8230;)</p>
<p>For commonly used validation I&#8217;d be more inclined to use JSR 303 (Bean Validation) for which the reference implementation is Hibernate Validator 4. It uses similar annotations to OVal &#8230; e.g. @NotNull and is a standard so various web, persistence, etc. frameworks can help maintain your validation requirements.</p>
<p>Validation on method parameters (and return types) didn&#8217;t make it into that JSR, but there&#8217;s a pending JSR349 which is looking at adding it, and there&#8217;s an existing implementation in Hibernate Validator 4.2.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Working With Static Imports in Eclipse by Dayo</title>
		<link>http://piotrjagielski.com/blog/working-with-static-imports-in-eclipse/comment-page-1/#comment-3902</link>
		<dc:creator>Dayo</dc:creator>
		<pubDate>Thu, 31 Mar 2011 15:24:08 +0000</pubDate>
		<guid isPermaLink="false">http://piotrjagielski.com/blog/?p=305#comment-3902</guid>
		<description>Tanx. wasnt aware of dis.</description>
		<content:encoded><![CDATA[<p>Tanx. wasnt aware of dis.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Google Guava vs Apache Commons for Argument Validation by Piotr Jagielski</title>
		<link>http://piotrjagielski.com/blog/google-guava-vs-apache-commons-for-argument-validation/comment-page-1/#comment-3701</link>
		<dc:creator>Piotr Jagielski</dc:creator>
		<pubDate>Sat, 19 Mar 2011 09:04:14 +0000</pubDate>
		<guid isPermaLink="false">http://piotrjagielski.com/blog/?p=385#comment-3701</guid>
		<description>Saso,

Perhaps the word &lt;i&gt;requires&lt;/i&gt; is too strong. But IMO &lt;code&gt;Validate.isTrue&lt;/code&gt; looks nicer than &lt;code&gt;Preconditions.checkArgument&lt;/code&gt; because it reads more like a sentence in natural language. Just curious, why do you prefer not to use static imports?</description>
		<content:encoded><![CDATA[<p>Saso,</p>
<p>Perhaps the word <i>requires</i> is too strong. But IMO <code>Validate.isTrue</code> looks nicer than <code>Preconditions.checkArgument</code> because it reads more like a sentence in natural language. Just curious, why do you prefer not to use static imports?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Google Guava vs Apache Commons for Argument Validation by Saso</title>
		<link>http://piotrjagielski.com/blog/google-guava-vs-apache-commons-for-argument-validation/comment-page-1/#comment-3686</link>
		<dc:creator>Saso</dc:creator>
		<pubDate>Fri, 18 Mar 2011 14:24:27 +0000</pubDate>
		<guid isPermaLink="false">http://piotrjagielski.com/blog/?p=385#comment-3686</guid>
		<description>Piotr,

I don&#039;t understand your statement about Guava requires static import. I actually prefer not to use static import, and Preconditions.checkArgument works just fine.</description>
		<content:encoded><![CDATA[<p>Piotr,</p>
<p>I don&#8217;t understand your statement about Guava requires static import. I actually prefer not to use static import, and Preconditions.checkArgument works just fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Google Guava vs Apache Commons for Argument Validation by Charlie Collins</title>
		<link>http://piotrjagielski.com/blog/google-guava-vs-apache-commons-for-argument-validation/comment-page-1/#comment-3153</link>
		<dc:creator>Charlie Collins</dc:creator>
		<pubDate>Wed, 09 Feb 2011 16:10:37 +0000</pubDate>
		<guid isPermaLink="false">http://piotrjagielski.com/blog/?p=385#comment-3153</guid>
		<description>Sorry for the late reply, I just stumbled on this article today.

The reason it&#039;s better to include such a library goes beyond just the &quot;Preconditions/Validate&quot; stuff. There are many more tremendously useful things in Guava, and it&#039;s a relatively small library. If you JUST want the argument check, then you&#039;d probably be better off to write your own small utility class to handle that (or copy just Preconditions). 

The big advantage for me with Guava in general, over Apache-Commons, is the support for generics, and the clean, precise APIs, without the proliferation of &quot;what if&quot; methods  (already noted in several other comments), and how incredibly useful and powerful the Functions/Predicates/Collections stuff in there is. 

Combine Guava, with Guice, and JSR-305 annotations (@Nullable, etc), and you have a great minimalist Java SE stack that doesn&#039;t have to suck (Java isn&#039;t dead yet!).</description>
		<content:encoded><![CDATA[<p>Sorry for the late reply, I just stumbled on this article today.</p>
<p>The reason it&#8217;s better to include such a library goes beyond just the &#8220;Preconditions/Validate&#8221; stuff. There are many more tremendously useful things in Guava, and it&#8217;s a relatively small library. If you JUST want the argument check, then you&#8217;d probably be better off to write your own small utility class to handle that (or copy just Preconditions). </p>
<p>The big advantage for me with Guava in general, over Apache-Commons, is the support for generics, and the clean, precise APIs, without the proliferation of &#8220;what if&#8221; methods  (already noted in several other comments), and how incredibly useful and powerful the Functions/Predicates/Collections stuff in there is. </p>
<p>Combine Guava, with Guice, and JSR-305 annotations (@Nullable, etc), and you have a great minimalist Java SE stack that doesn&#8217;t have to suck (Java isn&#8217;t dead yet!).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Google Guava vs Apache Commons for Argument Validation by Thomas Ferris Nicolaisen</title>
		<link>http://piotrjagielski.com/blog/google-guava-vs-apache-commons-for-argument-validation/comment-page-1/#comment-3152</link>
		<dc:creator>Thomas Ferris Nicolaisen</dc:creator>
		<pubDate>Wed, 09 Feb 2011 16:04:48 +0000</pubDate>
		<guid isPermaLink="false">http://piotrjagielski.com/blog/?p=385#comment-3152</guid>
		<description>Neat! Added it to my growing list of &lt;a href=&quot;http://www.tfnico.com/presentations/google-guava&quot; rel=&quot;nofollow&quot;&gt;Google Guava resources&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Neat! Added it to my growing list of <a href="http://www.tfnico.com/presentations/google-guava" rel="nofollow">Google Guava resources</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Google Guava vs Apache Commons for Argument Validation by Piotr Jagielski</title>
		<link>http://piotrjagielski.com/blog/google-guava-vs-apache-commons-for-argument-validation/comment-page-1/#comment-1367</link>
		<dc:creator>Piotr Jagielski</dc:creator>
		<pubDate>Sat, 20 Nov 2010 00:49:41 +0000</pubDate>
		<guid isPermaLink="false">http://piotrjagielski.com/blog/?p=385#comment-1367</guid>
		<description>I think that main benefit is readability. For me additional imports statements are not a big deal. My IDE handles them pretty well.</description>
		<content:encoded><![CDATA[<p>I think that main benefit is readability. For me additional imports statements are not a big deal. My IDE handles them pretty well.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

