Skip to main content

JavaOne 2014 – Day 4 – Groovy in 2014 and beyond

By 3 oktober 2014januari 30th, 2017No Comments

By Guillaume Laforge

Guillaume talked about the current version of Groovy, how this fits in with the new Java 8 features and what the future will bring. This year saw the release of Groovy 2.3. Next releases will be in 2015: 2.4 (start), followed (subject to change) by 2.5 (halfway). A 3.0 release is planned for somewhere near the end of 2015, maybe early 2016

About 2.3:

This release already has JDK 8 support. Whenever you would use Lambda’s, you can already use Groovy closures, even prior to Java 8. The main Groovy 2.3 feature is Traits. These resembles the JDK 8 default methods. Traits can be stateful, so it can not just only add methods, but also features / attributes. Also, Traits can extend other traits.


Other additions included:

  • AST transformations, that inject specific functionalities using annotations. An example would be @Sortable, which injects comparable and compareBy<attribute> methods.
  • NIO2 module, which handles (easier) file access, reading and aligns these with the Path classes.
  • JSON parser rebuild with 3x to 4x performance improvement over Jackson and different configurable parser modes to optimize for different scenario’s.
  • Markup template engine additions, can now do type-checking so you get errors on compile-time instead of runtime.
  • GroovyDoc is now updated and the site has a new, more readable layout. Also the is in Beta.

Small bits about Groovy 2.4

There is already some support for Android applications, but this is only marginal and requires extra effort at the moment. Groovy 2.4 should bring considerably better Android support to Groovy. There will also be support for Antlr 4 grammar. Antlr 3 integration was skipped, but since v4 supports Java 8, the team decided to pick up Antlr support from v4 again.