Bug 441237 - "Type Filters" should provide an option to filter deprecated types
Summary: "Type Filters" should provide an option to filter deprecated types
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-06 06:07 EDT by Alex Blewitt CLA
Modified: 2014-09-12 10:27 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 Alex Blewitt CLA 2014-08-06 06:07:25 EDT
The type filter allows forbidden and discouraged references to be hidden from suggestion. However, it still suggests types that are annotated with a @Deprecated annotation.

In a Java project that has JUnit 4 installed, the organise imports for this code shows both 'junit.framework.Assert' and 'org.junit.Assert'. Unfortunately this lexicographic order presents the deprecated type first.

public Bug {
  Assert a;
}

There should be an option to hide deprecated types from the Filter Types dialog, and organise imports should not suggest junit.framework.Assert in the first place.
Comment 1 Noopur Gupta CLA 2014-08-27 09:12:26 EDT
"Type Filters" can be enhanced with an option to filter deprecated types.
Comment 2 Markus Keller CLA 2014-09-12 10:27:59 EDT
See also bug 250284. Deprecation is very different from ordinary type filters, since the set of filtered elements is not constant and not user-defined. It can be confusing if a type suddenly doesn't show up any more because someone else has marked it as deprecated.

A better solution would be a generalization of bug 250284 that allows to lower the relevance of deprecated proposals everywhere (Open Type, Organize Imports, Content Assist, Quick Fixes).

I think the number of types/packages that should really be filtered everywhere is quite low. And these can easily be added to type filters on a case-by-case basis.