Why @SafeVarargs is RetentionPolicy.RUNTIME in contrast to @SuppressWarnings is SOURCE?

Viewed 35

Roles of @SuppressWarnings and @SafeVarargs suppress warnings. Both of them are similar because of that.

I think RetentionPolicy.SOURCE is enough for @SafeVarargs like @SuppressWarnings. Does it have a reason?

In java.lang

@Retention(RetentionPolicy.SOURCE)
public @interface SuppressWarnings {

@Retention(RetentionPolicy.RUNTIME)
public @interface SafeVarargs {
0 Answers
Related