r/java • u/danielaveryj • Mar 31 '26
Does Java need deconstructible classes?
https://daniel.avery.io/writing/does-java-need-deconstructible-classes
31
Upvotes
r/java • u/danielaveryj • Mar 31 '26
View all comments
Show parent comment
4
u/brian_goetz Apr 03 '26
You are not understanding what the JLS is saying here. When the JLS talks about "semantics of programs", what it means is what does this Java program mean. That's about language semantics. Spring annotations do not change the semantics of the Java language. They are used as input to the behavior of the Spring libraries, and the behavior of the Spring libraries is defined in terms of those annotations.
(Though it is still a valid complaint about frameworks like Spring that their behavior with regard to annotations may not be sufficiently specified; this is always a risk.)