Community
Participate
Working Groups
Invalid type hierarchy when missing type(s) in hierarchy. Test Case: 1. Create J project 2. Add JUnit 3. Use J9 lib instead of SDK 4. Open type hierarchy on TraceFrame ==> shown type hierarchy is TraceFrame --> Object This is even more confusing if the source is not opened, e.g.by fist opening Test.java in the type hierarchy and then setting the focus to the above class. The type hierarchy should either not show the hierarchy or somehow indicate the problem. NOTES: EG (7/12/01 11:10:49 AM) moving to JCORE for comment JBL (8/29/2001 4:29:33 PM) I don't have a version of JUnit that contains a type TraceFrame. Could you provide me with this version? DM (8/29/01 5:01:56 PM) Sent JUnit 3.2 to Jerome.
PRODUCT VERSION: 0.122
I find that not showing the hierarchy would be even more confusing. I'm not sure why you're saying that the hierarchy is invalid: the super type Frame doesn't exist, so we cannot invent it. If we put a fake Frame class, this would confused the user since there would be no source to show. In VAME and VAJ, the hierarchy doesn't include Object when the super type doesn't exist. Is this what you want?
I would excpect that either the view opens and I see that there are missing classes or the hierarchy is not displayed and I get a dialog. Maybe the test case is a bit specific because Object is the next class in the hierarchy. What about A -> B -> C -> D -> E -> Object and then taking B and D out? Would you expect to get A -> C -> E -> Object or only A (when looking at type hierarchy of A)? In both cases I would like a hint either in the view or a dialog before it opens.
What about the hint being that A has no super type (not even Object) if its direct super type is missing? So in your example, if B is missing we would show A only. If B is present and C is missing we would show A -> B. Etc. I think when the user sees that a type is not rooted at Object, he/she would know that there is a problem with the hierarchy.
This should work but the UI should then still give some hint. I don't want to check myself if Object is visible in my (Supertype-)Hierarchy. Of course the nicest would be a dummy tree (UI) element <missing super class>. As you stated earlyer I would not insert a dummy class into the model because this would drag in other problems.
If a type is missing, the hierarchy is not rooted at Object any longer (this is consistent with VAJ and VAME.) Please, enter a bug against JDT/UI if you consider that the UI should give some other hint that the hierarchy has problems. In this case, it should use the fact that the hierarchy is not rooted at Object.