The whole Team has been working very hard in the last days to migrate to Java 17 from 11 🔨.
You can try it out right away with our sprint release or 9.4 will come in the next few days.
It is any way a good Idea to try out 9.4 because it will become Axon Ivy 10.
So you can give us early feedback and will then profit from an even better tested LTS release.
Beside many internal improvements and better performance of Java 17 you can also profit from new Java Language Features an improved Java Core API:
Pattern Matching for instanceof
Object any = "Hello World";
if (any instanceof String s) {
System.out.println(s);
}
Helpful NullPointerExceptions
java.lang.NullPointerException: Cannot invoke "String.toLowerCase(java.util.Locale)" because "text" is null
Text Blocks
private static void jsonBlock() {
String text = """
{
"name": "John Doe",
"age": 45,
"address": "Doe Street, 23, Java Town"
}
""";
System.out.println(text);
}
Records
public record Rectangle(int x, int y) {
}
Switch Expressions
private static void withReturnValue(Fruit fruit) {
var text = switch (fruit) {
case APPLE, PEAR -> "Common fruit";
case ORANGE, AVOCADO -> "Exotic fruit";
default -> "Undefined fruit";
};
System.out.println(text);
}
Stream.toList()
private static void streamToList() {
List<String> list = Stream.of("a", "b", "c").toList();
}
Sealed Classes
public abstract sealed class FruitSealed permits AppleSealed, PearSealed {
}
public non-sealed class AppleSealed extends FruitSealed {
}
public final class PearSealed extends FruitSealed {
}
Strong encapsulation of JDK internals
This is mainly a good thing because it protects you form using internal API which can be changed without any notice in next java versions. The downside is, that there are many legacy libraries and also Ivy Script Serialization which need special handling to further work. See InaccessibleObjectException and IllegalAccessError with Java 17 Blog post for more information.