Community
Participate
Working Groups
This clean up can go in 'Clean up > Missing Code > Add missing Annotations'.
We should not add this. The @SafeVarargs annotation is used very rarely (only 4 times in the whole rt.jar). Furthermore, the annotation is only valid on methods where "the body of the annotated method or constructor does not perform potentially unsafe operations on its varargs parameter". This analysis is not trivial, and it's not worth spending time on the implementation for such a rarely used feature. Moreover, the effects of cleanup changes should be safe enough that they can usually be applied without review from the user. But an @SafeVarargs declaration has an effect on every call site of the method, so this is not a small change.
(In reply to comment #1) > Furthermore, the annotation is only valid on methods where "the body of the > annotated method or constructor does not perform potentially unsafe operations > on its varargs parameter". This analysis is not trivial, and it's not worth > spending time on the implementation for such a rarely used feature. hmm.. agree.