Bug 108649 - Imported deprecated classes continue to display as warnings
Summary: Imported deprecated classes continue to display as warnings
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: 3.2 M6   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-01 23:12 EDT by Missing name CLA
Modified: 2006-02-23 08:15 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name CLA 2005-09-01 23:12:26 EDT
When you use a deprecated class, warnings are reported for the import statement
and the constructor. Suppressing constructor warning works at that level but
does not suppress subsequent reporting of warnings on the import statement.

import java.io.StringBufferInputStream;

private final InputStream getModifiedInputStream()
    throws IOException
  {
    return new StringBufferInputStream("this is a test");
  }
Comment 1 Missing name CLA 2006-02-23 05:01:54 EST
Perhaps you could add a possibility to not show deprecated imports at all? As I get this "is deprecated" message later on anyway, if I'm using this import. And otherwise I get the warning "Unused import". I too would really appreciate such a feature, as this warnings are very irritating.
Comment 2 Philipe Mulet CLA 2006-02-23 07:57:59 EST
We made @SuppressWarnings on first type of the unit also perform on leading imports, for this very issue.

If you disagree, please reopen.
Comment 3 Missing name CLA 2006-02-23 08:15:28 EST
@SuppressWarnings works for the Constructor in the example. But you can't add an Annotation to imports. So it does not work for the import line.

Unfortunately for me, I've found another bug (#103629) which is a duplicate of this one and was already rejected...

In my opinion, it would be a useful and convenient feature (and a good solution for this bug), if I could switch off deprecation warnings for (all) import lines in the Errors/Warnings section of the Preferences. Then I would get this warnings only within the class and may suppress them with the annotation.