Making JSR 305 Work On Java 9
Do you use JSR 305 annotations like @Nonnull or @Nullable together with annotations from the javax.annotation package, for example @Generated or @PostConstruct? If so, then migrating to Java 9 won’t be...
View ArticleFirst Contact With ‘var’ In Java 10
Java 10 will be released on March 20th 2018 and all features that want to be shipped with it must be merged into the main development line by December 14th. Of the few features that target Java 10 as...
View ArticleCode First Java 9 Tutorial
So, Java 9 came out last year… What now? Where to get started? If that’s what you’re asking yourself, then you’ve come to the right place! This Java 9 tutorial is a condensation of all you need to know...
View ArticleImprove Launch Times On Java 10 With Application Class-Data Sharing
Surely the most prominent Java 10 feature is type inference with var, but there’s another gem hidden in 10 that’s worth exploring: application class-data sharing (AppCDS). It allows you to reduce...
View ArticleUnlocking Intersection Types With ‘var’ In Java 10
Whether you’re already using Java 10 or not, I’m sure you’ve heard all about var, Java’s new keyword reserved type name that allows you to declare local variables without having to specify their types....
View ArticleTricks with ‘var’ and anonymous classes (that you should never use at work)
Using var to infer types of local variables is a great tool for writing readable code. More than that, it makes working with intersection types much more pleasant. It has a dark underbelly, though, and...
View ArticleUnlocking Traits With ‘var’ In Java 10
Local-variable type inference, or more succinctly var, turns out to be surprisingly versatile. It unlocks intersection types, allows using ad-hoc fields and methods of anonymous types, and, as we will...
View ArticleAll You Need To Know For Migrating To Java 11
Java 11 is released today! Formally it marks the end of a monumental shift in the Java ecosystem. With the challenges of migrating from Java 8 onto a modular and flexible JDK, with the six-month...
View ArticleJava 11 HTTP/2 API Tutorial
Since Java 11, the JDK contains a new HTTP API in java.net.http with HttpClient, HttpRequest, and HttpResponse as its principal types. It’s a fluent, easy-to-use API that fully supports HTTP/2, allows...
View ArticleReactive HTTP/2 Requests And Responses In Java 11
With Java 11’s new HTTP API you can do more than just HTTP/2 and asynchronous requests – you can also handle request and response bodies in a reactive manner, which gives you full control over the...
View ArticleScripting Java 11, Shebang And All
There are several reasons why writing scripts in Java seems to be a bad idea, chief among them that it’s always a two step process to run a source file: It first has to be compiled (with javac) before...
View ArticleEleven Hidden Gems In Java 11
Java 11 introduced no ground-breaking features, but contains a number of gems that you may not have heard about yet. Sure, you likely know about the reactive HTTP/2 API and executing source files...
View ArticleDefinitive Guide To Switch Expressions In Java 12
Good old switch has been with Java from day one. We all use it and we all got used to it – particularly its quirks. (Anybody else annoyed by break?) But now things start to change! Java 12 introduces...
View ArticleTeeing Collector in Java 12
Java 12 comes out in two weeks and, with switch expressions, takes the first step towards pattern matching. But the new release has more to offer than that – well, a little bit more. It also introduces...
View ArticleDefinitive Guide To Java 12
Java 12 will be released in a few days and here’s everything you need to know about it. Be it switch expressions, the teeing collector, improved start time thanks to the default CDS archive, or better...
View ArticleImmutable Collections In Java – Not Now, Not Ever
Mutability is bad, mkay? Hence, immutability is good. Central data structures whose ubiquity make immutability particularly rewarding are collections; List, Set, and Map in Java. But while the JDK...
View ArticleDefinite Guide To Text Blocks In Java 13
New version, new feature! Java 13 previews text blocks, string literals that can span multiple lines: System.out.println(""" Hello, multiline text blocks!"""); // prints: // > Hello, // >...
View ArticleEvolving Java With ––enable–preview aka Preview Features
Since Java 9, a new major Java version is released every six months. This has a profound impact on the entire ecosystem, not least of which is the faster turnaround time for new language features and...
View ArticleThe JPMS Maturity Model
I consider Java’s module system a big boon for maintainability. That is, if tools, frameworks, and libraries play along, but unfortunately many don’t yet, at least not to the degree where they...
View ArticleDefinitive Guide To Java 13
Java 13 was released an hour ago and here’s everything you need to know about it, starting with migration considerations and version requirements before getting into the juicy bits: First and foremost...
View Article