Bug 162062 - [type hierarchy] Generic - Show type hierarchy
Summary: [type hierarchy] Generic - Show type hierarchy
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-24 08:34 EDT by Guy Korland CLA
Modified: 2006-10-24 09:20 EDT (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 Guy Korland CLA 2006-10-24 08:34:35 EDT
"Show type hierarchy" shows all the classes that extends a certain type but ignores the type generic.

e.g.

Map<String, String> m;

If I'll hit the F4 button on the Map<String, String> I'll get all the classes that implements Map (which can be a huge number) e.g. HashMap (which doesn't implements     
Map<String, String>) and not all the classes that implements Map<String, String>.
Comment 1 Markus Keller CLA 2006-10-24 09:20:54 EDT
Type hierarchies currently only show the declaration hierarchy, but not concrete parameterized types.

We could think about adding a new mode to consider resolved types. However, this would not give a much smaller hierarchy, since many generic subtypes of Map<K,V> would still be part of the hierarchy (e.g. Hashtable<String, String>) while only a few (like Properties, which extends Hashtable<Object,Object>) could be left out.

As soon as wildcards come into play, the hierarchy explodes. E.g.
Map<String, ? extends Object>,
Map<String, ? extends Serializable>, and
Map<String, ? super String>
are just a few of the many supertypes of Map<String, String>.
The subtypes of Collection<? extends Object> are not even a finite set.

In summary: The resolved type hierarchy could not be shown completely, and showing only parts of it would IMO be confusing.