<?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: Instantiating and populating a list or collection</title>
	<atom:link href="http://gabrito.com/post/instantiating-and-populating-a-list-or-collection/feed" rel="self" type="application/rss+xml" />
	<link>http://gabrito.com/post/instantiating-and-populating-a-list-or-collection</link>
	<description>Anecdotes on Technology Leadership, Ruby, Java, Scala, Cloud Computing, Open-Source, SEO, and Design</description>
	<lastBuildDate>Sun, 20 May 2012 19:43:02 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Martial Java / Initializing Collection</title>
		<link>http://gabrito.com/post/instantiating-and-populating-a-list-or-collection/comment-page-1#comment-242724</link>
		<dc:creator>Martial Java / Initializing Collection</dc:creator>
		<pubDate>Wed, 21 Jul 2010 11:16:08 +0000</pubDate>
		<guid isPermaLink="false">http://gabrito.com/post/instantiating-and-populating-a-list-or-collection#comment-242724</guid>
		<description>[...] hardly find an elegant solution until I see this post. There are at least three better solution for the [...]</description>
		<content:encoded><![CDATA[<p>[...] hardly find an elegant solution until I see this post. There are at least three better solution for the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Java Tips: Initializing Collection &#171; satukubik</title>
		<link>http://gabrito.com/post/instantiating-and-populating-a-list-or-collection/comment-page-1#comment-241478</link>
		<dc:creator>Java Tips: Initializing Collection &#171; satukubik</dc:creator>
		<pubDate>Thu, 01 Jul 2010 13:46:43 +0000</pubDate>
		<guid isPermaLink="false">http://gabrito.com/post/instantiating-and-populating-a-list-or-collection#comment-241478</guid>
		<description>[...] hardly find an elegant solution until I see this post. There are at least three better solution for the [...]</description>
		<content:encoded><![CDATA[<p>[...] hardly find an elegant solution until I see this post. There are at least three better solution for the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricky Clarkson</title>
		<link>http://gabrito.com/post/instantiating-and-populating-a-list-or-collection/comment-page-1#comment-10582</link>
		<dc:creator>Ricky Clarkson</dc:creator>
		<pubDate>Tue, 21 Nov 2006 16:10:03 +0000</pubDate>
		<guid isPermaLink="false">http://gabrito.com/post/instantiating-and-populating-a-list-or-collection#comment-10582</guid>
		<description>Yes, using a static import it&#039;s fine.  I half-meant Arrays.asList, but which asList you use isn&#039;t so important to the meaning of my post.  Arrays.asList returns a read-only list, so you might prefer to write your own asList implementation.

It&#039;s odd that after three years or so of static imports people still look at them oddly.  Blog posters don&#039;t expect me to qualify the package part, but they do expect the class part. ;)

Sorry for the diversion, but I think static methods really belong outside classes; they&#039;re not OO, so they shouldn&#039;t look like they are.  Not that being non-OO is a problem, mind..

import static java.util.asList; //would suit me.</description>
		<content:encoded><![CDATA[<p>Yes, using a static import it&#8217;s fine.  I half-meant Arrays.asList, but which asList you use isn&#8217;t so important to the meaning of my post.  Arrays.asList returns a read-only list, so you might prefer to write your own asList implementation.</p>
<p>It&#8217;s odd that after three years or so of static imports people still look at them oddly.  Blog posters don&#8217;t expect me to qualify the package part, but they do expect the class part. <img src='http://gabrito.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Sorry for the diversion, but I think static methods really belong outside classes; they&#8217;re not OO, so they shouldn&#8217;t look like they are.  Not that being non-OO is a problem, mind..</p>
<p>import static java.util.asList; //would suit me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: afsina</title>
		<link>http://gabrito.com/post/instantiating-and-populating-a-list-or-collection/comment-page-1#comment-10576</link>
		<dc:creator>afsina</dc:creator>
		<pubDate>Tue, 21 Nov 2006 14:53:33 +0000</pubDate>
		<guid isPermaLink="false">http://gabrito.com/post/instantiating-and-populating-a-list-or-collection#comment-10576</guid>
		<description>Ricky, you got me there.. i totally forget that. should be  Arrays.asList(...) tough. maybe using static import, the way you write is fine..</description>
		<content:encoded><![CDATA[<p>Ricky, you got me there.. i totally forget that. should be  Arrays.asList(&#8230;) tough. maybe using static import, the way you write is fine..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricky Clarkson</title>
		<link>http://gabrito.com/post/instantiating-and-populating-a-list-or-collection/comment-page-1#comment-10573</link>
		<dc:creator>Ricky Clarkson</dc:creator>
		<pubDate>Tue, 21 Nov 2006 14:14:08 +0000</pubDate>
		<guid isPermaLink="false">http://gabrito.com/post/instantiating-and-populating-a-list-or-collection#comment-10573</guid>
		<description>[] for generics, as there&#039;s no preview button:

I wonder what&#039;s wrong with List[String] list=asList(&quot;rocks&quot;,&quot;my&quot;,&quot;world&quot;);</description>
		<content:encoded><![CDATA[<p>[] for generics, as there&#8217;s no preview button:</p>
<p>I wonder what&#8217;s wrong with List[String] list=asList(&#8220;rocks&#8221;,&#8221;my&#8221;,&#8221;world&#8221;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: afsina</title>
		<link>http://gabrito.com/post/instantiating-and-populating-a-list-or-collection/comment-page-1#comment-10571</link>
		<dc:creator>afsina</dc:creator>
		<pubDate>Tue, 21 Nov 2006 13:53:35 +0000</pubDate>
		<guid isPermaLink="false">http://gabrito.com/post/instantiating-and-populating-a-list-or-collection#comment-10571</guid>
		<description>actually, i saw that i did wirte &quot;real code&quot; my intention was to say &quot;real business logic&quot; pardon my english :P</description>
		<content:encoded><![CDATA[<p>actually, i saw that i did wirte &#8220;real code&#8221; my intention was to say &#8220;real business logic&#8221; pardon my english <img src='http://gabrito.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: afsina</title>
		<link>http://gabrito.com/post/instantiating-and-populating-a-list-or-collection/comment-page-1#comment-10570</link>
		<dc:creator>afsina</dc:creator>
		<pubDate>Tue, 21 Nov 2006 13:48:00 +0000</pubDate>
		<guid isPermaLink="false">http://gabrito.com/post/instantiating-and-populating-a-list-or-collection#comment-10570</guid>
		<description>Todd:
i did not say tests are not real code, however, it is easy to introduce those methods in a test base class, which is cleaner then the solutions you offered. 

http://jroller.com/page/ff?entry=initializing_collections_my_take

i dont think there is a shortcoming of Java on this. This is the Java way, if writing a two line method will give you more or less the same result, it is better then introducing a new syntax to the language.</description>
		<content:encoded><![CDATA[<p>Todd:<br />
i did not say tests are not real code, however, it is easy to introduce those methods in a test base class, which is cleaner then the solutions you offered. </p>
<p><a href="http://jroller.com/page/ff?entry=initializing_collections_my_take" rel="nofollow">http://jroller.com/page/ff?entry=initializing_collections_my_take</a></p>
<p>i dont think there is a shortcoming of Java on this. This is the Java way, if writing a two line method will give you more or less the same result, it is better then introducing a new syntax to the language.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Schneller's Weblog</title>
		<link>http://gabrito.com/post/instantiating-and-populating-a-list-or-collection/comment-page-1#comment-10553</link>
		<dc:creator>Daniel Schneller's Weblog</dc:creator>
		<pubDate>Tue, 21 Nov 2006 11:33:11 +0000</pubDate>
		<guid isPermaLink="false">http://gabrito.com/post/instantiating-and-populating-a-list-or-collection#comment-10553</guid>
		<description>&lt;strong&gt;Amazingly simple - Collection Initialization...&lt;/strong&gt;

On  Todd Huss &#039; blog I just came about a very simple way of initializing a collection with a set of predefined values. It is so simple that it is amazing people do not use it way more often. For my part, I have seen this use of instance initializers f...</description>
		<content:encoded><![CDATA[<p><strong>Amazingly simple &#8211; Collection Initialization&#8230;</strong></p>
<p>On  Todd Huss &#8216; blog I just came about a very simple way of initializing a collection with a set of predefined values. It is so simple that it is amazing people do not use it way more often. For my part, I have seen this use of instance initializers f&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Todd Huss</title>
		<link>http://gabrito.com/post/instantiating-and-populating-a-list-or-collection/comment-page-1#comment-10499</link>
		<dc:creator>Todd Huss</dc:creator>
		<pubDate>Tue, 21 Nov 2006 05:22:17 +0000</pubDate>
		<guid isPermaLink="false">http://gabrito.com/post/instantiating-and-populating-a-list-or-collection#comment-10499</guid>
		<description>afsina, I disagree that those types of initializations are not needed in real code, tests are real code. If you&#039;re creating a helper method just to create a simple data structure like an array more elegantly, then I&#039;d say the language is coming up short on that front whether it&#039;s in a test or production code and let&#039;s face it, it&#039;s just lame that Java won&#039;t let us construct a collection with its contents!</description>
		<content:encoded><![CDATA[<p>afsina, I disagree that those types of initializations are not needed in real code, tests are real code. If you&#8217;re creating a helper method just to create a simple data structure like an array more elegantly, then I&#8217;d say the language is coming up short on that front whether it&#8217;s in a test or production code and let&#8217;s face it, it&#8217;s just lame that Java won&#8217;t let us construct a collection with its contents!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: afsina</title>
		<link>http://gabrito.com/post/instantiating-and-populating-a-list-or-collection/comment-page-1#comment-10493</link>
		<dc:creator>afsina</dc:creator>
		<pubDate>Tue, 21 Nov 2006 04:19:01 +0000</pubDate>
		<guid isPermaLink="false">http://gabrito.com/post/instantiating-and-populating-a-list-or-collection#comment-10493</guid>
		<description>oh by the way, blog ate my  (greater, smaller)  symbols..</description>
		<content:encoded><![CDATA[<p>oh by the way, blog ate my  (greater, smaller)  symbols..</p>
]]></content:encoded>
	</item>
</channel>
</rss>

