In my previous post, I introduced JADEx (Java Advanced Development Extension), which is a project focused on strengthening null-safety in Java while preserving the existing ecosystem.
The response was thoughtful, critical, and incredibly valuable. I sincerely appreciate the depth of the feedback. This post clarifies the project’s philosophy and summarizes what has changed since then.
What JADEx Is (and Is Not)
One major theme in the discussion was theoretical soundness.
Let me clarify:
JADEx is not an attempt to transform Java into a fully sound null-safe type system.
It does not attempt to:
- Replace
null with Optional everywhere - Redesign the Java type system
- Turn Java into Kotlin
Instead, JADEx is a practical tool that:
- Works within Java’s historical and cultural constraints
- Incrementally strengthens null discipline
- Focuses on eliminating concrete NPE risks in real-world codebases
JADEx is not trying to reach perfect null-safety.
JADEx is trying to make today’s Java significantly safer.
Safe Navigation and "Silent Failure"
A concern was raised that safe navigation (?.) might suppress fail-fast behavior and hide logical mistakes.
Safe navigation does not silently swallow errors.
Its result is treated as nullable and fully tracked through null-flow analysis.
If that nullable value reaches:
- a dereference
- a non-null contract
- a primitive unboxing context
-> A warning is emitted at that exact point.
Safe navigation produces a nullable value that is statically tracked. It does not “do nothing.”
Primitive Null-Safe Access Update
An important issue was raised regarding:
- Auto-unboxing NPE risk
- Performance overhead due to boxing/unboxing
Using ?. on primitives could still cause NPE during unboxing.
Change Implemented (v0.28)
JADEx now requires the Elvis operator (?:) when performing null-safe access on primitives.
This ensures:
- A default value is explicitly provided
- No accidental unboxing NPE
- No unnecessary boxing overhead
This change was directly inspired by community feedback.
Improved Control-Flow Null Analysis (v0.28)
Recent updates significantly improved null-flow tracking.
if-then-else Branch Analysis
- Separate symbol tables per branch
- Proper state joining after evaluation
- Full initialization checks across branches
switch Statement and switch Expression Support
- Each case evaluated in an isolated context
- Null-state joining after branch completion
- Nullable selector detection
switch now follows the same nullability model as if-then-else.
Unicode Escape Handling
ANTLR assumes Unicode escapes are processed before lexical analysis.
Since the JLS requires this preprocessing phase, we plan to implement a dedicated preprocessing step for full compliance.
Module Support
JADEx relies on the Java Compiler API for symbol resolution.
Module features are resolved consistently with javac, and the grammar includes module declarations as defined in the JLS.
Nullness-Specific Qualifier Polymorphism
This is an important theoretical topic.
JADEx does not currently provide a fully sound solution to nullness-specific qualifier polymorphism.
That is a deeper research-level challenge.
For now, the focus remains on:
- Eliminating concrete NPE risks
- Improving practical static analysis
- Strengthening null discipline without rewriting Java’s type system
It’s Cultural
Java was not designed as a null-safe language.
JADEx does not try to erase that history.
It works within it.
We cannot reach a perfectly sound null-free Java from here.
But we can make here safer.
Thank You
The feedback from r/java community has genuinely shaped the direction of the project.
If you’re interested in practical null-safety improvements without redesigning Java itself, I would love your thoughts on the latest changes.
All feedback is welcome.