JavaOne 2016 is over! For two weeks already, so maybe I'm a little late with this write-up. Well, it simply took some time to watch enough talks to get an impression of what was going on. But even two weeks are not enough - Oracle uploaded about a hundred videos from JavaOne 2016! So I had to pick a theme and I decided to stay close to the nucleus: the language and core libraries, standard and enterprise edition, themselves.
As tempting as they are, I abstained talks that strayed away from the motor of Java's drive. So no, I didn't even watch the talk about JUnit 5 - yet.
Java SE
Let's start with the Java SE keynote. Honestly, I found neither the introduction nor the Mazda report particularly thrilling. But that's just the first third of the 30 minute presentation.
It got more interesting when Mark Reinhold started to get technical. He talked about Java 9 in general (which I will do further below as well) and covered jShell and Project Jigsaw in particular. It got even more interesting when Brian Goetz joined him in an awkwardly choreographed entrance.
Imagine, we might be able to write this at some point in the future:
public class Point(int x, int y) { }
And the compiler generates fields, constructors, accessors, proper equals
, hashCode
, and toString
. Wow!
And it gets better! (Or worse, depending on how much you're prefer clarity over succinctness.)
var url = new URL("http://ift.tt/2dOeak2");
var connection = url.openConnection();
As Brian makes very clear, this does not weaken Java's type system. It just means that the compiler infers more types than it already does today.
Last but not least Brian quickly summarizes the projects Valhalla and Panama.
Before diving into the more focused talks, I want to recommend Ask the JDK Architects, where Mark Reinhold, John Rose, and Brian Goetz answered random questions regarding Java and the JVM. It's a nice potpourri of why Java is the way it is and how that might change in the future.
Java 8
I found it interesting that there where a number of talks dedicated to Java 8 and that many of them where still presenting some of the basics. Others, and this made more sense to me, were more advanced and help developers, who mostly have been using it daily for a while now, to get the details right.
The first half of Stuart Marks' Collections Refueled (slides) talk presented some extensions to the collections framework that happened in Java 8 and might've been overlooked due to the hype around streams. For example, I didn't know about Collection::removeIf
, List::replaceAll
, or how List::sort
improved sort performance. He finished off with the Comparator
factories before turning to Java 9.
Another talk making sure you get everything out of Java 8 was Venkat Subramaniam's A Few Hidden Treasures in Java 8, in which he covered varied topics like string joining, default methods, and parallel streams.
Talking about parallel streams, if you want to know more about how to create solutions that parallelize well, watch Stuart Marks' and Brian Goetz' Thinking in parallel. Here they gave succinct mental models for how to design good solutions and estimate parallel stream performance.
But let's not get distracted from Venkat's live coding marathon. In Let’s Get Lazy: Explore the Real Power of Streams he dived into laziness and why lazy evaluations are beneficial. He did it again in Refactoring to Functional Style with Java 8 - a journey from Java 8's functional programming features to functional programming with Java 8. Why are higher-order functions, immutability, lambdas, streams, and laziness relevant and how do they come together?
I really enjoyed Journey’s End: Collection and Reduction in the Stream API, which took a deep dive into reduction and collectors. As I've written elsewhere, I'm not a fan of complex stream collection but that doesn't mean it's not good to know how to do it if you need to. Besides, Maurice Naftalin gave a lot of interesting background info as well.
[caption id="attachment_140949" align="alignnone" width="1024"] Published by Hubble Heritage under CC-BY-SA 2.0[/caption]
Java 9
Java 9 was of course a big topic and there were a lot of talks about it. Before heading into some of the details of the new version, though, I want to recommend two particular talks for those that have not yet spent a lot of time with Java 9.
The first, JDK 9 Language, Tooling, and Library Features by Joseph Darcy, gave a high-level overview over Java 9. Give or take, it was pretty much the spoken version of my ultimate guide to Java 9 (but it also covered some of the still unpublished second part).
Then there was Prepare for JDK 9 (slides), in which Alan Bateman explored what our projects should do to prepare for the new version. Some of the things he mentioned were which internal APIs Jigsaw is going make inaccessible and how to deal with that, the new run time's file system layout, and the upcoming version string format. Finally he explained how the pretty cool multi-release JARs can help projects stay compatible to several versions.
Project Jigsaw
As all posts about Java 9 we have to talk about Project Jigsaw and the upcoming Java Platform Modularity System (JPMS). The Jigsaw team presented a series of talks where each built on the previous ones.
Continue reading %JavaOne 2016 – Nucleus%
by Nicolai Parlog via SitePoint