Skip to content

Engineering

Null-Safety, Now Included: JSpecify in OpenCQRS

We all know null is the age-old problem in Java, famously called "the billion dollar mistake." After decades of attempts to fix it, from JSR-305 annotations to new languages on the JVM like Kotlin, Java itself still doesn't have a universally adopted standard for nullability.

As a framework, OpenCQRS should avoid NPE bugs slipping through to production as much as possible. You rely on it, and it has to work. So we looked at what the Java ecosystem offers today and picked the best option we could find: JSpecify. Every module in the framework is now null-safe by default, enforced at compile time. This hardens not only our code, it also benefits yours. Let's have a look.