<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for Deep into Java</title>
	<atom:link href="http://deepjava.wordpress.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://deepjava.wordpress.com</link>
	<description>Thoughts about Java and related technologies</description>
	<lastBuildDate>Fri, 04 Sep 2009 04:09:06 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Playing around with exception stack traces by Deepak Anupalli</title>
		<link>http://deepjava.wordpress.com/2007/08/01/playing-around-with-exception-stack-traces/#comment-1506</link>
		<dc:creator>Deepak Anupalli</dc:creator>
		<pubDate>Fri, 04 Sep 2009 04:09:06 +0000</pubDate>
		<guid isPermaLink="false">http://deepjava.wordpress.com/2007/08/01/playing-around-with-exception-stack-traces/#comment-1506</guid>
		<description>Thanks Bill.</description>
		<content:encoded><![CDATA[<p>Thanks Bill.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Playing around with exception stack traces by Bill Bartmann</title>
		<link>http://deepjava.wordpress.com/2007/08/01/playing-around-with-exception-stack-traces/#comment-1505</link>
		<dc:creator>Bill Bartmann</dc:creator>
		<pubDate>Fri, 04 Sep 2009 01:10:18 +0000</pubDate>
		<guid isPermaLink="false">http://deepjava.wordpress.com/2007/08/01/playing-around-with-exception-stack-traces/#comment-1505</guid>
		<description>Cool site, love the info.</description>
		<content:encoded><![CDATA[<p>Cool site, love the info.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Type Safe Enumerations in Java 5.0 by Allaa</title>
		<link>http://deepjava.wordpress.com/2006/11/21/type-safe-enumerations-in-java-50/#comment-1504</link>
		<dc:creator>Allaa</dc:creator>
		<pubDate>Tue, 07 Apr 2009 20:42:09 +0000</pubDate>
		<guid isPermaLink="false">http://deepjava.wordpress.com/2006/11/21/type-safe-enumerations-in-java-50/#comment-1504</guid>
		<description>Very good and comprehensive article</description>
		<content:encoded><![CDATA[<p>Very good and comprehensive article</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Understanding Generics with Collections by Kiran</title>
		<link>http://deepjava.wordpress.com/2006/12/22/understanding-generics-with-collections-2/#comment-1503</link>
		<dc:creator>Kiran</dc:creator>
		<pubDate>Sat, 21 Mar 2009 07:04:31 +0000</pubDate>
		<guid isPermaLink="false">http://deepjava.wordpress.com/2006/12/22/understanding-generics-with-collections-2/#comment-1503</guid>
		<description>Very Good Article.</description>
		<content:encoded><![CDATA[<p>Very Good Article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Bootstrapping static fields within enums by Enum and other Java 5 tricks …</title>
		<link>http://deepjava.wordpress.com/2006/12/08/bootstrapping-static-fields-within-enums/#comment-1502</link>
		<dc:creator>Enum and other Java 5 tricks …</dc:creator>
		<pubDate>Sun, 01 Feb 2009 09:54:47 +0000</pubDate>
		<guid isPermaLink="false">http://deepjava.wordpress.com/2006/12/08/bootstrapping-static-fields-within-enums/#comment-1502</guid>
		<description>[...] Deepak has finally started blogging at Deep into Java. He has been sharing some neat tricks like Bootstrapping static fields within enums. [...]</description>
		<content:encoded><![CDATA[<p>[...] Deepak has finally started blogging at Deep into Java. He has been sharing some neat tricks like Bootstrapping static fields within enums. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Bootstrapping static fields within enums by Deepak Anupalli</title>
		<link>http://deepjava.wordpress.com/2006/12/08/bootstrapping-static-fields-within-enums/#comment-1501</link>
		<dc:creator>Deepak Anupalli</dc:creator>
		<pubDate>Fri, 16 Jan 2009 10:56:06 +0000</pubDate>
		<guid isPermaLink="false">http://deepjava.wordpress.com/2006/12/08/bootstrapping-static-fields-within-enums/#comment-1501</guid>
		<description>Hi,

This is an interesting case, where you can access a static field while the Enum instance is being constructed though not directly through the constructor.

I tried to compile this piece of code on JDK 1.5 and 1.6 and found that it works perfectly fine with 1.5 and compilation fails with 1.6. Probably, you are trying to compile with 1.6.

Looks like they have got away with this in JDK 1.5 and fixed it in 1.6. Otherwise, this case would have been an anomaly to my post ;). Thanks for the use-case.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>This is an interesting case, where you can access a static field while the Enum instance is being constructed though not directly through the constructor.</p>
<p>I tried to compile this piece of code on JDK 1.5 and 1.6 and found that it works perfectly fine with 1.5 and compilation fails with 1.6. Probably, you are trying to compile with 1.6.</p>
<p>Looks like they have got away with this in JDK 1.5 and fixed it in 1.6. Otherwise, this case would have been an anomaly to my post <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . Thanks for the use-case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Bootstrapping static fields within enums by snow</title>
		<link>http://deepjava.wordpress.com/2006/12/08/bootstrapping-static-fields-within-enums/#comment-1500</link>
		<dc:creator>snow</dc:creator>
		<pubDate>Thu, 15 Jan 2009 14:57:33 +0000</pubDate>
		<guid isPermaLink="false">http://deepjava.wordpress.com/2006/12/08/bootstrapping-static-fields-within-enums/#comment-1500</guid>
		<description>Hello, I have found your article and I was hoping you may be able to explain what the problem is in the piece of code that will follow if there is one, because I am the only one in my team that gets it. Is it a Java problem or some Eclipse problem/setting.
Thanks for your help.

public enum MyClass {
	// ...
	private static int nextIndex = 0;
	private final int index = MyClass.nextIndex++;
	/*only I get the error &quot;Cannot refer to the static enum field MyClass.nextIndex within an initializer&quot;*/
	// ...
}</description>
		<content:encoded><![CDATA[<p>Hello, I have found your article and I was hoping you may be able to explain what the problem is in the piece of code that will follow if there is one, because I am the only one in my team that gets it. Is it a Java problem or some Eclipse problem/setting.<br />
Thanks for your help.</p>
<p>public enum MyClass {<br />
	// &#8230;<br />
	private static int nextIndex = 0;<br />
	private final int index = MyClass.nextIndex++;<br />
	/*only I get the error &#8220;Cannot refer to the static enum field MyClass.nextIndex within an initializer&#8221;*/<br />
	// &#8230;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Type Safe Enumerations in Java 5.0 by free online christmas game</title>
		<link>http://deepjava.wordpress.com/2006/11/21/type-safe-enumerations-in-java-50/#comment-1499</link>
		<dc:creator>free online christmas game</dc:creator>
		<pubDate>Sat, 29 Nov 2008 10:38:39 +0000</pubDate>
		<guid isPermaLink="false">http://deepjava.wordpress.com/2006/11/21/type-safe-enumerations-in-java-50/#comment-1499</guid>
		<description>My Pleasure To Browse Here</description>
		<content:encoded><![CDATA[<p>My Pleasure To Browse Here</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Understanding Generics with Collections by Deepika</title>
		<link>http://deepjava.wordpress.com/2006/12/22/understanding-generics-with-collections-2/#comment-1497</link>
		<dc:creator>Deepika</dc:creator>
		<pubDate>Mon, 10 Nov 2008 06:15:25 +0000</pubDate>
		<guid isPermaLink="false">http://deepjava.wordpress.com/2006/12/22/understanding-generics-with-collections-2/#comment-1497</guid>
		<description>hey nice article...</description>
		<content:encoded><![CDATA[<p>hey nice article&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Bootstrapping static fields within enums by Benedetto</title>
		<link>http://deepjava.wordpress.com/2006/12/08/bootstrapping-static-fields-within-enums/#comment-1495</link>
		<dc:creator>Benedetto</dc:creator>
		<pubDate>Fri, 01 Aug 2008 19:01:05 +0000</pubDate>
		<guid isPermaLink="false">http://deepjava.wordpress.com/2006/12/08/bootstrapping-static-fields-within-enums/#comment-1495</guid>
		<description>to Benita: Yes, i missed that part of the article was right about static fields not being accessible from the enum initializer. 
Anyway you can still avoid the static for each bootstrap and let each enum constant to cache itself at initialization time by moving the cache into a static method that will also instantiate the cache:
     ...
     private static Map getCache(){
            if (cache==null)
                cache=new LinkedHashMap();
            return cache;
        }
	
        private Tag(int recordNo, int datasetNo, boolean isRepeat){
		//initialize statics–
		//–
		this.recordNo = recordNo;
		this.datasetNo = datasetNo;
		this.isRepeat = isRepeat;
		getCache().put(this.getRecordNo()&lt;&lt;8 + this.getDatasetNo(), this);
	}

   ...</description>
		<content:encoded><![CDATA[<p>to Benita: Yes, i missed that part of the article was right about static fields not being accessible from the enum initializer.<br />
Anyway you can still avoid the static for each bootstrap and let each enum constant to cache itself at initialization time by moving the cache into a static method that will also instantiate the cache:<br />
     &#8230;<br />
     private static Map getCache(){<br />
            if (cache==null)<br />
                cache=new LinkedHashMap();<br />
            return cache;<br />
        }</p>
<p>        private Tag(int recordNo, int datasetNo, boolean isRepeat){<br />
		//initialize statics–<br />
		//–<br />
		this.recordNo = recordNo;<br />
		this.datasetNo = datasetNo;<br />
		this.isRepeat = isRepeat;<br />
		getCache().put(this.getRecordNo()&lt;&lt;8 + this.getDatasetNo(), this);<br />
	}</p>
<p>   &#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
