<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Legolas in Minas Tirith &#187; Uncategorized</title>
	<atom:link href="http://www.javalinux.it/wordpress/categories/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.javalinux.it/wordpress</link>
	<description>Alessio &#38; Stefano ideas</description>
	<lastBuildDate>Wed, 14 Sep 2011 14:05:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Wise have new cool logo</title>
		<link>http://www.javalinux.it/wordpress/2010/09/09/wise-have-new-cool-logo/</link>
		<comments>http://www.javalinux.it/wordpress/2010/09/09/wise-have-new-cool-logo/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 10:55:03 +0000</pubDate>
		<dc:creator>Stefano MAESTRI</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=423</guid>
		<description><![CDATA[This is the new logo for Wise. Cool, isn&#8217;t it? We’re excited to officially have our new brand. Thank you very much to James Cobb and Cheyenne Weaver for our new logo, graphics and other branding help. As said in previous post we are backing on Wise giving it a new life with a lot [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://design.jboss.org/wise/logo/final/wise_logo_450px.png" alt="Wise Logo" width="450" height="450" /></p>
<p>This is the new logo for <a href="http://www.jboss.org/Wise" target="_blank">Wise</a>. Cool, isn&#8217;t it?</p>
<p>We’re excited to officially have our new brand. Thank you very much to James Cobb and Cheyenne Weaver for our new logo, graphics and other branding help.</p>
<p>As said in previous post we are backing on Wise giving it a new life with a lot of development on the road. And we had to do them with this owl observing us so seriously <img src='http://www.javalinux.it/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Don&#8217;t forget <a href="https://www.jboss.org/coolstuff/desktopwallpapers/wise" target="_blank">desktop wallpapers</a> and/or to <a href="http://www.cafepress.com/jbossorg/7273389" target="_blank">wear your open source pride</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2010/09/09/wise-have-new-cool-logo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JBossWS talk in Rome on April 28th</title>
		<link>http://www.javalinux.it/wordpress/2010/04/20/jbossws-talk-in-rome-on-april-28th/</link>
		<comments>http://www.javalinux.it/wordpress/2010/04/20/jbossws-talk-in-rome-on-april-28th/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 09:59:57 +0000</pubDate>
		<dc:creator>Alessio SOLDANO</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=405</guid>
		<description><![CDATA[For those being around Rome next week&#8230; I&#8217;ll be presenting on the JBossWS project for the Rome&#8217;s JBoss User Group and Java User Group. More information available (in italian) at http://www.jugroma.it/wiki/jug/space/jug/eventi/Incontro+Aprile+2010 Also take a look at the Community Events calendar on JBoss.org, where every JBoss User Group event is listed. Let&#8217;s hope the volcanic ash [...]]]></description>
			<content:encoded><![CDATA[<p>For those being around Rome next week&#8230; I&#8217;ll be presenting on the JBossWS project for the Rome&#8217;s <a href="http://tech.groups.yahoo.com/group/roma-jbug/">JBoss User Group</a> and Java User Group. More information available (in italian) at <a href="http://www.jugroma.it/wiki/jug/space/jug/eventi/Incontro+Aprile+2010">http://www.jugroma.it/wiki/jug/space/jug/eventi/Incontro+Aprile+2010</a> Also take a look at the <a href="http://www.jboss.org/events">Community Events calendar</a> on JBoss.org, where every JBoss User Group event is listed.</p>
<p>Let&#8217;s hope the volcanic ash cloud goes away in the mean time <img src='http://www.javalinux.it/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2010/04/20/jbossws-talk-in-rome-on-april-28th/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>java2scala #3: Variables and functions</title>
		<link>http://www.javalinux.it/wordpress/2009/12/29/java2scala-3-variables-and-functions/</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[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 class package it.javalinux.samples.java.post3; class VariablesAndFunctions { private final String inputString; public int fooIntVar = 11; public final String fooStringVal = "fooString"; private double [...]]]></description>
			<content:encoded><![CDATA[<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>
<pre lang="java">package it.javalinux.samples.java.post3;

class VariablesAndFunctions {

	private final String inputString;

	public int fooIntVar = 11;
	public final String fooStringVal = "fooString";
	private double privateIntVar = 1.1;
	private final String privateStringVal = "fooString";

	public VariablesAndFunctions(String inputString) {
		//it could compile! and if you uncomment the line tests will fail
		//inputString = inputString + "hasBeenModified";
		this.inputString = inputString;
		//it doesent compile because you have already assigned the final property
		//this.inputString = inputString + "hasBeenModified";
		System.out.println("Created VariablesAndFunctions with inputString=" + inputString);
	}

	public VariablesAndFunctions() {
		this("defaultString");
	}

	public String getInputString() {
		return inputString;
	}

	public String getFooStringVal() {
		return fooStringVal;
	}

// i. You can't re-assign a final variable
//	public void setFooStringVal(String fooStringVal) {
//		this.fooStringVal = fooStringVal;
//	}

	public double getPrivateIntVar() {
		return privateIntVar;
	}

	public void setPrivateIntVar(double privateIntVar) {
		this.privateIntVar = privateIntVar;
	}

	public int getFooIntVar() {
		return fooIntVar;
	}

	public String getPrivateStringVal() {
		return privateStringVal;
	}

	public void setFooIntVar(int fooIntVar) {
		this.fooIntVar = fooIntVar;
	}

}</pre>
<h4>java Unit Test</h4>
<pre lang="java">package it.javalinux.samples.java.post3;

import org.junit.Test;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class VariablesAndFunctionsTest {

    @Test
    public void testAccessToPublicVar() {
    	VariablesAndFunctions instance = new VariablesAndFunctions();
    	instance.fooIntVar = 12;
    	assertTrue(instance.fooIntVar == 12);
    }

    @Test
    public void  testAccessToPublicVal()  {
    	VariablesAndFunctions instance = new VariablesAndFunctions();
    	// It doesn't compile...you can't reassign a final property
    	//instance.fooStringVal = "anotherString"
    	assertTrue(instance.fooStringVal.equals("fooString") );
    	assertFalse(instance.fooStringVal == new String("fooString") );
    }

    @Test
    public void  testAccessToPrivateVar()  {
    	VariablesAndFunctions instance = new VariablesAndFunctions();
    	instance.setPrivateIntVar(12);
    	assertTrue(instance.getPrivateIntVar() == 12);
    }

    @Test
    public void  testEmptyConstructor()  {
    	VariablesAndFunctions instance = new VariablesAndFunctions();
    	assertTrue(instance.getInputString().equals("defaultString"));
    	assertFalse(instance.getInputString() == new String("defaultString") );
    }

    @Test
    public void  testConstructor()  {
    	VariablesAndFunctions instance = new VariablesAndFunctions("myString");
    	assertTrue(instance.getInputString().equals("myString"));
    	assertFalse(instance.getInputString() == new String("myString") );
    }

}</pre>
<h4>Scala class</h4>
<pre lang="scala">package it.javalinux.samples.scala.post3

class VariablesAndFunctions(val inputString : String) {

    println("Created VariablesAndFunctions with inputString=" + inputString);

    // it doesnt compile
    // inputString = inputString + "hasBeenModified";

	def this() = this("defaultString")

	var fooIntVar : Int = 11
	val fooStringVal = "fooString"
	private var privateIntVar = 1.1
	private val privateStringVal = "fooString"

	def getPrivateVarIntVar() = privateIntVar

	def getPrivateStringVal() = privateStringVal

	def setPrivateVarIntVar(x : Int) {
	  privateIntVar = x
   	}

// It doesn't compile...you can't reassign val
//	def setPrivateStringVal(s : String) {
//	  privateStringVal = s;
//    }

}</pre>
<h4>Scala Unit Test</h4>
<pre lang="scala">package it.javalinux.samples.scala.post3

import org.junit._
import Assert._

@Test
class VariablesAndFunctionsTest {

    @Test
    def testAccessToPublicVar() = {
    	val instance = new VariablesAndFunctions()
    	instance.fooIntVar = 12
    	assertTrue(instance.fooIntVar == 12)
    }

    @Test
    def testAccessToPublicVal() = {
    	val instance = new VariablesAndFunctions()
    	// It doesn't compile...you can't reassign val

    	//instance.fooStringVal = "anotherString"
    	assertTrue(instance.fooStringVal == new String("fooString") )
        assertFalse(instance.fooStringVal eq new String("fooString") )
    }

    @Test
    def testAccessToPrivateVar() = {
    	val instance = new VariablesAndFunctions()
    	instance.setPrivateVarIntVar(12)
    	assertTrue(instance.getPrivateVarIntVar == 12)
    }

    @Test
    def testEmptyConstructor() = {
    	val instance = new VariablesAndFunctions()
    	assertTrue(instance.inputString == new String("defaultString") )
        assertFalse(instance.inputString eq new String("defaultString") )
    }

    @Test
    def testConstructor() = {
    	val instance = new VariablesAndFunctions("myString")
    	assertTrue(instance.inputString == new String("myString") )
        assertFalse(instance.inputString eq new String("myString") )
    }

}</pre>
<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>
]]></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>
		</item>
		<item>
		<title>java.lang.NoClassDefFoundError and the bootstrap classloader</title>
		<link>http://www.javalinux.it/wordpress/2009/05/26/javalangnoclassdeffounderror-and-the-bootstrap-classloader/</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[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 problem might result quite more complex when multiple classloaders are involed. Things get even more subtle when the bootstrap [...]]]></description>
			<content:encoded><![CDATA[<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>
]]></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>
		</item>
		<item>
		<title>Java Application Server Day 2009</title>
		<link>http://www.javalinux.it/wordpress/2009/04/23/java-application-server-day-2009/</link>
		<comments>http://www.javalinux.it/wordpress/2009/04/23/java-application-server-day-2009/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 11:19:18 +0000</pubDate>
		<dc:creator>Alessio SOLDANO</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=282</guid>
		<description><![CDATA[This post is to let you know a really interesting event that&#8217;s taking place soon in Genoa (Italy): the Java Application Server Day 2009. As you can read on www.serverday.org, the event will be open to the entire Italian Java Community; international experts, developers and students will discuss the state of the art and the [...]]]></description>
			<content:encoded><![CDATA[<p>This post is to let you know a really interesting event that&#8217;s taking place soon in Genoa (Italy): the <strong>Java Application Server Day 2009</strong>.</p>
<p>As you can read on <a href="http://www.serverday.org/index.php" target="_blank">www.serverday.org</a>, the event will be open to the entire Italian Java Community; international experts, developers and students will discuss the state of the art<br />
and the future of Java Application Servers, with a focus on the innovations of<br />
the recently released <strong>JBoss 5.0, Spring dm Server, GlassFish 3.0 &amp; Oracle/WebLogic</strong>.</p>
<p>I&#8217;ve been asked to be there on behalf of JBoss / Red Hat, so I&#8217;ll present the recent changes in JBoss AS 5.</p>
<p>Hope you can join the event on May, 21st. Stay tuned for further updates.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2009/04/23/java-application-server-day-2009/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Analyze what personality is behind your blog</title>
		<link>http://www.javalinux.it/wordpress/2009/03/31/analyze-what-personality-is-behind-your-blog/</link>
		<comments>http://www.javalinux.it/wordpress/2009/03/31/analyze-what-personality-is-behind-your-blog/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 12:55:59 +0000</pubDate>
		<dc:creator>Stefano MAESTRI</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.javalinux.it/wordpress/?p=279</guid>
		<description><![CDATA[According to this analyzer I&#8217;m  The Duty Fulfillers The responsible and hardworking type. They are especially attuned to the details of life and are careful about getting the facts right. Conservative by nature they are often reluctant to take any risks whatsoever. The Duty Fulfillers are happy to be let alone and to be able [...]]]></description>
			<content:encoded><![CDATA[<p>According to this analyzer I&#8217;m  <a href="http://typealyzer.com/index.php?lang=en" target="_blank">The Duty Fulfillers</a></p>
<blockquote><p><em>The responsible and hardworking type. They are especially attuned to the details of life and are careful about getting the facts right. Conservative by nature they are often reluctant to take any risks whatsoever.<br />
The Duty Fulfillers are happy to be let alone and to be able to work int heir own pace. They know what they have to do and how to do it. </em></p></blockquote>
<p>It doesn&#8217;t perfectly fit on my personality, but for sure it isn&#8217;t too far.</p>
<p><a href="http://markclittle.blogspot.com/2009/03/analyze-your-blog.html" target="_blank">Thanks to Mark Little for the link</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.javalinux.it/wordpress/2009/03/31/analyze-what-personality-is-behind-your-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

