Webinar Recording: What’s New in JDK 12

This week, we hosted a webinar covering the most important features for developers from Java 12. The recording is now available for those of you who missed it or want to go back over some of the details. In the following video, you’ll find a list of the resources (links) from the video, and answers to the most relevant questions.

39 New Features (and APIs) in JDK 12

I’ve written several blog posts that list out all the changes for each of the most recent releases of Java (JDK 10, JDK 11). With JDK 12 just having been released, it seemed the obvious thing to produce another blog in this series. However, I’ll be looking at the flip side of this latter, focusing on some of the pitfalls that might cause problems, should you want to migrate an application to use this version.

We are now well into the new six-month release cadence and everything is working smoothly. I represent Azul on the Java SE JSR Expert Group, and we decided to switch this version to the revised JSR process. This is not radically different; it's more of a streamlining of the process to fit into the available time more easily.

Using Minimum Fractional Digits With JDK 12 Compact Number Formatting

The post "Compact Number Formatting Comes to JDK 12" demonstrated the support added to NumberFormatin JDK 12 to support compact number formatting. The examples shown in that post only used the instances of NumberFormat returned by invocations of NumberFormat's new overloaded getCompactNumberInstance(-)methods, and so, therefore, they did not specify characteristics such as minimum fractional digits and maximum fractional digits. The results, in some cases, are less than desirable. Fortunately, NumberFormat does allow for minimum and maximum fractional digits to be specified, and this post demonstrates how that can improve the output of the compact number formatting available with JDK 12.

The code listing introduced in the original "Compact Number Formatting Comes to JDK 12" post (which is available on GitHub) has been updated to demonstrate the use of NumberFormat.setMinimumFractionDigits(int). An excerpt of that code is shown next and is followed by the accompanying output.