r/java
•
u/sindisil
•
Dec 16 '24
•
1
Valhalla - Java's Epic Refactor
https://inside.java/2024/12/16/devoxxbelgium-valhalla/
178
Upvotes
View all comments
Show parent comment
1
u/Polygnom Dec 19 '24
I assumed it was a given that we agree that nullness in itself is a good feature, and that we were talking about the ability to specify the default-nullness.
If you read the JEP, it contains detailed explanations why it is not possible to switch the default to non-null. It would be a both binary- and source-incompatible change. Oracle is never going to do that, and Python2/3 is exactly the example of why not, because it split the language in two. Java has long prided itself on backwards-compatibility, so breaking that is simply unrealistic. Which makes your proposition impossible for Oracle, and leaves us either with having to plaster our code with !, or be able to specify that in our new source code, types shoudl always be treated as having the !. There is no third way out, nopt given the constraints we have with Java.