Java 7 Special Edition – Closures and Language Change JSRs!
I had just published a Java 7 roundup when I got an email from a little birdy in my inbox: JUGs to propose new language JSR for Java 7!
This message reveals that the “Closures for Java” JSR has been submitted as a joint proposal of the Belgian and Brazilian Java Users Groups!! This is the first proposal ever by a JUG – very cool.
Additionally, a collection of smaller language changes has been submitted as a Google-led proposal and will include:
- Improved type inference – eliminate generics on RHS of constructor invocations in constructors and explicit generic type arguments
- Enum comparison – support >, <, etc with enums
- String switch – use string literals in case clause
- Chained invocations – void methods implicitly return “this”
- Extension methods – add extra methods via static import
- Improved catch clauses – allow single catch block to catch multiple exception types, and better support for rethrown exceptions
As always, all current and previous information is maintained on my Java 7 page, which has now been updated based on the info in this announcement.

Hi! My name is Alex Miller and I live in St. Louis. I write code for a living and currently work for
To make chained Invocations works in a way that does not suck (ie casts) we would have to have a public this do() signature (i forget the technical term) for subclasses to work. We don’t want those operations to just return the superclass or interface. Maybe the idea of automatic cast is more appropriate here than it was in generics? Make the compiler cast void methods if they are invoked. That presumes a minimal lookahead i think and java frowns on that. But very much a wanted feature…
Paulo,
my chained invocation proposal already implements the semantics you are thinking of. An invocation of a “void” method would have the same type as the invocation target – not of the class that implements the method.
So if A defines “void f()” and B extends A, then new B().f() will have type “B”.
Matthias