Java classes only support single inheritance, but interfaces allow multiple inheritance.
For interface BB, it can extend multiple super interfaces (e.g. AA1, AA2), which cannot be expressed well with full hierarchical view. This should be the reason why super interfaces are not shown in the traditional view.
Thanks,
Jinbo
From: jdt-dev <jdt-dev-bounces@xxxxxxxxxxx> on behalf of Noopur Gupta <noopur_gupta@xxxxxxxxxx>
Reply-To: "Eclipse JDT general developers list." <jdt-dev@xxxxxxxxxxx>
Date: Thursday, March 11, 2021 at 17:45
To: "jdt-dev@xxxxxxxxxxx" <jdt-dev@xxxxxxxxxxx>
Subject: [EXTERNAL] Re: [jdt-dev] Traditional Hierarchy Viewer
It should be OK to show the full hierarchy in case of interfaces as it is done for classes. The Type Hierarchy view has three separate options for the full, supertype, and subtype
hierarchies and they should have the same behavior for classes and interfaces.
----- Original message -----
From: Jeff Johnston <jjohnstn@xxxxxxxxxx>
Sent by: "jdt-dev" <jdt-dev-bounces@xxxxxxxxxxx>
To: "Eclipse JDT general developers list." <jdt-dev@xxxxxxxxxxx>
Cc:
Subject: [EXTERNAL] [jdt-dev] Traditional Hierarchy Viewer
Date: Thu, Mar 11, 2021 2:37 AM
There is a bug open whereby there are 3 interfaces:
AA which is extended by BB which is extended by CC
When BB is selected and we do Open Type Hierarchy,
it only shows BB and CC, but not AA in the Traditional View (Show Type Hierarchy)
Clicking on the Show the Supertype Hierarchy button displays BB then AA as expected.
TraditionalHierarchyViewer.java has the following comment:
* A TypeHierarchyViewer that looks like the type hierarchy view of VA/Java:
* Starting form Object down to the element in focus, then all subclasses from
* this element.
* Used by the TypeHierarchyViewPart which has to provide a TypeHierarchyLifeCycle
* on construction (shared type hierarchy)
Is there any good reason to not show the parent interface (AA) in the view because it does not extend Object? I would as a user want to see the whole tree and not have to click
the "Show the Supertype Hierarchy" button to see the super interfaces.
I have a simple fix unless there is a good reason for the behaviour.
|