Home » Archives for Nicolai Parlog

Author Archives: Nicolai Parlog

Nicolai is a thirty year old boy, as the narrator would put it, who has found his passion in software development. He constantly reads, thinks, and writes about it, and codes for a living as well as for fun.Nicolai is the editor of SitePoint's Java channel, writes a book about Project Jigsaw, blogs about software development on codefx.org, and is a long-tail contributor to several open source projects. You can hire him for all kinds of things.

Java 9 Migration Guide: The Seven Most Common Challenges

I’m sure you’ve heard that updating to Java 9 is no walk in the park, maybe even that it’s an incompatible update and that a migration makes no sense for large code bases. After doing exactly that, migrating an old and fairly large code base, I can tell you that it’s not that bad. It’s more work than bumping to Java ...

Read More »

A JDeps Primer – Analyzing Your Project’s Dependencies

JDeps is the Java Dependency Analysis Tool, a command line tool that processes Java bytecode, meaning .class files or the JARs that contain them, and analyzes the statically declared dependencies between classes. The results can be filtered in various ways and can be aggregated to package or JAR level. JDeps can also tell you which JDK-internal APIs your project is ...

Read More »

JUnit 5 – Parameterized Tests

JUnit 5 is pretty impressive, particularly when you look under the covers, at the extension model and the architecture. But on the surface, where tests are written, the development is more evolutionary than revolutionary – is there no killer feature over JUnit 4? Fortunately, there is (at least) one: parameterized tests. JUnit 5 has native support for parameterizing test methods ...

Read More »

Optional Dependencies in the Java Platform Module System

The Java Platform Module System (JPMS) has a strong opinion on dependencies: By default, they need to be required (to be accessible) and then they need to be present both at compile and at run time. This does not work with optional dependencies, though, where code is written against artifacts that are not necessarily present at run time. Fortunately, the ...

Read More »

Repackaging Exceptions In Streams

Java 8 is a couple of years old but there are still use cases, not even edge cases, that the community did not yet develop a good arsenal of solutions for. How to handle checked exceptions in stream pipelines is one such problem. The functional interfaces various Stream operations accept do not allow implementations to throw checked exceptions but many ...

Read More »

Why Elvis Should Not Visit Java

I was recently involved in quite a long Twitter discussion regarding Java’s Optional, type systems that distinguish nullable and non-nullable types and the the Elvis operator, which allows null-safe member selection. The latter was peddled as a killer feature for succinct null-handling, which I strongly disagree with. My opinion on the matter is that without a type system that allows ...

Read More »

Publishing Snapshots With Gradle’s maven-publish Plugin

I’ve recently started a new project with Gradle and decided to jump straight in – no Gradle experience, no clue about Groovy, no tutorials, just hammer on it until it works. That went surprisingly well until I decided to publish snapshots to Sonatype’s Maven snapshot repository with the incubating maven-publish plugin – that took, ahh, a little convincing. Caveat: As ...

Read More »

What Future Java Might Look Like

During the second week of November was Devoxx Belgium, Europe’s biggest Java conference, and as every year the community’s who’s-who showed up. One of them was Brian Goetz, Java Language Architect at Oracle, and he gave what I would consider the conference’s most thrilling talk: “Java Language and Platform Futures: A Sneak Peek”. In it he presented ideas that the ...

Read More »

Rebutting 5 Common Stream Tropes

I’ve just finished reading “1 Exception To The Power of JDK 8 Collectors” and I have to say that I am pretty disappointed. Simon Ritter, Java champion, former Java evangelist at Oracle, and now Deputy CTO at Azul Systems (the guys with the cool JVM), wrote it so I expected some interesting insights into streams. Instead the post comes down ...

Read More »