27 December 2019

New Classes in Java 11

Java 11 is a LTS (Long Term Support) release, which means that it will get public updates till September 2022 and extended support until September 2026. While it is an important release, it does not add much to the platform, much like Java Update 10. Still Simon Ritter found 90 new features and APIs in JDK 11. Let's have a look at the new classes.

New HTTP Client
The Standard HTTP Client has been moved from jdk.incubator.http to java.net.http:
java.net.http.HttpClient
java.net.http.HttpClient$Builder
java.net.http.HttpClient$Redirect
java.net.http.HttpClient$Version
java.net.http.HttpConnectTimeoutException
java.net.http.HttpHeaders
java.net.http.HttpRequest
java.net.http.HttpRequest$BodyPublisher
java.net.http.HttpRequest$BodyPublishers
java.net.http.HttpRequest$Builder
java.net.http.HttpResponse
java.net.http.HttpResponse$BodyHandler
java.net.http.HttpResponse$BodyHandlers
java.net.http.HttpResponse$BodySubscriber
java.net.http.HttpResponse$BodySubscribers
java.net.http.HttpResponse$PushPromiseHandler
java.net.http.HttpResponse$ResponseInfo
java.net.http.HttpTimeoutException
java.net.http.WebSocket
java.net.http.WebSocket$Builder
java.net.http.WebSocket$Listener
java.net.http.WebSocketHandshakeException
Security
JEP 324: Key Agreement with Curve25519 and Curve448 comes with a few classes,
java.security.interfaces.XECKey
java.security.interfaces.XECPrivateKey
java.security.interfaces.XECPublicKey
java.security.spec.NamedParameterSpec
java.security.spec.XECPrivateKeySpec
java.security.spec.XECPublicKeySpec
as do the ChaCha20 and Poly1305 Cryptographic Algorithms: javax.crypto.spec.ChaCha20ParameterSpec.

Other Smaller Changes
There are around 20 other new classes including support for Dynamic Class-File Constants and the jaotc command.
java.lang.invoke.ConstantBootstraps

javax.print.attribute.standard.DialogOwner

jdk.nio.Channels
jdk.nio.Channels$SelectableChannelCloser

jdk.swing.interop.DispatcherWrapper
jdk.swing.interop.DragSourceContextWrapper
jdk.swing.interop.DropTargetContextWrapper
jdk.swing.interop.internal.InteropProviderImpl
jdk.swing.interop.LightweightContentWrapper
jdk.swing.interop.LightweightFrameWrapper
jdk.swing.interop.SwingInterOpUtils

jdk.tools.jaotc.aarch64.AArch64ELFMacroAssembler
jdk.tools.jaotc.aarch64.AArch64InstructionDecoder
jdk.tools.jaotc.binformat.elf.AArch64JELFRelocObject
jdk.tools.jaotc.binformat.elf.AMD64JELFRelocObject
Removal
Besides these few new classes, the real new thing in Java 11 is removal. The new Java drops much from the JDK. Really much: JavaFX is removed - it was just added in Java 8 and 9. Dropped packages are
javafx.* [8-10]
javafx.css [9-10]
javafx.css.converter [9-10]
javafx.fxml [9-10]
javafx.scene [9-10]
javafx.util [9-10]
Java EE and CORBA Modules are dropped:
javax.activation [6-10]
javax.activity [5-10]
javax.annotation [6-10]
javax.jnlp [5-10]
javax.jws [6-10]
javax.rmi.CORBA [3-10]
javax.security.auth.Policy [4-10]
javax.transaction [3-10]
javax.xml.bind [6-10]
javax.xml.soap [6-10]
javax.xml.ws [6-10]
jdk.management.cmm.SystemResourcePressureMXBean [8-10]
jdk.management.resource [8-10]
jdk.packager.services.singleton [only 10]
jdk.packager.services.userjvmoptions [9-10]
org.omg.CORBA [2-10]
Most of these classes have been added with Java 6, some even in the previous release (10).

List of all public classes
You can download the complete history of all public classes ever available in Java from version 1.0 to 11.0.2. Each class name is annotated with [release] showing the release it first appeared, e.g. java.lang.annotation.Annotation [5].

