10

So, People use @Deprecated annotation for APIs that have been deprecated.

Is there any annotation that notifies users if the method is evolving and is not stable?

fabian
  • 80,457
  • 12
  • 86
  • 114
debarshi
  • 327
  • 1
  • 11
  • 2
    Not built-in but you can make your own. Like `@Beta`. – Tunaki Feb 05 '16 at 16:11
  • 2
    There's a [`@Beta` annotation in guava](http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/annotations/Beta.html) that you could use. – azurefrog Feb 05 '16 at 16:15
  • 1
    See also: http://stackoverflow.com/questions/32555597/annotating-unstable-classes-methods-for-javadoc – assylias Feb 05 '16 at 16:19
  • "Is there any annotation that notifies users if the method is evolving?" @Darwin – Neil Feb 05 '16 at 16:21

2 Answers2

4

Afaik, it doesn't exist yet, you have to create your own.

JEP277 define a @Deprecated(EXPERIMENTAL), but it's just a proposition.

Jérémie B
  • 10,611
  • 1
  • 26
  • 43
2

In hadoop there is InterfaceStability annotation for these purposes. The funny thing is this annotation is not stable. I doubt such thing can appear in JDK.

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class InterfaceStability {
  /**
   * Can evolve while retaining compatibility for minor release boundaries.; 
   * can break compatibility only at major release (ie. at m.0).
   */
  @Documented
  public @interface Stable {};

  /**
   * Evolving, but can break compatibility at minor release (i.e. m.x)
   */
  @Documented
  public @interface Evolving {};

  /**
   * No guarantee is provided as to reliability or stability across any
   * level of release granularity.
   */
  @Documented
  public @interface Unstable {};
}
AdamSkywalker
  • 11,408
  • 3
  • 38
  • 76