r/java • u/TheMrMilchmann • Jun 05 '26
Introducing opt-in requirements for Java APIs
https://osmerion.github.io/OptIn/blog/welcome
49
Upvotes
r/java • u/TheMrMilchmann • Jun 05 '26
View all comments
Show parent comment
3
u/TheMrMilchmann Jun 05 '26
The javac integration reports a warning when an
@OptInis unused. The IDEA plugin does not have this inspection yet, but it may be added in the future.To address your concerns, I think there is a slight misunderstanding here. If your persistence layer internally uses some experimental feature, you would usually have an
OptIn(ExperimentalCaching.class)on the function or type in your persistence layer, which stops the requirement from propagating.