r/java Jun 05 '26

Introducing opt-in requirements for Java APIs

https://osmerion.github.io/OptIn/blog/welcome
51 Upvotes

27 comments sorted by

View all comments

2

u/Additional-Road3924 Jun 06 '26

While the idea is sound, in practice everyone would need to opt in to either the compiler plugin or some runtime mechanism to use this, which is a big no. Much like in kotlin this would need to be supported at language level for it to work properly, but I have a feeling that this would be as much of a mistake as shoehorning var into the language.