Bug 441237

Summary: "Type Filters" should provide an option to filter deprecated types
Product: [Eclipse Project] JDT Reporter: Alex Blewitt <alex.blewitt>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: markus.kell.r, noopur_gupta
Version: 4.5   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

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.