What is reverse of @deprecated in java [duplicate]

放肆的年华 提交于 2019-12-08 16:15:13

问题


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?


回答1:


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

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




回答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 {};
}


来源:https://stackoverflow.com/questions/35228602/what-is-reverse-of-deprecated-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!