r/java • u/bobbie434343 • Aug 25 '26
Value Classes Still Need Compiler Sympathy
https://johan-sjolen.github.io/post/compiler-sympathy/compiler-sympathy/
88
Upvotes
r/java • u/bobbie434343 • Aug 25 '26
View all comments
Show parent comment
1
u/AnyPhotograph7804 Aug 25 '26
True. But tearing is still nothing, which is new in Java. Even if the chance to be affected by it was very very low. You have to write very special code to trigger it.
And yes, maybe there should be a new annotation or a new keyword, that allows you to mark a class, that tearing is allowed. In Java, there are tons of software, which is highly multithreaded. Those software could silently fail if you enable tearing by default.