<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-3339316202894508517.post6778539089061796581..comments</id><updated>2008-09-08T09:51:44.815-07:00</updated><title type='text'>Comments on Duffblog 2.0: Java Blooper #1: Ternary Insanity</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.dubh.org/feeds/6778539089061796581/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default'/><link rel='alternate' type='text/html' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html'/><author><name>Brian Duff</name><uri>http://www.blogger.com/profile/15591692569924908268</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3339316202894508517.post-4793846065460255379</id><published>2008-09-08T09:51:00.000-07:00</published><updated>2008-09-08T09:51:00.000-07:00</updated><title type='text'>@mark, that's not the case. There's no way to muta...</title><content type='html'>@mark, that's not the case. There's no way to mutate the _visible field if its value is directly returned from isVisible().</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/4793846065460255379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/4793846065460255379'/><link rel='alternate' type='text/html' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html?showComment=1220892660000#c4793846065460255379' title=''/><author><name>Brian Duff</name><uri>http://www.blogger.com/profile/15591692569924908268</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='18398815340940756707'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html' ref='tag:blogger.com,1999:blog-3339316202894508517.post-6778539089061796581' source='http://www.blogger.com/feeds/3339316202894508517/posts/default/6778539089061796581' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3339316202894508517.post-3220657359807245780</id><published>2008-09-07T18:55:00.000-07:00</published><updated>2008-09-07T18:55:00.000-07:00</updated><title type='text'>someone suggested simply "return _visible;" this m...</title><content type='html'>someone suggested simply "return _visible;" this may give an outsider intimate access to a private variable.&lt;BR/&gt;&lt;BR/&gt;class Thing {&lt;BR/&gt;  private boolean _visible;&lt;BR/&gt;&lt;BR/&gt;  boolean isVisible() {&lt;BR/&gt;    boolean copy = _visible;&lt;BR/&gt;    return copy;&lt;BR/&gt;  }&lt;BR/&gt;}</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/3220657359807245780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/3220657359807245780'/><link rel='alternate' type='text/html' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html?showComment=1220838900000#c3220657359807245780' title=''/><author><name>mark</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html' ref='tag:blogger.com,1999:blog-3339316202894508517.post-6778539089061796581' source='http://www.blogger.com/feeds/3339316202894508517/posts/default/6778539089061796581' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3339316202894508517.post-6735833761884756515</id><published>2008-04-30T05:32:00.000-07:00</published><updated>2008-04-30T05:32:00.000-07:00</updated><title type='text'>"Remember that the object being referenced in the ...</title><content type='html'>"Remember that the object being referenced in the foreach loop can NEVER be null"&lt;BR/&gt;&lt;BR/&gt;&gt;&gt; This is wrong. The non-nullness has nothing to do with the foreach loop as this code proves:&lt;BR/&gt;&lt;BR/&gt;for (String s : new String[] { null }) {&lt;BR/&gt;  System.out.println(s == null);&lt;BR/&gt;}&lt;BR/&gt;&lt;BR/&gt;prints out: true</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/6735833761884756515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/6735833761884756515'/><link rel='alternate' type='text/html' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html?showComment=1209558720000#c6735833761884756515' title=''/><author><name>krizzdewizz</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html' ref='tag:blogger.com,1999:blog-3339316202894508517.post-6778539089061796581' source='http://www.blogger.com/feeds/3339316202894508517/posts/default/6778539089061796581' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3339316202894508517.post-7159153208256963256</id><published>2008-03-18T02:40:00.000-07:00</published><updated>2008-03-18T02:40:00.000-07:00</updated><title type='text'>This is our new star java developer:Remember that ...</title><content type='html'>This is our new star java developer:&lt;BR/&gt;&lt;BR/&gt;Remember that the object being referenced in the foreach loop can NEVER be null:&lt;BR/&gt;&lt;BR/&gt;for (Element e : l.getElements())&lt;BR/&gt;{&lt;BR/&gt;    if (e == null) continue;&lt;BR/&gt;    &lt;BR/&gt;    ...&lt;BR/&gt;}&lt;BR/&gt;&lt;BR/&gt;WTF?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/7159153208256963256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/7159153208256963256'/><link rel='alternate' type='text/html' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html?showComment=1205833200000#c7159153208256963256' title=''/><author><name>Ian</name><uri>http://www.blogger.com/profile/13830563098655127121</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html' ref='tag:blogger.com,1999:blog-3339316202894508517.post-6778539089061796581' source='http://www.blogger.com/feeds/3339316202894508517/posts/default/6778539089061796581' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3339316202894508517.post-6507471399391839572</id><published>2007-11-13T06:25:00.000-08:00</published><updated>2007-11-13T06:25:00.000-08:00</updated><title type='text'>I consider this a blooper too:if (a little bit com...</title><content type='html'>I consider this a blooper too:&lt;BR/&gt;&lt;BR/&gt;if (a little bit complex boolean expression) {&lt;BR/&gt;   return true;&lt;BR/&gt;}&lt;BR/&gt;else {&lt;BR/&gt;   return false;&lt;BR/&gt;}&lt;BR/&gt;better alternative:&lt;BR/&gt;return (a little bit complex boolean expression);</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/6507471399391839572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/6507471399391839572'/><link rel='alternate' type='text/html' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html?showComment=1194963900000#c6507471399391839572' title=''/><author><name>Daniel</name><uri>http://www.blogger.com/profile/07202802074943648100</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html' ref='tag:blogger.com,1999:blog-3339316202894508517.post-6778539089061796581' source='http://www.blogger.com/feeds/3339316202894508517/posts/default/6778539089061796581' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3339316202894508517.post-3205607814043580364</id><published>2007-10-04T11:00:00.000-07:00</published><updated>2007-10-04T11:00:00.000-07:00</updated><title type='text'>return visible;</title><content type='html'>return visible;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/3205607814043580364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/3205607814043580364'/><link rel='alternate' type='text/html' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html?showComment=1191520800000#c3205607814043580364' title=''/><author><name>Naveed</name><uri>http://www.blogger.com/profile/10461737714769173158</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html' ref='tag:blogger.com,1999:blog-3339316202894508517.post-6778539089061796581' source='http://www.blogger.com/feeds/3339316202894508517/posts/default/6778539089061796581' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3339316202894508517.post-2854426112799544938</id><published>2007-08-13T18:50:00.000-07:00</published><updated>2007-08-13T18:50:00.000-07:00</updated><title type='text'>ugg: which is the long-hand version of the origina...</title><content type='html'>ugg: which is the long-hand version of the original post.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/2854426112799544938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/2854426112799544938'/><link rel='alternate' type='text/html' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html?showComment=1187056200000#c2854426112799544938' title=''/><author><name>jawild59</name><uri>http://javabargrill.wordpress.com</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html' ref='tag:blogger.com,1999:blog-3339316202894508517.post-6778539089061796581' source='http://www.blogger.com/feeds/3339316202894508517/posts/default/6778539089061796581' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3339316202894508517.post-4282559192832156450</id><published>2007-08-13T18:06:00.000-07:00</published><updated>2007-08-13T18:06:00.000-07:00</updated><title type='text'>I have seen:if (_visible == true) {    return true...</title><content type='html'>I have seen:&lt;BR/&gt;&lt;BR/&gt;if (_visible == true) {&lt;BR/&gt;    return true;&lt;BR/&gt;} else {&lt;BR/&gt;    return false;&lt;BR/&gt;}</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/4282559192832156450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/4282559192832156450'/><link rel='alternate' type='text/html' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html?showComment=1187053560000#c4282559192832156450' title=''/><author><name>ugg</name><uri>http://www.blogger.com/profile/08488728158299589517</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html' ref='tag:blogger.com,1999:blog-3339316202894508517.post-6778539089061796581' source='http://www.blogger.com/feeds/3339316202894508517/posts/default/6778539089061796581' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-3339316202894508517.post-498047293687498372</id><published>2007-08-13T16:47:00.000-07:00</published><updated>2007-08-13T16:47:00.000-07:00</updated><title type='text'>or how about this...if (_visible) {  return new Bo...</title><content type='html'>or how about this...&lt;BR/&gt;&lt;BR/&gt;if (_visible) {&lt;BR/&gt;&amp;nbsp;&amp;nbsp;return new Boolean(true);&lt;BR/&gt;} else {&lt;BR/&gt;&amp;nbsp;&amp;nbsp;return new Boolean(false);&lt;BR/&gt;}</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/498047293687498372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3339316202894508517/6778539089061796581/comments/default/498047293687498372'/><link rel='alternate' type='text/html' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html?showComment=1187048820000#c498047293687498372' title=''/><author><name>jawild59</name><uri>http://javabargrill.wordpress.com</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.dubh.org/2007/08/java-blooper-1-ternary-insanity.html' ref='tag:blogger.com,1999:blog-3339316202894508517.post-6778539089061796581' source='http://www.blogger.com/feeds/3339316202894508517/posts/default/6778539089061796581' type='text/html'/></entry></feed>