<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" 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:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Legolas in Minas Tirith</title>
	
	<link>http://www.javalinux.it/wordpress</link>
	<description>Alessio &amp; Stefano ideas</description>
	<lastBuildDate>Thu, 28 Jan 2010 17:27:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/LegolasInMinasTirith" /><feedburner:info uri="legolasinminastirith" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>JavaDay in Rome</title>
		<link>http://feedproxy.google.com/~r/LegolasInMinasTirith/~3/bUlmKgfme3E/</link>
		<comments>http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 17:26:34 +0000</pubDate>
		<dc:creator>Alessio SOLDANO</dc:creator>
				<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=384</guid>
		<description><![CDATA[

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		
		
		
		
		
			
				
			
		
Just a short note to tell you an interesting event on Java is taking place in Rome next Saturday (Jan, 30th). If you&#8217;re around, you might want [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/";
		var dzone_title = "JavaDay in Rome";
		var dzone_style = "1";
		var dzone_blurb = "																				Just a short note to tell you an interesting event on Java is taking place in Rome next Saturday (Jan, 30th). If you&#8217;re around, you might want to attend that: http://roma.javaday.it/javaday2010/Most of the talks are going to...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "JavaDay in Rome";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2010%2F01%2F28%2Fjavaday-in-rome%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2010%2F01%2F28%2Fjavaday-in-rome%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Just a short note to tell you an interesting event on Java is taking place in Rome next Saturday (Jan, 30th). If you&#8217;re around, you might want to attend that: <a href="http://roma.javaday.it/javaday2010/">http://roma.javaday.it/javaday2010/</a></p>
<p><a href="http://roma.javaday.it/javaday2010/talk-tecnici-in-programma">Most of the talks</a> are going to be in Italian, but at least three of them will be in English. The talks are going to be quite technical and should also cover interesting topics like scalability, concurrency, management and tuning.</p>
<div style="clear:both;">&nbsp;</div>

<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/&amp;title=JavaDay+in+Rome" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/&amp;title=JavaDay+in+Rome" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/&amp;title=JavaDay+in+Rome&amp;desc=Just%20a%20short%20note%20to%20tell%20you%20an%20interesting%20event%20on%20Java%20is%20taking%20place%20in%20Rome%20next%20Saturday%20%28Jan%2C%2030th%29.%20If%20you%27re%20around%2C%20you%20might%20want%20to%20attend%20that%3A%20http%3A%2F%2Froma.javaday.it%2Fjavaday2010%2F%0D%0A%0D%0AMost%20of%20the%20talks%20are%20going%20to%20be%20in%20Italian%2C%20but%20at%20least%20three%20of%20them%20will%20be%20in%20English.%20The%20talks" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/&amp;title=JavaDay+in+Rome" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/&amp;title=JavaDay+in+Rome" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/&amp;title=JavaDay+in+Rome" rel="nofollow" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/&amp;t=JavaDay+in+Rome" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=JavaDay+in+Rome+-+http://cli.gs/PeZLN+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/&amp;title=JavaDay+in+Rome&amp;summary=Just%20a%20short%20note%20to%20tell%20you%20an%20interesting%20event%20on%20Java%20is%20taking%20place%20in%20Rome%20next%20Saturday%20%28Jan%2C%2030th%29.%20If%20you%27re%20around%2C%20you%20might%20want%20to%20attend%20that%3A%20http%3A%2F%2Froma.javaday.it%2Fjavaday2010%2F%0D%0A%0D%0AMost%20of%20the%20talks%20are%20going%20to%20be%20in%20Italian%2C%20but%20at%20least%20three%20of%20them%20will%20be%20in%20English.%20The%20talks&amp;source=Legolas in Minas Tirith" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/&amp;bm_description=JavaDay+in+Rome&amp;plugin=sexybookmarks" rel="nofollow" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=JavaDay+in+Rome&amp;link=http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/" rel="nofollow" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/&amp;n=JavaDay+in+Rome&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<p><a href="http://feedads.g.doubleclick.net/~a/AyRMoMpKZ9woLSv5mSMEpaD_-1M/0/da"><img src="http://feedads.g.doubleclick.net/~a/AyRMoMpKZ9woLSv5mSMEpaD_-1M/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/AyRMoMpKZ9woLSv5mSMEpaD_-1M/1/da"><img src="http://feedads.g.doubleclick.net/~a/AyRMoMpKZ9woLSv5mSMEpaD_-1M/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=bUlmKgfme3E:ORKqG7PQyXU:vzDxczd-HtA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=vzDxczd-HtA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=bUlmKgfme3E:ORKqG7PQyXU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=bUlmKgfme3E:ORKqG7PQyXU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=bUlmKgfme3E:ORKqG7PQyXU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=bUlmKgfme3E:ORKqG7PQyXU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=bUlmKgfme3E:ORKqG7PQyXU:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=bUlmKgfme3E:ORKqG7PQyXU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=bUlmKgfme3E:ORKqG7PQyXU:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=bUlmKgfme3E:ORKqG7PQyXU:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=bUlmKgfme3E:ORKqG7PQyXU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=bUlmKgfme3E:ORKqG7PQyXU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=bUlmKgfme3E:ORKqG7PQyXU:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=bUlmKgfme3E:ORKqG7PQyXU:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LegolasInMinasTirith/~4/bUlmKgfme3E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javalinux.it/wordpress/2010/01/28/javaday-in-rome/</feedburner:origLink></item>
		<item>
		<title>java2scala #3: Variables and functions</title>
		<link>http://feedproxy.google.com/~r/LegolasInMinasTirith/~3/0c_0P1zRLu0/</link>
		<comments>http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 22:17:19 +0000</pubDate>
		<dc:creator>Stefano MAESTRI</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=373</guid>
		<description><![CDATA[

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		
		
		
		
		
			
				
			
		
In this third post of our java2scala series we will take a look to variables and functions definition and use.
As usual you can find the full maven/eclipse [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/";
		var dzone_title = "java2scala #3: Variables and functions";
		var dzone_style = "1";
		var dzone_blurb = "																				In this third post of our java2scala series we will take a look to variables and functions definition and use.As usual you can find the full maven/eclipse project on github.Java class758bbe953f40f1a74f9cdf4122d1b088004java Unit Test758bbe953f40f1a74f9cdf4122d1b088005Scala...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "java2scala #3: Variables and functions";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F12%2F29%2Fjava2scala-3-variables-and-functions%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F12%2F29%2Fjava2scala-3-variables-and-functions%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In this third post of our <a href="../java2scala/" target="_blank">java2scala</a> series we will take a look to variables and functions definition and use.</p>
<p>As usual you can find the <a href="http://github.com/maeste/java2scalaSamples" target="_blank">full maven/eclipse project on github.</a></p>
<h4>Java class</h4>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">it.javalinux.samples.java.post3</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> VariablesAndFunctions <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> inputString<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> fooIntVar <span style="color: #339933;">=</span> <span style="color: #cc66cc;">11</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> fooStringVal <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;fooString&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">double</span> privateIntVar <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1.1</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> privateStringVal <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;fooString&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> VariablesAndFunctions<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> inputString<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">//it could compile! and if you uncomment the line tests will fail</span>
		<span style="color: #666666; font-style: italic;">//inputString = inputString + &quot;hasBeenModified&quot;;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">inputString</span> <span style="color: #339933;">=</span> inputString<span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">//it doesent compile because you have already assigned the final property</span>
		<span style="color: #666666; font-style: italic;">//this.inputString = inputString + &quot;hasBeenModified&quot;;</span>
		<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Created VariablesAndFunctions with inputString=&quot;</span> <span style="color: #339933;">+</span> inputString<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> VariablesAndFunctions<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;defaultString&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getInputString<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> inputString<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getFooStringVal<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> fooStringVal<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// i. You can't re-assign a final variable</span>
<span style="color: #666666; font-style: italic;">//	public void setFooStringVal(String fooStringVal) {</span>
<span style="color: #666666; font-style: italic;">//		this.fooStringVal = fooStringVal;</span>
<span style="color: #666666; font-style: italic;">//	}</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">double</span> getPrivateIntVar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> privateIntVar<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setPrivateIntVar<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">double</span> privateIntVar<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">privateIntVar</span> <span style="color: #339933;">=</span> privateIntVar<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> getFooIntVar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> fooIntVar<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getPrivateStringVal<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> privateStringVal<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setFooIntVar<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> fooIntVar<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">fooIntVar</span> <span style="color: #339933;">=</span> fooIntVar<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>java Unit Test</h4>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">it.javalinux.samples.java.post3</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.junit.Test</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">static</span> org.<span style="color: #006633;">junit</span>.<span style="color: #000000; font-weight: bold;">Assert</span>.<span style="color: #006633;">assertFalse</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">static</span> org.<span style="color: #006633;">junit</span>.<span style="color: #000000; font-weight: bold;">Assert</span>.<span style="color: #006633;">assertTrue</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> VariablesAndFunctionsTest <span style="color: #009900;">&#123;</span>
&nbsp;
    @Test
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> testAccessToPublicVar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    	VariablesAndFunctions instance <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> VariablesAndFunctions<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	instance.<span style="color: #006633;">fooIntVar</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">12</span><span style="color: #339933;">;</span>
    	assertTrue<span style="color: #009900;">&#40;</span>instance.<span style="color: #006633;">fooIntVar</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">12</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    @Test
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span>  testAccessToPublicVal<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
    	VariablesAndFunctions instance <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> VariablesAndFunctions<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	<span style="color: #666666; font-style: italic;">// It doesn't compile...you can't reassign a final property</span>
    	<span style="color: #666666; font-style: italic;">//instance.fooStringVal = &quot;anotherString&quot;</span>
    	assertTrue<span style="color: #009900;">&#40;</span>instance.<span style="color: #006633;">fooStringVal</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;fooString&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	assertFalse<span style="color: #009900;">&#40;</span>instance.<span style="color: #006633;">fooStringVal</span> <span style="color: #339933;">==</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;fooString&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    @Test
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span>  testAccessToPrivateVar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
    	VariablesAndFunctions instance <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> VariablesAndFunctions<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	instance.<span style="color: #006633;">setPrivateIntVar</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">12</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	assertTrue<span style="color: #009900;">&#40;</span>instance.<span style="color: #006633;">getPrivateIntVar</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">12</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    @Test
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span>  testEmptyConstructor<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
    	VariablesAndFunctions instance <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> VariablesAndFunctions<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	assertTrue<span style="color: #009900;">&#40;</span>instance.<span style="color: #006633;">getInputString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;defaultString&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	assertFalse<span style="color: #009900;">&#40;</span>instance.<span style="color: #006633;">getInputString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;defaultString&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    @Test
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span>  testConstructor<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
    	VariablesAndFunctions instance <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> VariablesAndFunctions<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;myString&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	assertTrue<span style="color: #009900;">&#40;</span>instance.<span style="color: #006633;">getInputString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;myString&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	assertFalse<span style="color: #009900;">&#40;</span>instance.<span style="color: #006633;">getInputString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;myString&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>Scala class</h4>

<div class="wp_syntax"><div class="code"><pre class="scala" style="font-family:monospace;"><span style="color: #0000ff; font-weight: bold;">package</span> it.<span style="color: #000000;">javalinux</span>.<span style="color: #000000;">samples</span>.<span style="color: #000000;">scala</span>.<span style="color: #000000;">post3</span>
&nbsp;
<span style="color: #0000ff; font-weight: bold;">class</span> VariablesAndFunctions<span style="color: #F78811;">&#40;</span><span style="color: #0000ff; font-weight: bold;">val</span> inputString <span style="color: #000080;">:</span> String<span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#123;</span>
&nbsp;
    println<span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;Created VariablesAndFunctions with inputString=&quot;</span> + inputString<span style="color: #F78811;">&#41;</span><span style="color: #000080;">;</span>
&nbsp;
    <span style="color: #008000; font-style: italic;">// it doesnt compile</span>
    <span style="color: #008000; font-style: italic;">// inputString = inputString + &quot;hasBeenModified&quot;;</span>
&nbsp;
	<span style="color: #0000ff; font-weight: bold;">def</span> <span style="color: #0000ff; font-weight: bold;">this</span><span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #0000ff; font-weight: bold;">this</span><span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;defaultString&quot;</span><span style="color: #F78811;">&#41;</span>
&nbsp;
	<span style="color: #0000ff; font-weight: bold;">var</span> fooIntVar <span style="color: #000080;">:</span> Int <span style="color: #000080;">=</span> <span style="color: #F78811;">11</span>
	<span style="color: #0000ff; font-weight: bold;">val</span> fooStringVal <span style="color: #000080;">=</span> <span style="color: #6666FF;">&quot;fooString&quot;</span>
	<span style="color: #0000ff; font-weight: bold;">private</span> <span style="color: #0000ff; font-weight: bold;">var</span> privateIntVar <span style="color: #000080;">=</span> <span style="color: #F78811;">1.1</span>
	<span style="color: #0000ff; font-weight: bold;">private</span> <span style="color: #0000ff; font-weight: bold;">val</span> privateStringVal <span style="color: #000080;">=</span> <span style="color: #6666FF;">&quot;fooString&quot;</span>
&nbsp;
	<span style="color: #0000ff; font-weight: bold;">def</span> getPrivateVarIntVar<span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> privateIntVar
&nbsp;
	<span style="color: #0000ff; font-weight: bold;">def</span> getPrivateStringVal<span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> privateStringVal
&nbsp;
	<span style="color: #0000ff; font-weight: bold;">def</span> setPrivateVarIntVar<span style="color: #F78811;">&#40;</span>x <span style="color: #000080;">:</span> Int<span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#123;</span>
	  privateIntVar <span style="color: #000080;">=</span> x
   	<span style="color: #F78811;">&#125;</span>
&nbsp;
<span style="color: #008000; font-style: italic;">// It doesn't compile...you can't reassign val</span>
<span style="color: #008000; font-style: italic;">//	def setPrivateStringVal(s : String) {</span>
<span style="color: #008000; font-style: italic;">//	  privateStringVal = s;</span>
<span style="color: #008000; font-style: italic;">//    }</span>
&nbsp;
<span style="color: #F78811;">&#125;</span></pre></div></div>

<h4>Scala Unit Test</h4>

<div class="wp_syntax"><div class="code"><pre class="scala" style="font-family:monospace;"><span style="color: #0000ff; font-weight: bold;">package</span> it.<span style="color: #000000;">javalinux</span>.<span style="color: #000000;">samples</span>.<span style="color: #000000;">scala</span>.<span style="color: #000000;">post3</span>
&nbsp;
<span style="color: #0000ff; font-weight: bold;">import</span> org.<span style="color: #000000;">junit</span>.<span style="color: #000080;">_</span>
<span style="color: #0000ff; font-weight: bold;">import</span> Assert.<span style="color: #000080;">_</span>
&nbsp;
<span style="color: #000080;">@</span>Test
<span style="color: #0000ff; font-weight: bold;">class</span> VariablesAndFunctionsTest <span style="color: #F78811;">&#123;</span>
&nbsp;
    <span style="color: #000080;">@</span>Test
    <span style="color: #0000ff; font-weight: bold;">def</span> testAccessToPublicVar<span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #F78811;">&#123;</span>
    	<span style="color: #0000ff; font-weight: bold;">val</span> instance <span style="color: #000080;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> VariablesAndFunctions<span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span>
    	instance.<span style="color: #000000;">fooIntVar</span> <span style="color: #000080;">=</span> <span style="color: #F78811;">12</span>
    	assertTrue<span style="color: #F78811;">&#40;</span>instance.<span style="color: #000000;">fooIntVar</span> <span style="color: #000080;">==</span> <span style="color: #F78811;">12</span><span style="color: #F78811;">&#41;</span>
    <span style="color: #F78811;">&#125;</span>
&nbsp;
    <span style="color: #000080;">@</span>Test
    <span style="color: #0000ff; font-weight: bold;">def</span> testAccessToPublicVal<span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #F78811;">&#123;</span>
    	<span style="color: #0000ff; font-weight: bold;">val</span> instance <span style="color: #000080;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> VariablesAndFunctions<span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span>
    	<span style="color: #008000; font-style: italic;">// It doesn't compile...you can't reassign val</span>
&nbsp;
    	<span style="color: #008000; font-style: italic;">//instance.fooStringVal = &quot;anotherString&quot;</span>
    	assertTrue<span style="color: #F78811;">&#40;</span>instance.<span style="color: #000000;">fooStringVal</span> <span style="color: #000080;">==</span> <span style="color: #0000ff; font-weight: bold;">new</span> String<span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;fooString&quot;</span><span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#41;</span>
        assertFalse<span style="color: #F78811;">&#40;</span>instance.<span style="color: #000000;">fooStringVal</span> eq <span style="color: #0000ff; font-weight: bold;">new</span> String<span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;fooString&quot;</span><span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#41;</span>
    <span style="color: #F78811;">&#125;</span>
&nbsp;
    <span style="color: #000080;">@</span>Test
    <span style="color: #0000ff; font-weight: bold;">def</span> testAccessToPrivateVar<span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #F78811;">&#123;</span>
    	<span style="color: #0000ff; font-weight: bold;">val</span> instance <span style="color: #000080;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> VariablesAndFunctions<span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span>
    	instance.<span style="color: #000000;">setPrivateVarIntVar</span><span style="color: #F78811;">&#40;</span><span style="color: #F78811;">12</span><span style="color: #F78811;">&#41;</span>
    	assertTrue<span style="color: #F78811;">&#40;</span>instance.<span style="color: #000000;">getPrivateVarIntVar</span> <span style="color: #000080;">==</span> <span style="color: #F78811;">12</span><span style="color: #F78811;">&#41;</span>
    <span style="color: #F78811;">&#125;</span>
&nbsp;
    <span style="color: #000080;">@</span>Test
    <span style="color: #0000ff; font-weight: bold;">def</span> testEmptyConstructor<span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #F78811;">&#123;</span>
    	<span style="color: #0000ff; font-weight: bold;">val</span> instance <span style="color: #000080;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> VariablesAndFunctions<span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span>
    	assertTrue<span style="color: #F78811;">&#40;</span>instance.<span style="color: #000000;">inputString</span> <span style="color: #000080;">==</span> <span style="color: #0000ff; font-weight: bold;">new</span> String<span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;defaultString&quot;</span><span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#41;</span>
        assertFalse<span style="color: #F78811;">&#40;</span>instance.<span style="color: #000000;">inputString</span> eq <span style="color: #0000ff; font-weight: bold;">new</span> String<span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;defaultString&quot;</span><span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#41;</span>
    <span style="color: #F78811;">&#125;</span>
&nbsp;
    <span style="color: #000080;">@</span>Test
    <span style="color: #0000ff; font-weight: bold;">def</span> testConstructor<span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #F78811;">&#123;</span>
    	<span style="color: #0000ff; font-weight: bold;">val</span> instance <span style="color: #000080;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> VariablesAndFunctions<span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;myString&quot;</span><span style="color: #F78811;">&#41;</span>
    	assertTrue<span style="color: #F78811;">&#40;</span>instance.<span style="color: #000000;">inputString</span> <span style="color: #000080;">==</span> <span style="color: #0000ff; font-weight: bold;">new</span> String<span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;myString&quot;</span><span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#41;</span>
        assertFalse<span style="color: #F78811;">&#40;</span>instance.<span style="color: #000000;">inputString</span> eq <span style="color: #0000ff; font-weight: bold;">new</span> String<span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;myString&quot;</span><span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#41;</span>
    <span style="color: #F78811;">&#125;</span>
&nbsp;
<span style="color: #F78811;">&#125;</span></pre></div></div>

<p>Ok, let me rapidly focus on some interesting things we can remark in previously pasted code (of course feel free to ask if I&#8217;ve missed to remark something that you&#8217;d like more explanations):</p>
<ul>
<li>public is the default access modifier&#8230;conciseness one more time. Scala have 3 different access public (default), private and protected. While plublic and private are the same of java, protected is a bit more restrictive than java one: protected member can be accessed only by subclasses of the class in which they are defined; in java you can access protected memeber also by classes defined in the same package. In scala you can achieve this effect using scoped protection. I will explain that in further post: for the moment just take in mund that you can specify private[X] or protected[X] member meaning they are private or protected &#8220;up to&#8221; X where X could be an enclosing package or class.</li>
<li>scala has 2 different keyword to define mutable (var) and immutable variable. Immutable variable guarantee immutable state at compile time.</li>
<li>default constructor is defined implicitly in class definition:
<ul>
<li>every code put in the class except variables and methods definitions are considered part of the default constructor. In our case the println instruction for debug purpose.</li>
<li>every val defined into calss definition parenthesis act as parameter for the default constructor. It&#8217;s matter of facts that the inputString parameter is defined as val prevent any kind of modification. Of course you can do the same in java declaring the input parameter as final, but it&#8217;s quite less usual.</li>
</ul>
</li>
<li>normally in scala public variables are accessed using variables names instead of odd getter and setter methods. BTW there is an annotation in scala to build getter and setter methods runtime. It is useful when you need java bean compatible objects written in scala.</li>
<li>a method or function is defined using keyword def</li>
<li>functions are methods that returns value. Normally defined using an = symbol after method name. Normally return keyword is not required and its use isn&#8217;t suggested, the last expression evaluated in the method is the returned one. Try to think functions as complex expression evaluation. Normally you don&#8217;t need to specify the type of returned value in method definition since scala will infer it for you. We will see type inference in one of next posts. For now just keep in mind that COMPILER will STATICALLY infer type for you.</li>
<li>The same STATIC inference of type is used to infer variable type when it isn&#8217;t specified. Try to play a little with my code to get idea about type inference of scala. It&#8217;s AMAZING.</li>
<li>methods without = symbol doesn&#8217;t return value. Formally they return an instance of Unit. Unit is the type of scala like void for java.</li>
<li>Don&#8217;t miss the different behaviour of == on object between scala and java. They are used in unit tests. Scala uses == to compare the content of objects, while it have eq operator to compare object references.</li>
</ul>
<p>Ok that&#8217;s all for the moment, but as said feel free to play with my code and/or ask here any further explanations.</p>
<p>In next post of the series we will take a first look at scala&#8217;s type inference in some more detail. As said it&#8217;s absolutely AMAZING&#8230;stay tuned</p>
<div style="clear:both;">&nbsp;</div>

<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/&amp;title=java2scala+%233%3A+Variables+and+functions" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/&amp;title=java2scala+%233%3A+Variables+and+functions" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/&amp;title=java2scala+%233%3A+Variables+and+functions&amp;desc=In%20this%20third%20post%20of%20our%20java2scala%20series%20we%20will%20take%20a%20look%20to%20variables%20and%20functions%20definition%20and%20use.%0D%0A%0D%0AAs%20usual%20you%20can%20find%20the%20full%20maven%2Feclipse%20project%20on%20github.%0D%0AJava%20class%0D%0Apackage%20it.javalinux.samples.java.post3%3B%0D%0A%0D%0Aclass%20VariablesAndFunctions%20%7B%0D%0A%0D%0A%09private%20final%20String%20inputStrin" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/&amp;title=java2scala+%233%3A+Variables+and+functions" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/&amp;title=java2scala+%233%3A+Variables+and+functions" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/&amp;title=java2scala+%233%3A+Variables+and+functions" rel="nofollow" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/&amp;t=java2scala+%233%3A+Variables+and+functions" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=java2scala+%233%3A+Variables+and+functions+-+http://cli.gs/2LtgE+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/&amp;title=java2scala+%233%3A+Variables+and+functions&amp;summary=In%20this%20third%20post%20of%20our%20java2scala%20series%20we%20will%20take%20a%20look%20to%20variables%20and%20functions%20definition%20and%20use.%0D%0A%0D%0AAs%20usual%20you%20can%20find%20the%20full%20maven%2Feclipse%20project%20on%20github.%0D%0AJava%20class%0D%0Apackage%20it.javalinux.samples.java.post3%3B%0D%0A%0D%0Aclass%20VariablesAndFunctions%20%7B%0D%0A%0D%0A%09private%20final%20String%20inputStrin&amp;source=Legolas in Minas Tirith" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/&amp;bm_description=java2scala+%233%3A+Variables+and+functions&amp;plugin=sexybookmarks" rel="nofollow" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=java2scala+%233%3A+Variables+and+functions&amp;link=http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/" rel="nofollow" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/&amp;n=java2scala+%233%3A+Variables+and+functions&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<p><a href="http://feedads.g.doubleclick.net/~a/7JrLKs8k3Fx7UNN6eF2wrxi3R4k/0/da"><img src="http://feedads.g.doubleclick.net/~a/7JrLKs8k3Fx7UNN6eF2wrxi3R4k/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/7JrLKs8k3Fx7UNN6eF2wrxi3R4k/1/da"><img src="http://feedads.g.doubleclick.net/~a/7JrLKs8k3Fx7UNN6eF2wrxi3R4k/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=0c_0P1zRLu0:ZwWH7R5viXs:vzDxczd-HtA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=vzDxczd-HtA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=0c_0P1zRLu0:ZwWH7R5viXs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=0c_0P1zRLu0:ZwWH7R5viXs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=0c_0P1zRLu0:ZwWH7R5viXs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=0c_0P1zRLu0:ZwWH7R5viXs:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=0c_0P1zRLu0:ZwWH7R5viXs:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=0c_0P1zRLu0:ZwWH7R5viXs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=0c_0P1zRLu0:ZwWH7R5viXs:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=0c_0P1zRLu0:ZwWH7R5viXs:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=0c_0P1zRLu0:ZwWH7R5viXs:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=0c_0P1zRLu0:ZwWH7R5viXs:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=0c_0P1zRLu0:ZwWH7R5viXs:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=0c_0P1zRLu0:ZwWH7R5viXs:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LegolasInMinasTirith/~4/0c_0P1zRLu0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/</feedburner:origLink></item>
		<item>
		<title>java2scala #2: Hello world</title>
		<link>http://feedproxy.google.com/~r/LegolasInMinasTirith/~3/DEIIM8pbzhk/</link>
		<comments>http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 22:05:01 +0000</pubDate>
		<dc:creator>Stefano MAESTRI</dc:creator>
				<category><![CDATA[java2scala]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=353</guid>
		<description><![CDATA[

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		
		
		
		
		
			
				
			
		
The first java2scala samples we are going to discuss is generated by creating project from maven archetype.
Let me remember you that you need an environment with:

Eclipse with [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/";
		var dzone_title = "java2scala #2: Hello world";
		var dzone_style = "1";
		var dzone_blurb = "																				The first java2scala samples we are going to discuss is generated by creating project from maven archetype.Let me remember you that you need an environment with:Eclipse with eclipse-scala pluginmaven wih maven-scala plugingit to clone...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "java2scala #2: Hello world";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F12%2F16%2Fjava2scala-2-hello-world%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F12%2F16%2Fjava2scala-2-hello-world%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>The first <a href="http://www.javalinux.it/wordpress/java2scala/">java2scala</a> samples we are going to discuss is generated by creating project from maven archetype.<br />
Let me remember you that you need an environment with:</p>
<ul>
<li>Eclipse with <a href="http://www.scala-lang.org/node/94" target="_blank">eclipse-scala plugin</a></li>
<li>maven wih <a href="http://scala-tools.org/mvnsites/maven-scala-plugin/" target="_blank">maven-scala plugin</a></li>
<li><a href="http://github.com/maeste/java2scalaSamples">git to clone the project from github</a>. This is optional, you can of course download the code directly with download link on github page itself&#8230;or digit yourself</li>
</ul>
<p>I&#8217;ve used m2eclipse plugin and created the two submodules using maven-archetype-quickstart (for java module) and scala-archetype-simple (for scala).</p>
<p>Let&#8217;s start with code samples (of course all code is available on our <a href="http://github.com/maeste/java2scalaSamples" target="_blank">github project</a>):</p>
<p><strong>Java class</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">it.javalinux.samples.java</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
* Hello world!
*
*/</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> App
<span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;Hello World!&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>Java unit test</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">it.javalinux.samples.java</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">junit.framework.Test</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">junit.framework.TestCase</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">junit.framework.TestSuite</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * Unit test for simple App.
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> AppTest
    <span style="color: #000000; font-weight: bold;">extends</span> TestCase
<span style="color: #009900;">&#123;</span>
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Create the test case
     *
     * @param testName name of the test case
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> AppTest<span style="color: #009900;">&#40;</span> <span style="color: #003399;">String</span> testName <span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span> testName <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * @return the suite of tests being tested
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> Test suite<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> TestSuite<span style="color: #009900;">&#40;</span> AppTest.<span style="color: #000000; font-weight: bold;">class</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Rigourous Test :-)
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> testApp<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        assertTrue<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>Scala class</strong></p>

<div class="wp_syntax"><div class="code"><pre class="scala" style="font-family:monospace;"><span style="color: #0000ff; font-weight: bold;">package</span> it.<span style="color: #000000;">javalinux</span>.<span style="color: #000000;">samples</span>.<span style="color: #000000;">scala</span>
&nbsp;
<span style="color: #00ff00; font-style: italic;">/**
 * Hello world!
 *
 */</span>
<span style="color: #0000ff; font-weight: bold;">object</span> App <span style="color: #0000ff; font-weight: bold;">extends</span> Application <span style="color: #F78811;">&#123;</span>
  println<span style="color: #F78811;">&#40;</span> <span style="color: #6666FF;">&quot;Hello World!&quot;</span> <span style="color: #F78811;">&#41;</span>
<span style="color: #F78811;">&#125;</span></pre></div></div>

<p><strong>Scala Unit Test</strong></p>

<div class="wp_syntax"><div class="code"><pre class="scala" style="font-family:monospace;"><span style="color: #0000ff; font-weight: bold;">package</span> it.<span style="color: #000000;">javalinux</span>.<span style="color: #000000;">samples</span>.<span style="color: #000000;">scala</span>
&nbsp;
<span style="color: #0000ff; font-weight: bold;">import</span> org.<span style="color: #000000;">junit</span>.<span style="color: #000080;">_</span>
<span style="color: #0000ff; font-weight: bold;">import</span> Assert.<span style="color: #000080;">_</span>
&nbsp;
<span style="color: #000080;">@</span>Test
<span style="color: #0000ff; font-weight: bold;">class</span> AppTest <span style="color: #F78811;">&#123;</span>
&nbsp;
    <span style="color: #000080;">@</span>Test
    <span style="color: #0000ff; font-weight: bold;">def</span> testOK<span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> assertTrue<span style="color: #F78811;">&#40;</span><span style="color: #0000ff; font-weight: bold;">true</span><span style="color: #F78811;">&#41;</span>
&nbsp;
<span style="color: #008000; font-style: italic;">//    @Test</span>
<span style="color: #008000; font-style: italic;">//    def testKO() = assertTrue(false)</span>
&nbsp;
<span style="color: #F78811;">&#125;</span></pre></div></div>

<p><strong>Scala BDD specs</strong></p>

<div class="wp_syntax"><div class="code"><pre class="scala" style="font-family:monospace;"><span style="color: #0000ff; font-weight: bold;">package</span> it.<span style="color: #000000;">javalinux</span>.<span style="color: #000000;">samples</span>.<span style="color: #000000;">scala</span>
&nbsp;
<span style="color: #0000ff; font-weight: bold;">import</span> org.<span style="color: #000000;">specs</span>.<span style="color: #000080;">_</span>
<span style="color: #0000ff; font-weight: bold;">import</span> org.<span style="color: #000000;">specs</span>.<span style="color: #000000;">runner</span>.<span style="color: #F78811;">&#123;</span>ConsoleRunner, JUnit4<span style="color: #F78811;">&#125;</span>
&nbsp;
<span style="color: #0000ff; font-weight: bold;">class</span> MySpecTest <span style="color: #0000ff; font-weight: bold;">extends</span> JUnit4<span style="color: #F78811;">&#40;</span>MySpec<span style="color: #F78811;">&#41;</span>
<span style="color: #008000; font-style: italic;">//class MySpecSuite extends ScalaTestSuite(MySpec)</span>
<span style="color: #0000ff; font-weight: bold;">object</span> MySpecRunner <span style="color: #0000ff; font-weight: bold;">extends</span> ConsoleRunner<span style="color: #F78811;">&#40;</span>MySpec<span style="color: #F78811;">&#41;</span>
&nbsp;
<span style="color: #0000ff; font-weight: bold;">object</span> MySpec <span style="color: #0000ff; font-weight: bold;">extends</span> Specification <span style="color: #F78811;">&#123;</span>
  <span style="color: #6666FF;">&quot;This wonderful system&quot;</span> should <span style="color: #F78811;">&#123;</span>
    <span style="color: #6666FF;">&quot;save the world&quot;</span> in <span style="color: #F78811;">&#123;</span>
      <span style="color: #0000ff; font-weight: bold;">val</span> list <span style="color: #000080;">=</span> Nil
      list must beEmpty
    <span style="color: #F78811;">&#125;</span>
  <span style="color: #F78811;">&#125;</span>
<span style="color: #F78811;">&#125;</span></pre></div></div>

<p><strong>My Comments</strong><br />
It have been your first taste of scala. How do you feel with it?</p>
<p>Of course, since it is your first piece of scala code in this samples you have to note a lot of things. Don&#8217;t try to get all aspects right now, I promise I&#8217;ll explain you each of them in great detail in next future:</p>
<ul>
<li>Scala support two keyword class and object. The first one is the same than in scala, while the object is the keyword to define singleton object. Singleton object is the way scala define &#8220;static&#8221; methods in a pure object oriented style&#8230;don&#8217;t ask me to explain in this very first sample singleton object and/or companion object&#8230;we will explain their usefulness very sonn, just be a little patience and think it as classes with all static methods. Let me remark they are much more than this, but we will focus on them later in our series.</li>
<li>Scala method definition syntax. The equals after a method name suggest that a method is function returning a value, while methods without equals symbol, or declaring Unit as return type, are procedure defined only for their side effects.</li>
<li>Scala val keyword. Scala support two kind of variable definition. val keyword define an immutable variable (like final in java) while var define a mutable variable. Please keep in mind using of val is encouraged and very often used to develop with a functional style.</li>
<li>Scala conciseness: The App class is more concise in scala, and AppTest is much more concise than Java one. Conciseness can hurt you at a very first stage, you can feel concise code less readable in some cases. But it is really an advantage: less code = less error, and a good code style can help you to keep your code readable even if concise.</li>
<li>Scala doesn&#8217;t need main() method to make a class executable. You just need to extends Application trait. WTF is a trait? We will have a lot of time to explain it better with some more useful samples. For now just think a trait as an interface with some methods implementation.</li>
<li>Underscore char ( _ ) is used in imports instead of star ( * ) as wild card. Moreover Scala support also imports of classes sets in same package using {firstClass,SecondClass} notation (have a look of that on MySpecTest).</li>
<li>The scala maven artifact create also a BDD spec. It&#8217;s because BDD is supported and suggested by the scala community. I&#8217;m not going to introduce you to BDD specs here, at least not today. Just keep in mind BDD is quite used in scala community.</li>
</ul>
<p>Ok, it has been just your first taste of Scala, I&#8217;ve already said too much and put too much things in our plate. In our next post we will take a look to some very basic language&#8217;s feature like how to define class, variables, and methods/procedures.</p>
<p>Of course all code is available on our <a href="http://github.com/maeste/java2scalaSamples" target="_blank">github project</a></p>
<p>Next post is coming in few days (probably during next week end) and it will be focus on basic variables and methods definition.</p>
<p>Stay tuned.</p>
<div style="clear:both;">&nbsp;</div>

<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/&amp;title=java2scala+%232%3A+Hello+world" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/&amp;title=java2scala+%232%3A+Hello+world" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/&amp;title=java2scala+%232%3A+Hello+world&amp;desc=The%20first%20java2scala%20samples%20we%20are%20going%20to%20discuss%20is%20generated%20by%20creating%20project%20from%20maven%20archetype.%0D%0ALet%20me%20remember%20you%20that%20you%20need%20an%20environment%20with%3A%0D%0A%0D%0A%09Eclipse%20with%20eclipse-scala%20plugin%0D%0A%09maven%20wih%20maven-scala%20plugin%0D%0A%09git%20to%20clone%20the%20project%20from%20github.%20This%20is%20optional%2C%20you%20can%20o" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/&amp;title=java2scala+%232%3A+Hello+world" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/&amp;title=java2scala+%232%3A+Hello+world" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/&amp;title=java2scala+%232%3A+Hello+world" rel="nofollow" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/&amp;t=java2scala+%232%3A+Hello+world" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=java2scala+%232%3A+Hello+world+-+http://cli.gs/DuMpg+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/&amp;title=java2scala+%232%3A+Hello+world&amp;summary=The%20first%20java2scala%20samples%20we%20are%20going%20to%20discuss%20is%20generated%20by%20creating%20project%20from%20maven%20archetype.%0D%0ALet%20me%20remember%20you%20that%20you%20need%20an%20environment%20with%3A%0D%0A%0D%0A%09Eclipse%20with%20eclipse-scala%20plugin%0D%0A%09maven%20wih%20maven-scala%20plugin%0D%0A%09git%20to%20clone%20the%20project%20from%20github.%20This%20is%20optional%2C%20you%20can%20o&amp;source=Legolas in Minas Tirith" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/&amp;bm_description=java2scala+%232%3A+Hello+world&amp;plugin=sexybookmarks" rel="nofollow" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=java2scala+%232%3A+Hello+world&amp;link=http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/" rel="nofollow" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/&amp;n=java2scala+%232%3A+Hello+world&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<p><a href="http://feedads.g.doubleclick.net/~a/J5jEigTzRTxBD24RlsGPLcZmQfM/0/da"><img src="http://feedads.g.doubleclick.net/~a/J5jEigTzRTxBD24RlsGPLcZmQfM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/J5jEigTzRTxBD24RlsGPLcZmQfM/1/da"><img src="http://feedads.g.doubleclick.net/~a/J5jEigTzRTxBD24RlsGPLcZmQfM/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=DEIIM8pbzhk:SOJNV-GygUo:vzDxczd-HtA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=vzDxczd-HtA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=DEIIM8pbzhk:SOJNV-GygUo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=DEIIM8pbzhk:SOJNV-GygUo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=DEIIM8pbzhk:SOJNV-GygUo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=DEIIM8pbzhk:SOJNV-GygUo:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=DEIIM8pbzhk:SOJNV-GygUo:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=DEIIM8pbzhk:SOJNV-GygUo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=DEIIM8pbzhk:SOJNV-GygUo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=DEIIM8pbzhk:SOJNV-GygUo:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=DEIIM8pbzhk:SOJNV-GygUo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=DEIIM8pbzhk:SOJNV-GygUo:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=DEIIM8pbzhk:SOJNV-GygUo:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=DEIIM8pbzhk:SOJNV-GygUo:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LegolasInMinasTirith/~4/DEIIM8pbzhk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.javalinux.it/wordpress/2009/12/16/java2scala-2-hello-world/</feedburner:origLink></item>
		<item>
		<title>java2scala #1: Introduction</title>
		<link>http://feedproxy.google.com/~r/LegolasInMinasTirith/~3/IwCu0vQ-Tbo/</link>
		<comments>http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 20:52:30 +0000</pubDate>
		<dc:creator>Stefano MAESTRI</dc:creator>
				<category><![CDATA[java2scala]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=340</guid>
		<description><![CDATA[

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		
		
		
		
		
			
				
			
		
This is the very first post of a new series in which I&#8217;ll try to introduce scala to an audience supposed to be a quite expert and [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/";
		var dzone_title = "java2scala #1: Introduction";
		var dzone_style = "1";
		var dzone_blurb = "																				This is the very first post of a new series in which I&#8217;ll try to introduce scala to an audience supposed to be a quite expert and very busy Java programmer. I don&#8217;t want to discuss here if scala will be the next success...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "java2scala #1: Introduction";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F12%2F13%2Fjava2scala-1-introduction%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F12%2F13%2Fjava2scala-1-introduction%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>This is the very first post of a new series in which I&#8217;ll try to introduce scala to an audience supposed to be a quite expert and very busy Java programmer. I don&#8217;t want to discuss here if <a href="http://www.scala-lang.org/" target="_blank">scala</a> will be the next success language in favour of Java (even if I agree with some opinions about that <a href="http://olabini.com/blog/2008/10/language-revolution/" target="_blank">[1]</a> <a href="http://markclittle.blogspot.com/2009/11/future-of-java.html" target="_blank">[2]</a>). I&#8217;d like to just suppose you:</p>
<ul>
<li>Are a quite expert Java developer. So you can read and understand in few seconds not too complex java samples.</li>
<li>You think a polyglot programmer is a must nowadays: see <a href="http://www.javalinux.it/wordpress/2008/07/20/soa-and-heterogeneous-technology-environmet-eggs-and-chicken-problem/" target="_blank">my opinion</a> and what a <a href="http://jbossdna.blogspot.com/2008/06/java-developers-should-learn-ruby.html" target="_blank">friend of mine said</a> about that.</li>
<li>You are very interested in <a href="http://www.scala-lang.org/" target="_blank">scala language</a> and would get in touch with it</li>
<li>You are terrible busy and/or prefer to learn from examples than from a book. Of course at some stage of your learning a good book would be a must. Don&#8217;t worry there are <a href="http://www.scala-lang.org/node/959" target="_blank">many good book about scala</a>. As said if you are busy some samples comparing a well known java with scala could help you to get a first idea about scala.</li>
</ul>
<p>At this point you have probably already got what I have in mind: a post series (maybe a long one) with a set of samples written in java and in scala doing the same things. I think it could be a good way for an expert java developer to compare the language, understand similarities, difference and totally new features of the language. Of course I&#8217;ll try to help you to get all these points with some opportune comment in my posts.</p>
<p>I&#8217;m trying to make your life easier. For example what I don&#8217;t like (from my java developer point of view) of all books article and tutorials about scala (and more generally speaking about all new languages around) is that all samples are written to run in console and suppose to demonstrate everything with the console output. Of course it is the easiest way to try something in the new language and (don&#8217;t misunderstand me) scala console is great to play with the language. But it isn&#8217;t what a java developer is used to. We are used to an IDE to edit our code, a build framework to build/package/resolve dependencies, unit tests to better understand and verify code, a version control system to keep track of our code changes and their history. And I&#8217;m trying to present java2scala samples with no console, but a complete environment where you will feel at home:</p>
<p style="text-align: center;">java2scala samples will be not only a series of blog posts, but also a project:</p>
<ul>
<li>Using Eclipse and the scala plugin as IDE</li>
<li>Using maven as build environment (with scala-maven-plugin and m2eclipse integration)</li>
<li>All samples will always have its own unit tests (both for java and scala sample)</li>
<li><a href="http://github.com/maeste/java2scalaSamples" target="_blank">The project is hosted on github</a> using git as SCM and having some great good feature of github like direct download of last committed code.</li>
<li>All samples will have a blog post describing every sample details and difference and features of both languages presented in the samples. I&#8217;ll try to keep my comment as minimal as possible, hoping sample code can explain itself. I&#8217;ll just try to point your attention to some crucial aspect of samples presented, but , of course, feel free to ask.</li>
</ul>
<p>The project will be always up to date to the last blog posts (at least master branch) and will contain 2 maven modules: java samples and scala samples. Of course both module will have same samples (and their unit tests) in the same packages written in the two different languages.</p>
<p>All what you have to do is to download (or much better &#8220;<code>git clone git://github.com/maeste/java2scalaSamples.git</code>&#8221; the project), import it as maven project in an eclipse workspace with m2eclipse and scala plugin installed and start to explore it. Of course don&#8217;t forget to follow this blog for posts explaining new samples (I think I&#8217;ll have 1 or 2 new posts a week).</p>
<p>Posts in this blog will be very important too describing samples and remarking differences, explaining what I have in mind and I would demonstrate abour Scale with various samples. Javadocs of any sample will contain a link to the dedicated blog post. All posts will be laced in a dedicated category <a href="http://www.javalinux.it/wordpress/categories/java2scala/" target="_blank">java2scala</a> and will also have its own <a href="http://www.javalinux.it/wordpress/java2scala/" target="_blank">homepage</a> with this description, some useful links and a link to the category index.</p>
<p>Would you contribute in some way? Of course the simplest way is comments on this blog to add some different point of view, or open a discussion about any sample, but also someone who would join with some sample written in another language would be cool: it would permit us to compare Java, Scala, and some other language out there. Any other ideas? Feel free to write me.</p>
<p>Anyway, let&#8217;s me start with next post description of the very first samples already committed in git project&#8230;it will be posted Tuesday night (CET).</p>
<p>Stay tuned.</p>
<div style="clear:both;">&nbsp;</div>

<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/&amp;title=java2scala+%231%3A+Introduction" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/&amp;title=java2scala+%231%3A+Introduction" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/&amp;title=java2scala+%231%3A+Introduction&amp;desc=This%20is%20the%20very%20first%20post%20of%20a%20new%20series%20in%20which%20I%27ll%20try%20to%20introduce%20scala%20to%20an%20audience%20supposed%20to%20be%20a%20quite%20expert%20and%20very%20busy%20Java%20programmer.%20I%20don%27t%20want%20to%20discuss%20here%20if%20scala%20will%20be%20the%20next%20success%20language%20in%20favour%20of%20Java%20%28even%20if%20I%20agree%20with%20some%20opinions%20about%20that%20%5B1%5D%20%5B2" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/&amp;title=java2scala+%231%3A+Introduction" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/&amp;title=java2scala+%231%3A+Introduction" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/&amp;title=java2scala+%231%3A+Introduction" rel="nofollow" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/&amp;t=java2scala+%231%3A+Introduction" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=java2scala+%231%3A+Introduction+-+http://cli.gs/MHBPP+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/&amp;title=java2scala+%231%3A+Introduction&amp;summary=This%20is%20the%20very%20first%20post%20of%20a%20new%20series%20in%20which%20I%27ll%20try%20to%20introduce%20scala%20to%20an%20audience%20supposed%20to%20be%20a%20quite%20expert%20and%20very%20busy%20Java%20programmer.%20I%20don%27t%20want%20to%20discuss%20here%20if%20scala%20will%20be%20the%20next%20success%20language%20in%20favour%20of%20Java%20%28even%20if%20I%20agree%20with%20some%20opinions%20about%20that%20%5B1%5D%20%5B2&amp;source=Legolas in Minas Tirith" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/&amp;bm_description=java2scala+%231%3A+Introduction&amp;plugin=sexybookmarks" rel="nofollow" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=java2scala+%231%3A+Introduction&amp;link=http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/" rel="nofollow" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/&amp;n=java2scala+%231%3A+Introduction&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<p><a href="http://feedads.g.doubleclick.net/~a/hIybzuDNoj53iEQ6ixseCe0yMtk/0/da"><img src="http://feedads.g.doubleclick.net/~a/hIybzuDNoj53iEQ6ixseCe0yMtk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/hIybzuDNoj53iEQ6ixseCe0yMtk/1/da"><img src="http://feedads.g.doubleclick.net/~a/hIybzuDNoj53iEQ6ixseCe0yMtk/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=IwCu0vQ-Tbo:yxq8Y1ShjSg:vzDxczd-HtA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=vzDxczd-HtA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=IwCu0vQ-Tbo:yxq8Y1ShjSg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=IwCu0vQ-Tbo:yxq8Y1ShjSg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=IwCu0vQ-Tbo:yxq8Y1ShjSg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=IwCu0vQ-Tbo:yxq8Y1ShjSg:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=IwCu0vQ-Tbo:yxq8Y1ShjSg:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=IwCu0vQ-Tbo:yxq8Y1ShjSg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=IwCu0vQ-Tbo:yxq8Y1ShjSg:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=IwCu0vQ-Tbo:yxq8Y1ShjSg:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=IwCu0vQ-Tbo:yxq8Y1ShjSg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=IwCu0vQ-Tbo:yxq8Y1ShjSg:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=IwCu0vQ-Tbo:yxq8Y1ShjSg:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=IwCu0vQ-Tbo:yxq8Y1ShjSg:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LegolasInMinasTirith/~4/IwCu0vQ-Tbo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javalinux.it/wordpress/2009/12/13/java2scala-1-introduction/</feedburner:origLink></item>
		<item>
		<title>another passion: wines and food</title>
		<link>http://feedproxy.google.com/~r/LegolasInMinasTirith/~3/ibNXDIVtGjo/</link>
		<comments>http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 20:56:15 +0000</pubDate>
		<dc:creator>Stefano MAESTRI</dc:creator>
				<category><![CDATA[blogging]]></category>
		<category><![CDATA[friends]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[spare time]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=326</guid>
		<description><![CDATA[

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		
		
		
		
		
			
				
			
		
Probably not all my readers know that I&#8217;ve another big passion
than technology and development: food and wines tasting.
I&#8217;m a good chef (well, some friends said I&#8217;m a [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/";
		var dzone_title = "another passion: wines and food";
		var dzone_style = "1";
		var dzone_blurb = "																				Probably not all my readers know that I&#8217;ve another big passionthan technology and development: food and wines tasting.I&#8217;m a good chef (well, some friends said I&#8217;m a GREAT chef&#8230;but you know they are friends&#8230;and...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "another passion: wines and food";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F10%2F25%2Fanother-passion-wines-and-food%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F10%2F25%2Fanother-passion-wines-and-food%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Probably not all my readers know that I&#8217;ve another big passion<br />
than technology and development: food and wines tasting.<br />
I&#8217;m a good chef (well, some friends said I&#8217;m a GREAT chef&#8230;but you know they are friends&#8230;and my guests when they have said that) and a quite expert sommelier.</p>
<p>Don&#8217;t worry I&#8217;m not transforming this blog in a food blog full of recipes and tastes. Just a single post to inform my readers who share passion for wines with me that<a href="http://cli.gs/NXLpq4" target="_blank"> I&#8217;m compiling a simple sheet with my wine tastes</a>, sharing it with a friend of mine (<a href="http://twitter.com/marekgoldmann" target="_blank">Marek Goldmann</a>) and <a href="http://cli.gs/NXLpq4" target="_blank">readable by any person on the internet</a></p>
<p>Have fun and contact me for any question about my taste&#8230;it&#8217;s a pleasure for me to spend some minutes sharing my passion. Of course other passionates who would share their tastes are more than welcome. Just let us know.</p>
<div style="clear:both;">&nbsp;</div>

<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/&amp;title=another+passion%3A+wines+and+food" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/&amp;title=another+passion%3A+wines+and+food" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/&amp;title=another+passion%3A+wines+and+food&amp;desc=Probably%20not%20all%20my%20readers%20know%20that%20I%27ve%20another%20big%20passion%0D%0Athan%20technology%20and%20development%3A%20food%20and%20wines%20tasting.%0D%0AI%27m%20a%20good%20chef%20%28well%2C%20some%20friends%20said%20I%27m%20a%20GREAT%20chef...but%20you%20know%20they%20are%20friends...and%20my%20guests%20when%20they%20have%20said%20that%29%20and%20a%20quite%20expert%20sommelier.%0D%0A%0D%0ADon%27t%20worry%20I" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/&amp;title=another+passion%3A+wines+and+food" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/&amp;title=another+passion%3A+wines+and+food" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/&amp;title=another+passion%3A+wines+and+food" rel="nofollow" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/&amp;t=another+passion%3A+wines+and+food" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=another+passion%3A+wines+and+food+-+http://cli.gs/X4LLM+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/&amp;title=another+passion%3A+wines+and+food&amp;summary=Probably%20not%20all%20my%20readers%20know%20that%20I%27ve%20another%20big%20passion%0D%0Athan%20technology%20and%20development%3A%20food%20and%20wines%20tasting.%0D%0AI%27m%20a%20good%20chef%20%28well%2C%20some%20friends%20said%20I%27m%20a%20GREAT%20chef...but%20you%20know%20they%20are%20friends...and%20my%20guests%20when%20they%20have%20said%20that%29%20and%20a%20quite%20expert%20sommelier.%0D%0A%0D%0ADon%27t%20worry%20I&amp;source=Legolas in Minas Tirith" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/&amp;bm_description=another+passion%3A+wines+and+food&amp;plugin=sexybookmarks" rel="nofollow" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=another+passion%3A+wines+and+food&amp;link=http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/" rel="nofollow" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/&amp;n=another+passion%3A+wines+and+food&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<p><a href="http://feedads.g.doubleclick.net/~a/fiR9D4Re0v_OlKxmStjBrUIBwrQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/fiR9D4Re0v_OlKxmStjBrUIBwrQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/fiR9D4Re0v_OlKxmStjBrUIBwrQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/fiR9D4Re0v_OlKxmStjBrUIBwrQ/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=ibNXDIVtGjo:VZulbjIovps:vzDxczd-HtA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=vzDxczd-HtA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=ibNXDIVtGjo:VZulbjIovps:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=ibNXDIVtGjo:VZulbjIovps:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=ibNXDIVtGjo:VZulbjIovps:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=ibNXDIVtGjo:VZulbjIovps:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=ibNXDIVtGjo:VZulbjIovps:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=ibNXDIVtGjo:VZulbjIovps:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=ibNXDIVtGjo:VZulbjIovps:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=ibNXDIVtGjo:VZulbjIovps:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=ibNXDIVtGjo:VZulbjIovps:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=ibNXDIVtGjo:VZulbjIovps:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=ibNXDIVtGjo:VZulbjIovps:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=ibNXDIVtGjo:VZulbjIovps:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LegolasInMinasTirith/~4/ibNXDIVtGjo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javalinux.it/wordpress/2009/10/25/another-passion-wines-and-food/</feedburner:origLink></item>
		<item>
		<title>Google code issue tracker integration with version control using git commit template</title>
		<link>http://feedproxy.google.com/~r/LegolasInMinasTirith/~3/NN8tiTXNRuE/</link>
		<comments>http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 21:39:46 +0000</pubDate>
		<dc:creator>Stefano MAESTRI</dc:creator>
				<category><![CDATA[google code]]></category>
		<category><![CDATA[ideas]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[project management]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=319</guid>
		<description><![CDATA[

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		
		
		
		
		
			
				
			
		
I&#8217;m using google code for one of my open source project. And I think it is definitively a good code site.
All open source community code site have [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/";
		var dzone_title = "Google code issue tracker integration with version control using git commit template";
		var dzone_style = "1";
		var dzone_blurb = "																				I&#8217;m using google code for one of my open source project. And I think it is definitively a good code site.All open source community code site have its pros and cons (I&#8217;ve tried a lot of them sourceforge, github, jboss.org,...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "Google code issue tracker integration with version control using git commit template";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F10%2F17%2Fgoogle-code-issue-tracker-integration-with-version-control-using-git-commit-template%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F10%2F17%2Fgoogle-code-issue-tracker-integration-with-version-control-using-git-commit-template%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I&#8217;m using <a href="http://code.google.com/" target="_blank">google code</a> for one of my <a href="http://code.google.com/p/testedby/">open source project</a>. And I think it is definitively a good code site.</p>
<p>All open source community code site have its pros and cons (I&#8217;ve tried a lot of them sourceforge, github, jboss.org, google code etc), and every one have some beautiful unique feature. But one of my most loved feature is definitively <a href="http://code.google.com/p/support/wiki/IssueTracker#Integration_with_version_control" target="_blank">google code&#8217;s integration of issue tracker and version control</a>. In a nutshell it permit to create, update and close issues just adding some keyword on your commit.</p>
<p>It&#8217;s great in general, but it&#8217;s really amazing if you are using a <a href="http://en.wikipedia.org/wiki/Revision_control#Distributed_revision_control" target="_blank">distributed Version Control</a>. And I&#8217;m using <a href="http://git-scm.com/" target="_blank">git</a> for local repository and <a href="http://www.kernel.org/pub/software/scm/git/docs/git-svn.html" target="_blank">git-svn</a> to synchronize it with central <a href="http://subversion.tigris.org/" target="_blank">subversion</a> repository.<br />
Imagine this situation: you are working with your laptop off-line (i.e into an air plane where also GSM connection isn&#8217;t available) and you find a bug or you have an idea for an enhancement. What do you do in this case? Of course take care of the bugged code, fix it, write a test for that and then commit it into your git local repository. What is the missing step in this work flow? Of course create an issue into your issue tracker system to keep community up to date, and don&#8217;t forget it if you can&#8217;t completely finish it now. At this point come very useful the google code feature permitting you to create, update, or fix an issue when you are committing a change.</p>
<p>There is only one problem with this integration: remember the structure the commit message have to fit and all (or at least the most useful) values you can assign to various fields. I&#8217;ve solved this problem creating 3 template for the commit messages and I use them with git. Using template during a git commit is very easy: just make a commit like this</p>
<pre>git commit -a -t tempalteFile</pre>
<p>Git will Use the contents of the given file as the initial version of the commit message. The editor is invoked and you can make subsequent changes. If a message is specified using the -m or -F options, this option has no effect.</p>
<p>Here you have my 3 template file:</p>
<p>NewIssue.tmpl</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">#commit comment here
&nbsp;
#next line doesn't need any number. ssue number will be automaticaly assigned after commit
New issue
#A summary is always needed. Please complete next line
Summary:
#Uncomment the rigt Status
#Status: Accepted
#Status: Fixed
#Status: New
#Uncommet right Labels and/or add labels to the list (comma or space separate)
#Labels: Type-Defect Priority-Medium
#Labels: Type-Defect Priority-High
#Labels: Type-Defect Priority-Critical
#Labels: Type-Enhancement Priority-Medium
#Labels: Type-Enhancement Priority-Low
#Labels: Type-Enhancement Priority-High
&nbsp;
#Comment text for the issue tracker goes here</pre></div></div>

<p>UpdateIssue.tmpl</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">#commit comment here
&nbsp;
#Complete next line with issue number
Update issue
#summary is rarely updated. If you need that uncomment and complete next line
#Summary:
#Uncomment the new Status you would get your issue. No uncomment status will keep the previous status
#Status: Accepted
#Status: Fixed
#Status: New
#Uncommet Labels and/or add labels to the list (comma or space separate) if you want update/add Labels
#Labels: Type-Defect Priority-Medium
#Labels: Type-Defect Priority-High
#Labels: Type-Defect Priority-Critical
#Labels: Type-Enhancement Priority-Medium
#Labels: Type-Enhancement Priority-Low
#Labels: Type-Enhancement Priority-High
&nbsp;
#Comment text for the issue tracker goes here</pre></div></div>

<p>FixIssue.tmpl</p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">#commit comment here
&nbsp;
#Complete next line with issue number
Fixes issue
&nbsp;
#Comment text for the issue tracker goes here</pre></div></div>

<p>The same thing should be possible also with svn and other SCM.</p>
<p>Hoping it could help some other people enjoying this google code feature developing open source code during their trips <img src='http://www.javalinux.it/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Have fun!</p>
<div style="clear:both;">&nbsp;</div>

<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/&amp;title=Google+code+issue+tracker+integration+with+version+control+using+git+commit+template" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/&amp;title=Google+code+issue+tracker+integration+with+version+control+using+git+commit+template" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/&amp;title=Google+code+issue+tracker+integration+with+version+control+using+git+commit+template&amp;desc=I%27m%20using%20google%20code%20for%20one%20of%20my%20open%20source%20project.%20And%20I%20think%20it%20is%20definitively%20a%20good%20code%20site.%0D%0A%0D%0AAll%20open%20source%20community%20code%20site%20have%20its%20pros%20and%20cons%20%28I%27ve%20tried%20a%20lot%20of%20them%20sourceforge%2C%20github%2C%20jboss.org%2C%20google%20code%20etc%29%2C%20and%20every%20one%20have%20some%20beautiful%20unique%20feature.%20But%20on" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/&amp;title=Google+code+issue+tracker+integration+with+version+control+using+git+commit+template" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/&amp;title=Google+code+issue+tracker+integration+with+version+control+using+git+commit+template" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/&amp;title=Google+code+issue+tracker+integration+with+version+control+using+git+commit+template" rel="nofollow" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/&amp;t=Google+code+issue+tracker+integration+with+version+control+using+git+commit+template" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Google+code+issue+tracker+integration+with+version+control+using+git+commit+temp%5B..%5D+-+http://cli.gs/VU67D+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/&amp;title=Google+code+issue+tracker+integration+with+version+control+using+git+commit+template&amp;summary=I%27m%20using%20google%20code%20for%20one%20of%20my%20open%20source%20project.%20And%20I%20think%20it%20is%20definitively%20a%20good%20code%20site.%0D%0A%0D%0AAll%20open%20source%20community%20code%20site%20have%20its%20pros%20and%20cons%20%28I%27ve%20tried%20a%20lot%20of%20them%20sourceforge%2C%20github%2C%20jboss.org%2C%20google%20code%20etc%29%2C%20and%20every%20one%20have%20some%20beautiful%20unique%20feature.%20But%20on&amp;source=Legolas in Minas Tirith" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/&amp;bm_description=Google+code+issue+tracker+integration+with+version+control+using+git+commit+template&amp;plugin=sexybookmarks" rel="nofollow" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Google+code+issue+tracker+integration+with+version+control+using+git+commit+template&amp;link=http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/" rel="nofollow" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/&amp;n=Google+code+issue+tracker+integration+with+version+control+using+git+commit+template&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<p><a href="http://feedads.g.doubleclick.net/~a/vTSN7T74tcjCGz8o_iB7HIhm2pg/0/da"><img src="http://feedads.g.doubleclick.net/~a/vTSN7T74tcjCGz8o_iB7HIhm2pg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/vTSN7T74tcjCGz8o_iB7HIhm2pg/1/da"><img src="http://feedads.g.doubleclick.net/~a/vTSN7T74tcjCGz8o_iB7HIhm2pg/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=NN8tiTXNRuE:CheekFOmWbI:vzDxczd-HtA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=vzDxczd-HtA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=NN8tiTXNRuE:CheekFOmWbI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=NN8tiTXNRuE:CheekFOmWbI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=NN8tiTXNRuE:CheekFOmWbI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=NN8tiTXNRuE:CheekFOmWbI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=NN8tiTXNRuE:CheekFOmWbI:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=NN8tiTXNRuE:CheekFOmWbI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=NN8tiTXNRuE:CheekFOmWbI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=NN8tiTXNRuE:CheekFOmWbI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=NN8tiTXNRuE:CheekFOmWbI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=NN8tiTXNRuE:CheekFOmWbI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=NN8tiTXNRuE:CheekFOmWbI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=NN8tiTXNRuE:CheekFOmWbI:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LegolasInMinasTirith/~4/NN8tiTXNRuE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javalinux.it/wordpress/2009/10/17/google-code-issue-tracker-integration-with-version-control-using-git-commit-template/</feedburner:origLink></item>
		<item>
		<title>Writing an irc bot for svn commit notification</title>
		<link>http://feedproxy.google.com/~r/LegolasInMinasTirith/~3/YHq03or1XaI/</link>
		<comments>http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 11:40:04 +0000</pubDate>
		<dc:creator>Stefano MAESTRI</dc:creator>
				<category><![CDATA[ideas]]></category>
		<category><![CDATA[project management]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=311</guid>
		<description><![CDATA[

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		
		
		
		
		
			
				
			
		
Recently I&#8217;ve started working with a new team. Since we are based in 2 different site a bit far each other we are using extensively an IRC [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/";
		var dzone_title = "Writing an irc bot for svn commit notification";
		var dzone_style = "1";
		var dzone_blurb = "																				Recently I&#8217;ve started working with a new team. Since we are based in 2 different site a bit far each other we are using extensively an IRC channel to communicate.We are using subversion as SCM and we need to keep all members...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "Writing an irc bot for svn commit notification";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F10%2F15%2Fwriting-an-irc-bot-for-svn-commit-notification%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F10%2F15%2Fwriting-an-irc-bot-for-svn-commit-notification%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Recently I&#8217;ve started working with a new team. Since we are based in 2 different site a bit far each other we are using extensively an <a href="http://en.wikipedia.org/wiki/Internet_Relay_Chat" target="_blank">IRC</a> channel to communicate.</p>
<p>We are using <a href="http://subversion.tigris.org/" target="_blank">subversion</a> as SCM and we need to keep all members of the team up to date about svn commits. The solution I&#8217;ve put in place during an insomniac night in an hotel is a post-commit hook invoking an irc bot script written in perl connecting to the server and shotting a message there. Quite simple, and it is taking its goal.</p>
<p>In $SVN_REPOSITORY/hooks edit and make executable the file <a href="http://svnbook.red-bean.com/en/1.4/svn.ref.reposhooks.post-commit.html" target="_blank">post-commit</a></p>

<div class="wp_syntax"><div class="code"><pre class="sh" style="font-family:monospace;">#!/bin/sh
&nbsp;
REPOS=&quot;$1&quot;
TXN=&quot;$2&quot;
SVNLOOK=/usr/bin/svnlook
&nbsp;
# get last commit message
COMMIT=`$SVNLOOK log &quot;$REPOS&quot;`
USER=`whoami`
&nbsp;
# call bot with arguments reposname, revison and commit message in one string
/usr/bin/perl /usr/local/bin/svn_irc_bot.pl &quot;$USER $REPOS r$TXN: $COMMIT&quot;
&nbsp;
# all checks passed, so allow the commit
exit 0</pre></div></div>

<p>then edit and make executable the file /usr/local/bin/svn_irc_bot.pl</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl -w</span>
<span style="color: #666666; font-style: italic;">#svn_irc_bot.pl</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$server</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">#put here your address</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$port</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">6667</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$nick</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;svn_bot&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$ident</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;svn_bot&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$realname</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;svn_bot&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$chan</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;#YourChannel&quot;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">#put here your channel name</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$pass</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;svn_bot&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$svn_commit</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> IO<span style="color: #339933;">::</span><span style="color: #006600;">Socket</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$irc</span><span style="color: #339933;">=</span>IO<span style="color: #339933;">::</span><span style="color: #006600;">Socket</span><span style="color: #339933;">::</span><span style="color: #006600;">INET</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>new<span style="color: #009900;">&#40;</span>
PeerAddr<span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #0000ff;">$server</span><span style="color: #339933;">,</span>
PeerPort<span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #0000ff;">$port</span><span style="color: #339933;">,</span>
Proto<span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #ff0000;">'tcp'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;DEAD!&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#print $irc &quot;USER $ident $ident $ident $ident :$realname\n&quot;;</span>
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$irc</span> <span style="color: #ff0000;">&quot;NICK $nick<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#print $irc &quot;PRIVMSG nickserv/@/services.dal.net :identify $pass\n&quot;;</span>
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$irc</span> <span style="color: #ff0000;">&quot;USER $ident 8 * :Perl IRC Hacks Robot<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$irc</span> <span style="color: #ff0000;">&quot;join $chan<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$in</span> <span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span><span style="color: #0000ff;">$irc</span><span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$in</span><span style="color: #339933;">=~/</span>004<span style="color: #339933;">/</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$irc</span> <span style="color: #ff0000;">&quot;PRIVMSG $chan :$svn_commit <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">last</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$in</span><span style="color: #339933;">=~/</span>^PING<span style="color: #009900;">&#40;</span>.<span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span><span style="color: #0000ff;">$/</span>i<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$irc</span> <span style="color: #ff0000;">&quot;PONG :$1<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$irc</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">#EOF</span></pre></div></div>

<p>If user named &#8220;fooUser&#8221; make a commit on &#8220;fooRepository&#8221; for release 409 with a comment like &#8220;this is a fooComment&#8221; on irc channel you will get something like:</p>
<pre>&lt;svn_bot&gt; fooUser fooRepository r409: this is a fooComment</pre>
<p>I took the base of code <a href="http://happynerds.wordpress.com/2008/01/06/irc-message-after-svn-commits/" target="_blank">here</a>. Then I&#8217;ve modified it a little to get result I like.</p>
<div style="clear:both;">&nbsp;</div>

<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/&amp;title=Writing+an+irc+bot+for+svn+commit+notification" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/&amp;title=Writing+an+irc+bot+for+svn+commit+notification" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/&amp;title=Writing+an+irc+bot+for+svn+commit+notification&amp;desc=Recently%20I%27ve%20started%20working%20with%20a%20new%20team.%20Since%20we%20are%20based%20in%202%20different%20site%20a%20bit%20far%20each%20other%20we%20are%20using%20extensively%20an%20IRC%20channel%20to%20communicate.%0D%0A%0D%0AWe%20are%20using%20subversion%20as%20SCM%20and%20we%20need%20to%20keep%20all%20members%20of%20the%20team%20up%20to%20date%20about%20svn%20commits.%20The%20solution%20I%27ve%20put%20in%20plac" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/&amp;title=Writing+an+irc+bot+for+svn+commit+notification" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/&amp;title=Writing+an+irc+bot+for+svn+commit+notification" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/&amp;title=Writing+an+irc+bot+for+svn+commit+notification" rel="nofollow" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/&amp;t=Writing+an+irc+bot+for+svn+commit+notification" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Writing+an+irc+bot+for+svn+commit+notification+-+http://cli.gs/H9DRy+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/&amp;title=Writing+an+irc+bot+for+svn+commit+notification&amp;summary=Recently%20I%27ve%20started%20working%20with%20a%20new%20team.%20Since%20we%20are%20based%20in%202%20different%20site%20a%20bit%20far%20each%20other%20we%20are%20using%20extensively%20an%20IRC%20channel%20to%20communicate.%0D%0A%0D%0AWe%20are%20using%20subversion%20as%20SCM%20and%20we%20need%20to%20keep%20all%20members%20of%20the%20team%20up%20to%20date%20about%20svn%20commits.%20The%20solution%20I%27ve%20put%20in%20plac&amp;source=Legolas in Minas Tirith" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/&amp;bm_description=Writing+an+irc+bot+for+svn+commit+notification&amp;plugin=sexybookmarks" rel="nofollow" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Writing+an+irc+bot+for+svn+commit+notification&amp;link=http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/" rel="nofollow" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/&amp;n=Writing+an+irc+bot+for+svn+commit+notification&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<p><a href="http://feedads.g.doubleclick.net/~a/G3-blFkwI0Fi57hefCvusJKlzFY/0/da"><img src="http://feedads.g.doubleclick.net/~a/G3-blFkwI0Fi57hefCvusJKlzFY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/G3-blFkwI0Fi57hefCvusJKlzFY/1/da"><img src="http://feedads.g.doubleclick.net/~a/G3-blFkwI0Fi57hefCvusJKlzFY/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=YHq03or1XaI:TGFftfUJH_U:vzDxczd-HtA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=vzDxczd-HtA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=YHq03or1XaI:TGFftfUJH_U:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=YHq03or1XaI:TGFftfUJH_U:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=YHq03or1XaI:TGFftfUJH_U:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=YHq03or1XaI:TGFftfUJH_U:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=YHq03or1XaI:TGFftfUJH_U:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=YHq03or1XaI:TGFftfUJH_U:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=YHq03or1XaI:TGFftfUJH_U:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=YHq03or1XaI:TGFftfUJH_U:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=YHq03or1XaI:TGFftfUJH_U:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=YHq03or1XaI:TGFftfUJH_U:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=YHq03or1XaI:TGFftfUJH_U:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=YHq03or1XaI:TGFftfUJH_U:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LegolasInMinasTirith/~4/YHq03or1XaI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.javalinux.it/wordpress/2009/10/15/writing-an-irc-bot-for-svn-commit-notification/</feedburner:origLink></item>
		<item>
		<title>Wise 1.1 released</title>
		<link>http://feedproxy.google.com/~r/LegolasInMinasTirith/~3/n4-JZen7rQk/</link>
		<comments>http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 14:32:26 +0000</pubDate>
		<dc:creator>Stefano MAESTRI</dc:creator>
				<category><![CDATA[jboss]]></category>
		<category><![CDATA[webserice]]></category>
		<category><![CDATA[wise]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=301</guid>
		<description><![CDATA[

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		
		
		
		
		
			
				
			
		
A new quite cool release of wise-core, my JBoss.org project.
At the moment here you have a cross post of Wise&#8217;s blog:
http://jbosswise.blogspot.com/2009/08/wise-11-released.html
&#160;




		
			Share this on del.icio.us
		
		
			Digg this!
		
		
			Post this on [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/";
		var dzone_title = "Wise 1.1 released";
		var dzone_style = "1";
		var dzone_blurb = "																				A new quite cool release of wise-core, my JBoss.org project.At the moment here you have a cross post of Wise&#8217;s blog:http://jbosswise.blogspot.com/2009/08/wise-11-released.html";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "Wise 1.1 released";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F08%2F10%2Fwise-1-1-released%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F08%2F10%2Fwise-1-1-released%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>A new quite cool release of wise-core, my JBoss.org project.</p>
<p>At the moment here you have a cross post of <a href="http://jbosswise.blogspot.com" target="_blank">Wise&#8217;s blog</a>:</p>
<p><a href="http://jbosswise.blogspot.com/2009/08/wise-11-released.html">http://jbosswise.blogspot.com/2009/08/wise-11-released.html</a></p>
<div style="clear:both;">&nbsp;</div>

<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/&amp;title=Wise+1.1+released" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/&amp;title=Wise+1.1+released" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/&amp;title=Wise+1.1+released&amp;desc=A%20new%20quite%20cool%20release%20of%20wise-core%2C%20my%20JBoss.org%20project.%0D%0A%0D%0AAt%20the%20moment%20here%20you%20have%20a%20cross%20post%20of%20Wise%27s%20blog%3A%0D%0A%0D%0Ahttp%3A%2F%2Fjbosswise.blogspot.com%2F2009%2F08%2Fwise-11-released.html" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/&amp;title=Wise+1.1+released" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/&amp;title=Wise+1.1+released" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/&amp;title=Wise+1.1+released" rel="nofollow" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/&amp;t=Wise+1.1+released" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Wise+1.1+released+-+http://cli.gs/V78Jt+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/&amp;title=Wise+1.1+released&amp;summary=A%20new%20quite%20cool%20release%20of%20wise-core%2C%20my%20JBoss.org%20project.%0D%0A%0D%0AAt%20the%20moment%20here%20you%20have%20a%20cross%20post%20of%20Wise%27s%20blog%3A%0D%0A%0D%0Ahttp%3A%2F%2Fjbosswise.blogspot.com%2F2009%2F08%2Fwise-11-released.html&amp;source=Legolas in Minas Tirith" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/&amp;bm_description=Wise+1.1+released&amp;plugin=sexybookmarks" rel="nofollow" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Wise+1.1+released&amp;link=http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/" rel="nofollow" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/&amp;n=Wise+1.1+released&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<p><a href="http://feedads.g.doubleclick.net/~a/oeMJQh7y487L9hlwZBOl6IUjAE4/0/da"><img src="http://feedads.g.doubleclick.net/~a/oeMJQh7y487L9hlwZBOl6IUjAE4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/oeMJQh7y487L9hlwZBOl6IUjAE4/1/da"><img src="http://feedads.g.doubleclick.net/~a/oeMJQh7y487L9hlwZBOl6IUjAE4/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=n4-JZen7rQk:ah5SUUBFKUI:vzDxczd-HtA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=vzDxczd-HtA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=n4-JZen7rQk:ah5SUUBFKUI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=n4-JZen7rQk:ah5SUUBFKUI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=n4-JZen7rQk:ah5SUUBFKUI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=n4-JZen7rQk:ah5SUUBFKUI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=n4-JZen7rQk:ah5SUUBFKUI:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=n4-JZen7rQk:ah5SUUBFKUI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=n4-JZen7rQk:ah5SUUBFKUI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=n4-JZen7rQk:ah5SUUBFKUI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=n4-JZen7rQk:ah5SUUBFKUI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=n4-JZen7rQk:ah5SUUBFKUI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=n4-JZen7rQk:ah5SUUBFKUI:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=n4-JZen7rQk:ah5SUUBFKUI:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LegolasInMinasTirith/~4/n4-JZen7rQk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javalinux.it/wordpress/2009/08/10/wise-1-1-released/</feedburner:origLink></item>
		<item>
		<title>Analysing jar dependencies</title>
		<link>http://feedproxy.google.com/~r/LegolasInMinasTirith/~3/z6kn_Xw37gA/</link>
		<comments>http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 17:50:45 +0000</pubDate>
		<dc:creator>Alessio SOLDANO</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=296</guid>
		<description><![CDATA[

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		
		
		
		
		
			
				
			
		
Something like 2 months ago I wrote a post on how different classloaders can potentially cause you problems if you&#8217;re not that careful on where your libs [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/";
		var dzone_title = "Analysing jar dependencies";
		var dzone_style = "1";
		var dzone_blurb = "																				Something like 2 months ago I wrote a post on how different classloaders can potentially cause you problems if you&#8217;re not that careful on where your libs are loaded from. Well, I&#8217;ve just had to face another issue of that...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "Analysing jar dependencies";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F07%2F18%2Fanalysing-jar-dependencies%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F07%2F18%2Fanalysing-jar-dependencies%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Something like 2 months ago I wrote a post on how different classloaders can potentially cause you problems if you&#8217;re not that careful on where your libs are loaded from. Well, I&#8217;ve just had to face another issue of that type, with a library of mine loaded from the bootstrap classloader and referencing a class from servlet API that I don&#8217;t want to be loaded by that classloader too. The easy solution of course would have been to pull my lib out of the endorsed dir (the one the bootstrap classloader loads libs from), but how could I be sure that I did not break anything in my app? Besides running tests, I finally decided to give <a href="http://www.jboss.org/tattletale.html">JBoss Tattletale</a> a try&#8230; I saw all the hype around it when it was released some month ago, but I did not have the chance to use it for a practical issue before.</p>
<p>Well, in less than five minutes I checked out he project, built it and ran it against my endorsed lib dir. I got a report and some graphs basically showing no libraries in that dir (hence loaded by the bootstrap classloader) where directly depending on my library, thus it&#8217;s safe to pull it out of the endorsed dir. The easy solution was indeed OK and thanks to this tool I have a theoretical proof of that <img src='http://www.javalinux.it/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Take a look at <strong>JBoss Tattletale</strong>, it&#8217;s really a cool tool. Perhaps you can start from its author&#8217;s blog: http://blog.hibernate.org/11166.lace</p>
<div style="clear:both;">&nbsp;</div>

<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/&amp;title=Analysing+jar+dependencies" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/&amp;title=Analysing+jar+dependencies" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/&amp;title=Analysing+jar+dependencies&amp;desc=Something%20like%202%20months%20ago%20I%20wrote%20a%20post%20on%20how%20different%20classloaders%20can%20potentially%20cause%20you%20problems%20if%20you%27re%20not%20that%20careful%20on%20where%20your%20libs%20are%20loaded%20from.%20Well%2C%20I%27ve%20just%20had%20to%20face%20another%20issue%20of%20that%20type%2C%20with%20a%20library%20of%20mine%20loaded%20from%20the%20bootstrap%20classloader%20and%20referenc" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/&amp;title=Analysing+jar+dependencies" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/&amp;title=Analysing+jar+dependencies" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/&amp;title=Analysing+jar+dependencies" rel="nofollow" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/&amp;t=Analysing+jar+dependencies" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Analysing+jar+dependencies+-+http://cli.gs/2Zs8u+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/&amp;title=Analysing+jar+dependencies&amp;summary=Something%20like%202%20months%20ago%20I%20wrote%20a%20post%20on%20how%20different%20classloaders%20can%20potentially%20cause%20you%20problems%20if%20you%27re%20not%20that%20careful%20on%20where%20your%20libs%20are%20loaded%20from.%20Well%2C%20I%27ve%20just%20had%20to%20face%20another%20issue%20of%20that%20type%2C%20with%20a%20library%20of%20mine%20loaded%20from%20the%20bootstrap%20classloader%20and%20referenc&amp;source=Legolas in Minas Tirith" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/&amp;bm_description=Analysing+jar+dependencies&amp;plugin=sexybookmarks" rel="nofollow" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=Analysing+jar+dependencies&amp;link=http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/" rel="nofollow" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/&amp;n=Analysing+jar+dependencies&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<p><a href="http://feedads.g.doubleclick.net/~a/caQd91IS6ZQFlEYeXUnqMAPoKHs/0/da"><img src="http://feedads.g.doubleclick.net/~a/caQd91IS6ZQFlEYeXUnqMAPoKHs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/caQd91IS6ZQFlEYeXUnqMAPoKHs/1/da"><img src="http://feedads.g.doubleclick.net/~a/caQd91IS6ZQFlEYeXUnqMAPoKHs/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=z6kn_Xw37gA:k7RJyaRzJfE:vzDxczd-HtA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=vzDxczd-HtA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=z6kn_Xw37gA:k7RJyaRzJfE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=z6kn_Xw37gA:k7RJyaRzJfE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=z6kn_Xw37gA:k7RJyaRzJfE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=z6kn_Xw37gA:k7RJyaRzJfE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=z6kn_Xw37gA:k7RJyaRzJfE:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=z6kn_Xw37gA:k7RJyaRzJfE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=z6kn_Xw37gA:k7RJyaRzJfE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=z6kn_Xw37gA:k7RJyaRzJfE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=z6kn_Xw37gA:k7RJyaRzJfE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=z6kn_Xw37gA:k7RJyaRzJfE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=z6kn_Xw37gA:k7RJyaRzJfE:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=z6kn_Xw37gA:k7RJyaRzJfE:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LegolasInMinasTirith/~4/z6kn_Xw37gA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javalinux.it/wordpress/2009/07/18/analysing-jar-dependencies/</feedburner:origLink></item>
		<item>
		<title>java.lang.NoClassDefFoundError and the bootstrap classloader</title>
		<link>http://feedproxy.google.com/~r/LegolasInMinasTirith/~3/d0KPIZRV_qY/</link>
		<comments>http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/#comments</comments>
		<pubDate>Tue, 26 May 2009 13:51:19 +0000</pubDate>
		<dc:creator>Alessio SOLDANO</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=292</guid>
		<description><![CDATA[

function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&#038;t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}


html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}

Share
		
		
		
		
		
		
		
		
			
				
			
		
Seasoned java developers know that the infamous java.lang.NoClassDefFoundError you can get at runtime might be due to a lot of different issues, the most trivial being libraries [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: right; width: 70px; margin: 0 0 0 10px;">
<script type="text/javascript">
function fbs_click() {
u=location.href;
t=document.title;
window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
return false;
}
</script>
<style type="text/css">
html .fb_share_button {display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right;}
html .fb_share_button:hover {color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none;}
</style>
<a href="http://www.facebook.com/share.php?u=http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/";
		var dzone_title = "java.lang.NoClassDefFoundError and the bootstrap classloader";
		var dzone_style = "1";
		var dzone_blurb = "																				Seasoned java developers know that the infamous java.lang.NoClassDefFoundError you can get at runtime might be due to a lot of different issues, the most trivial being libraries missing in classpath.Of course tracking down the real...";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "";
		digg_title = "java.lang.NoClassDefFoundError and the bootstrap classloader";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><!--S-ButtonZ 1.1.5 End--><div class="tweetmeme_button" style="float: right; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F05%2F26%2Fjavalangnoclassdeffounderror-and-the-bootstrap-classloader%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.javalinux.it%2Fwordpress%2F2009%2F05%2F26%2Fjavalangnoclassdeffounderror-and-the-bootstrap-classloader%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Seasoned java developers know that the infamous java.lang.NoClassDefFoundError you can get at runtime might be due to a lot of different issues, the most trivial being libraries missing in classpath.</p>
<p>Of course tracking down the real problem might result quite more complex when multiple classloaders are involed. Things get even more subtle when the bootstrap classloader comes into play <img src='http://www.javalinux.it/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>I usually deal with a project requiring a couple of libraries to be installed to and loaded from a location specified when providing the virtual machine with the endorsed dir parameter (-Dendorsed.dirs=my_endorsed_dir). I&#8217;m not spending a lot of words on the reason for doing so, it should be enought to know I need to overwrite some classes already shipped with the JDK.</p>
<p>As you know the classes in libraries added to the endorsed dirs are loaded by the bootstrap classloader, before the system classloaders do their job with the other classes.</p>
<p>Yesterday I was adding a new API (interfaces only) to another module (ModuleB) of my project. After that I implemented the interfaces in my ModuleA, which builds to a jar that goes to endorsed dir. Compile phase all green, but NoClassDefFoundError at runtime.</p>
<blockquote><p>Exception in thread &#8220;main&#8221; java.lang.NoClassDefFoundError: it/javalinux/blog/Foo<br />
at java.lang.ClassLoader.findBootstrapClass(Native Method)<br />
at java.lang.ClassLoader.findBootstrapClass0(ClassLoader.java:891)<br />
at java.lang.ClassLoader.loadClass(ClassLoader.java:301)<br />
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)<br />
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)<br />
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)<br />
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)</p></blockquote>
<p>The classpath is OK. The libraries contain all the classes, including the Foo class. What&#8217;s happening then?</p>
<p>Well, I definitely did a mistake, ie. I put the Foo class in ModuleA while it implements FooInterface from ModuleB. Nothing dangerous in that besides *only one* of them is loaded by the bootclassloader, hence the NoClassDefFoundError.The Foo class is indeed available, but it&#8217;s loaded by another classloader.</p>
<p>So, aways think about the way your project classes are loaded and&#8230; look carefully at the exception dump, even in the java.lang.Classloader package section <img src='http://www.javalinux.it/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<div style="clear:both;">&nbsp;</div>

<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/&amp;title=java.lang.NoClassDefFoundError+and+the+bootstrap+classloader" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/&amp;title=java.lang.NoClassDefFoundError+and+the+bootstrap+classloader" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-diigo">
			<a href="http://www.diigo.com/post?url=http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/&amp;title=java.lang.NoClassDefFoundError+and+the+bootstrap+classloader&amp;desc=Seasoned%20java%20developers%20know%20that%20the%20infamous%20java.lang.NoClassDefFoundError%20you%20can%20get%20at%20runtime%20might%20be%20due%20to%20a%20lot%20of%20different%20issues%2C%20the%20most%20trivial%20being%20libraries%20missing%20in%20classpath.%0D%0A%0D%0AOf%20course%20tracking%20down%20the%20real%20problem%20might%20result%20quite%20more%20complex%20when%20multiple%20classloade" rel="nofollow" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="sexy-reddit">
			<a href="http://reddit.com/submit?url=http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/&amp;title=java.lang.NoClassDefFoundError+and+the+bootstrap+classloader" rel="nofollow" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/&amp;title=java.lang.NoClassDefFoundError+and+the+bootstrap+classloader" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/&amp;title=java.lang.NoClassDefFoundError+and+the+bootstrap+classloader" rel="nofollow" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/&amp;t=java.lang.NoClassDefFoundError+and+the+bootstrap+classloader" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=java.lang.NoClassDefFoundError+and+the+bootstrap+classloader+-+http://cli.gs/X00BM+" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-comfeed">
			<a href="http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/feed" rel="nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/&amp;title=java.lang.NoClassDefFoundError+and+the+bootstrap+classloader&amp;summary=Seasoned%20java%20developers%20know%20that%20the%20infamous%20java.lang.NoClassDefFoundError%20you%20can%20get%20at%20runtime%20might%20be%20due%20to%20a%20lot%20of%20different%20issues%2C%20the%20most%20trivial%20being%20libraries%20missing%20in%20classpath.%0D%0A%0D%0AOf%20course%20tracking%20down%20the%20real%20problem%20might%20result%20quite%20more%20complex%20when%20multiple%20classloade&amp;source=Legolas in Minas Tirith" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/&amp;bm_description=java.lang.NoClassDefFoundError+and+the+bootstrap+classloader&amp;plugin=sexybookmarks" rel="nofollow" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="sexy-friendfeed">
			<a href="http://www.friendfeed.com/share?title=java.lang.NoClassDefFoundError+and+the+bootstrap+classloader&amp;link=http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/" rel="nofollow" title="Share this on FriendFeed">Share this on FriendFeed</a>
		</li>
		<li class="sexy-blogger">
			<a href="http://www.blogger.com/blog_this.pyra?t&amp;u=http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/&amp;n=java.lang.NoClassDefFoundError+and+the+bootstrap+classloader&amp;pli=1" rel="nofollow" title="Blog this on Blogger">Blog this on Blogger</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->


<p><a href="http://feedads.g.doubleclick.net/~a/kfzzvhj6tUicNh4TV7ao7tVFH0o/0/da"><img src="http://feedads.g.doubleclick.net/~a/kfzzvhj6tUicNh4TV7ao7tVFH0o/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/kfzzvhj6tUicNh4TV7ao7tVFH0o/1/da"><img src="http://feedads.g.doubleclick.net/~a/kfzzvhj6tUicNh4TV7ao7tVFH0o/1/di" border="0" ismap="true"></img></a></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=d0KPIZRV_qY:bwaH8uXwVrs:vzDxczd-HtA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=vzDxczd-HtA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=d0KPIZRV_qY:bwaH8uXwVrs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=d0KPIZRV_qY:bwaH8uXwVrs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=d0KPIZRV_qY:bwaH8uXwVrs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=d0KPIZRV_qY:bwaH8uXwVrs:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=d0KPIZRV_qY:bwaH8uXwVrs:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=d0KPIZRV_qY:bwaH8uXwVrs:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=d0KPIZRV_qY:bwaH8uXwVrs:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=d0KPIZRV_qY:bwaH8uXwVrs:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=d0KPIZRV_qY:bwaH8uXwVrs:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=d0KPIZRV_qY:bwaH8uXwVrs:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?i=d0KPIZRV_qY:bwaH8uXwVrs:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?a=d0KPIZRV_qY:bwaH8uXwVrs:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/LegolasInMinasTirith?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/LegolasInMinasTirith/~4/d0KPIZRV_qY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/</feedburner:origLink></item>
	</channel>
</rss>
