Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350128 - [1.7] [clean up] to add @SafeVarargs annotation to method declarations where necessary
Summary: [1.7] [clean up] to add @SafeVarargs annotation to method declarations where ...
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Deepak Azad CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-23 06:44 EDT by Deepak Azad CLA
Modified: 2011-06-23 07:20 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Deepak Azad CLA 2011-06-23 06:44:33 EDT
This clean up can go in 'Clean up > Missing Code > Add missing Annotations'.
Comment 1 Markus Keller CLA 2011-06-23 07:08:43 EDT
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.
Comment 2 Deepak Azad CLA 2011-06-23 07:20:38 EDT
(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.