问题
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