21 December 2019

Coderetreat Facilitation Podcast

tl;dr: I am podcasting about Coderetreat facilitation.

Impression Global Day of Coderetreat 2013 (C) Michael LeberI regularly facilitate Coderetreats - as part of my work as Code Cop and for the local Software Crafters community. To support people organising events in other cities, I run Coderetreat facilitation trainings each year, especially in the months before the Global Day (of Coderetreat). Based on the feedback I get, e.g. Thanks for the training today! Very helpful! I see that these trainings are helpful for people who want to run Coderetreats. Often people ask the same questions, so I decided to record the most common questions. I will publish the recordings as I create them, so it is a podcast. (A podcast is an episodic series of digital audio files that a user can download in order to listen.)

Get it here: coderetreat-facilitation.code-cop.org

About
In the podcast I am answering questions about Coderetreat hosting, facilitation and participation. It will help you run Coderetreats, Coding Dojos, hands on meetups and even classic training. Each episode covers two to three questions and takes up to 10 minutes. From time to time I will invite guest facilitators to discuss with me. In the first few episodes I will also cover basic questions about the Coderetreat itself, e.g. What is a Coderetreat?

Frequency
As each episode is short, I plan to release at least two each month. While I am too late for #GDCR19, there should be around 30 questions and answers ready for people who want to help organising the next #GDCR20. That would be like three hours facilitation training. That would be great. Let's see how far I get.

Questions
If you have any questions regarding your Coderetreat, Coding Dojo or hands-on workshop, please send me an email or leave a comment. I will answer the question in one of the next episodes.

Get it here: coderetreat-facilitation.code-cop.org

4 December 2019

New Classes in Java 10

New in Java 10As Java developer I used to monitor the new features of Java very closely. As Code Cop my focus on programming languages is much broader. Currently I am working with clients using C#, Java, JavaScript, Kotlin, Oracle PL/SQL, PHP, Python and TypeScript. (And I would love a few more clients using some F#, Go or Scheme.) Since version 9, Java is released much more often than it used to be and I lost track of its new features. Eventually I had to catch up. Here is the list of all new classes in Java 10. Java 10 was launched March 2018 and went EOL September 2018. While it is not relevant as a version on its own, I want to be explicit about it as it is part of 11 and all later releases.

Local-Variable Type Inference
The most interesting new feature is the var keyword, Local-Variable Type Inference. This is a compiler feature and is not visible in the public classes available in the JRE/JDK. The var causes a lot of discussions about readability of source code. I recommend checking out the Style Guidelines for Local Variable Type Inference in Java to avoid confusion.

Experimental Java-Based JIT Compiler
JEP 317 enables the Java-based JIT compiler named Graal. It comes with the jaotc command which produces native code for compiled Java methods. While this is a feature of Java 9, JEP 295, the new class jdk.tools.jaotc.Main and the packages jdk.tools.jaotc.* show up for the first time.

Other Smaller Changes
The number of new classes in Java 10 is below 50, of which 40 classes are the jaotc. The remaining are
javafx.scene.control.TabPane$TabDragPolicy

jdk.incubator.http.HttpRequest$BodyPublisher
jdk.incubator.http.HttpResponse$BodySubscriber
jdk.incubator.http.HttpResponse$MultiSubscriber

jdk.jfr.events.FileForceEvent

jdk.packager.services.singleton.SingleInstanceListener
jdk.packager.services.singleton.SingleInstanceNewActivation
jdk.packager.services.singleton.SingleInstanceService
a change to JavaFX, drag policies for tabs in a TabPane, providing Flow implementations for the experimental HTTP 2 client, something in the Oracle Flight Recorder, a commercial feature that must be unlocked before being used and Single Instance functionality for Java Packager.

This is a very small release, still Simon Ritter from Azul Systems managed to find 109 New Features In JDK 10. Check them out!

List of all public classes
You can download the complete list of all classes available in Java from version 1.0 to 10.0.2. Each class name is annotated with [release] showing the release it first appeared, e.g. java.lang.annotation.Annotation [5].