Bug 6970 - Hierarchy tick marks out of sync
Summary: Hierarchy tick marks out of sync
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-14 16:57 EST by Nick Edgar CLA
Modified: 2002-01-11 06:40 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2001-12-14 16:57:54 EST
Build 20011211

- open org.eclipse.jface.actions.IAction
- add method:
public void setMenuCreator(IMenuCreator creator) {
}
- build
- error mark shows up in task list and editor tab (method shouldn't have body), 
but not in hierarchy
- make mod and save 
- hierarchy now shows tick
- fix the problem and build
- hierarchy still shows tick
- make mod and save
- hierarchy is now consistent
Comment 1 Martin Aeschlimann CLA 2001-12-18 09:01:45 EST
which errortick did not update correctly? In the type hierarchyies' method view?
there is a open PR for this (bug 4359)
Comment 2 Martin Aeschlimann CLA 2001-12-18 09:45:15 EST
Mail from NE: Yes

-> duplicate of bug 4359

*** This bug has been marked as a duplicate of 4359 ***
Comment 3 Nick Edgar CLA 2001-12-18 16:05:09 EST
Bug 4359 cannot be the cause of this because associate and disassociate are not 
even being called on the hierarchy's viewer during the build.

Try the steps above with autobuild turned off.
Close all other views so you don't get spurious breakpoint hits.
Add the breakpoints on associate and disassociate after saving but before the 
build.  update is called once on the viewer on save (for the type) but this is 
unrelated.

I'm not familiar enough with JDT's update mechanism to pursue this further.

Comment 4 Martin Aeschlimann CLA 2001-12-19 05:30:16 EST
Sorry for my poor description of the bug.

I override 'associate' and 'disasociate' to build up a (own) hashtable to map 
IPaths to items containing elements with a underlying resource of this path.
This informating is used to quickly update elements when marker deltas are 
notified.

The bug is that some table viewer updates call 'associate' and 'disasociate'
in a strange order. The hashtable so becomes incomplete, and no errortick 
updating is performed certain elements (-> errorticks are stuck or do not show 
up)
These are the steps to illustrate the problems with 'associate' 
and 'disasociate':

1. in org.eclipse.jdt.internal.ui.typehierarchy.MethodViewer:
   set breakpoints in 'associate' and 'disasociate'
2. create class A
   public class A {
	void foo() {
	}
   }
3. Open type hierarchy on 'A'
   -> associate is reported for 'foo'
4. Add a new method to A
	void goo() {
	}
5. Save
   -> associate is reported for 'foo'
   -> disasociate is reported for 'foo'
   -> associate is reported for 'goo'

This is how I loose track of 'foo'.

I guess I should use mapElement & unmapElement. Please see bug 2741


Comment 5 Martin Aeschlimann CLA 2001-12-19 05:47:51 EST
Seems that I made a wrong conclusion about the call order of 'associate' 
and 'disasociate'.

I should override 'mapElement' & 'unmapElement'. I would be happy if you could 
have a look at bug 2741 soon.



Comment 6 Nick Edgar CLA 2001-12-19 11:19:27 EST
I've been looking at 2741, trying to find a way to avoid an extra call to 
mapElement if the element is unchanged, to avoid a performance hit.
I'll try to address it soon.
In the meantime, you could just try adding an extra call to mapElement in your 
override of associate.  The performance hit is an extra map lookup, but at 
least only the methods viewer would be affected.


Comment 7 Martin Aeschlimann CLA 2002-01-11 06:40:58 EST
adapted to fixes for bug 2741