Bug 299812 - Add QuickFix @SuppressWarnings to declaration
Summary: Add QuickFix @SuppressWarnings to declaration
Status: CLOSED DUPLICATE of bug 105668
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.6 M6   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-15 15:35 EST by G. Ralph Kuntz, MD CLA
Modified: 2010-01-25 07:57 EST (History)
2 users (show)

See Also:


Attachments
Proposed fix (3.51 KB, patch)
2010-01-21 14:26 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description G. Ralph Kuntz, MD CLA 2010-01-15 15:35:32 EST
Build Identifier: M20090917-0800

The QuickFix offers to add a @SuppressWarnings to the enclosing method. It should also offer to apply the annotation to the affected declaration when  applicable. According to "Effective Java, 2nd Edition", pg 117 (Jochua Bloch): "Always use the SuppressWarnings annotation on the smallest scope possible."

Reproducible: Always

Steps to Reproduce:
1. Add a declaration: List<String> myList = new ArrayList();
2. Click ctrl-1 on ArrayList
3. Note that the only "Add @SuppressWarnings..." applies to the enclosing method
Comment 1 Olivier Thomann CLA 2010-01-21 14:26:22 EST
Created attachment 156845 [details]
Proposed fix
Comment 2 Olivier Thomann CLA 2010-01-21 14:26:54 EST
Move to JDT/UI.
Existing tests might need an update.
Comment 3 Markus Keller CLA 2010-01-25 07:57:41 EST

*** This bug has been marked as a duplicate of bug 105668 ***