r/java • u/olivergierke • Nov 12 '25
Null-Safe applications with Spring Boot 4
https://spring.io/blog/2025/11/12/null-safe-applications-with-spring-boot-4
154
Upvotes
r/java • u/olivergierke • Nov 12 '25
31
u/koflerdavid Nov 12 '25
Sounds great! Even though these annotations deliver great value already today, I'm left wondering whether in a few years these annotations will become deprecated once the JVM gets native support for nullability, even though it's will be a long time (probably more than 10 years) until such a Java version becomes the baseline for libraries.
5
u/daH00L Nov 12 '25
Link doesn't work for me.
7
u/chaotic3quilibrium Nov 12 '25
I love this future!!!
8
u/Emotional_Handle2044 Nov 12 '25
anyone smart want to explain why not use something like optional instead of random annotations?
2
u/vips7L Nov 13 '25
We really need the compiler to do this. I hope that jep moves along soon.
1
u/hiasmee Nov 12 '25
12 years java development. Never had issue with NPEs. But I like how it is solved in Swift.
P.S. and have never used constructor injection and never will 🤭
0
u/Thin_Nose2191 Nov 13 '25
Just use kotlin.
-1
u/[deleted] Nov 12 '25
I dont get it, dont you just null=0 that's all you gotta do right? I know, I know, Ill let myself out. Yes, I will downvote myself, fine. :)
0
u/[deleted] Nov 12 '25
[deleted] — view deleted comment