Skip to main content


Posted by editor on October 29, 2007 at 7:56 AM PDT

Closures getting closer

Hey, remember when the big topic was the idea of adding closures to the Java language for Java 7? A lot of people like the idea, and others aren't so sure. But the topic has gotten kind of quiet for the past few months, as the sides have seemingly agreed to disagree in the absence of further information and details on the topic.

So, Neal Gafter's latest blog seems likely to open things up again. Because he's got a closures prototype working.

In Java Closures: First Prototype, Neal writes:

I've finally had some time to make progress on a prototype of
closures. If you want to see what an API looks like, you can compare
Doug Lea's jsr166y fork-join framework to href="">the
same API ported to use the language features of the prototype.

If you want to try it, you can href="">download an executable
version of the prototype here. Make sure a JDK6 version of java
and javac are on your path. This is binary-licensed under the JRL,
but if a JSR is created I expect to license it under GPLv2. There are
a few small test cases included.

The blog goes on to detail what is and isn't present in this prototype, with an explanation that he wanted to get a version out without the missing features, and thereby enable a comparison once those features are added. Neal also notes that he's working on some closure-related language changes for JDK 7. "For example, "extension methods" enable you to have the effect of adding methods to existing interfaces (e.g. adding "each", "filter", etc to Collection) without breaking backward compatibility."

So, assuming you have JDK 6 (sorry, Mac developers... but that's another story), this is your opportunity to take a look. And, presumably, a cue to bring the closure debate back to the foreground.

Also in Java Today,
a recent note in Barton's Blog points out that NetBeans is now dual-licensed. "As of Monday's release of NetBeans 6 beta 2, in addition to the CDDL, the Java-based tool set is now also available under GPLv2 with the Classpath exception. The target had been to add GPL by FCS but thanks to some over achieving legal folks the team made it early.
The goal of the dual licensing is simple -- make NetBeans more friendly to the GNU/Linux world as well as making it an option for those who were unable to use it under the CDDL."

The latest edition, Issue 144, of the JavaTools Community Newsletter is available, with tool news from around the web, announcements of new projects within the community, and a Tool Tip on dealing with dependencies with the Maven 2 Dependency Plugin.

Tooday's Weblogs starts off with another hot-button issue, the absence of Java 6 from Mac OS X 10.5 Leopard. In So, no Java 6 with Leopard, Fabrizio