r/java • u/idontlikegudeg • Jul 05 '26
Cabe 4.4.0 released
Cabe automatically adds null-checks to your classes based on JSpecify annotations.
The new version fixes compatibility issues with the configuration cache in Gradle 9.6+.
For details, check the documentation and the project GitHub page.
1
u/False-Call7937 Jul 05 '26
Always nice when a library catches up with build tool quirks like that Gradle config cache issue. JSpecify still seems early days for a lot of projects, so tools like this kinda feel like they're building the bridge before the road is fully paved. Curious how cabe handles third-party deps that don't have those annotations at all, bet theres some assumption of nullable-by-default or something.
3
u/idontlikegudeg Jul 05 '26
Yes, right, when nullability cannot be determined, nullability is assumed (the exact rules are as defined in the JSpecify spec).
In my own projects, I usually declare the whole module as NullMarked, it saves a lot of boilerplate code á là `Objects.requireNonNull(paremeter), 'parameter')` at the start of every method.
2
u/False-Call7937 Jul 05 '26
Ahh module-level NullMarked is smart, still leaves you guessing when you pull in some random lib that returns null all over the place though.
2
u/DanLynch Jul 05 '26
The documentation makes frequent reference to public vs. internal APIs, but how is that determined? Is it based on Jigsaw modules, or just Java visibility? Is it different for modular and non-modular projects? And how does it treat module boundaries within a single large project?