Why can't @SafeVarags apply to instance methods in the final class?

According to the SafeVarargs documentation, the SafeVarargs annotation can only be applied to constructors or methods of the arity variable that are either static or final . I read this to fix annotation inheritance issues; those. Method annotations are only allowed if the method cannot be overridden. Obviously, constructors, static methods, and final methods cannot be overridden. However, neither private methods nor private methods in the final class can be used. Someone complained about the inability to assign @SafeVarargs private methods, but none of these problems were resolved . In general, no one really cares . Am I missing something? Am I complaining about having no practical applications? Or...?

+7
java override annotations type-erasure variadic-functions
source share
1 answer

This is planned to be installed in Java 9; see http://openjdk.java.net/jeps/213 .

+5
source share

All Articles