r/java • • Jun 05 '26

Introducing opt-in requirements for Java APIs

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

27 comments sorted by

View all comments

Show parent comment

2

u/aboothe726 Jun 05 '26 edited Jun 05 '26

Appreciate the response!

What you're describing might be fine, especially for internal libraries. Many is the time that I've put an experiment into code at work, looked away for a minute, and suddenly there are 2 or 3 users of the code despite comments and @Deprecated. It's possible that Maven Enforcer Plugin or ArchUnit could have helped, but those come with their own issues.

Also, in my mind, I'm also imagining that you could use a string as the category and/or message within a fixed annotation.

Certainly not trying to tell anyone how to write or use the library. Just sharing my thoughts, for whatever that's worth.

Thank you for sharing!