Introducing opt-in requirements for Java APIs
· 2 min read
Every library author has been there: you have a new API that works, but you're not ready to commit to it forever. Maybe the design will change. Maybe it's a low-level escape hatch that most users shouldn't touch. You add a note to the JavaDoc - "experimental, use at your own risk" - and hope for the best.
Some projects introduce custom annotations like @Beta or @Incubating which are - with a few exceptions - unsupported
by IDEs and have no compiler support.
OptIn aims to standardize declaring and working with APIs that require explicit opt-in in Java.
