Bug 35093

Summary: Not only changes in working copy should refresh type hierarcy.
Product: [Eclipse Project] JDT Reporter: Alexander Shatalin <vano>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: shatalin
Version: 2.0.2   
Target Milestone: 2.1 RC3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Alexander Shatalin CLA 2003-03-15 09:38:02 EST
- Create two classes: p1.Class1 and p1.Class2
- Open type hierarcy for the p1.Class1
- In some external editor change p1.Class2 by additing "extends Class1" 
statement
- Go to the Eclipse and invoke "refresh" action for this project from 
navigator -> type hierarchy for Class1 would not be changed.

Same action performed from the editor cause correct refresh of TypeHierarchy 
on saving the file.

Seems like the changes which was not done inside the "working copy" of 
corresponding ICompilationUnit would be reported incorrestly and would not 
refresh corresponding TypeHierarchy. 

We have some code which changes ICompilationUnits (without creation of 
WorkingCopy) it seems working correctly except of refreshing TypeHierarcy...
Comment 1 Philipe Mulet CLA 2003-03-17 06:52:16 EST
Type hierarchies involving types being edited are using shared working copies, 
instead of compilation unit elements.

At first glance, the refresh should still occur. Need to investigate.

Comment 2 Alexander Shatalin CLA 2003-03-17 07:10:58 EST
In our code this problem was fixed by switching to "working copy mode". Once I 
perform changes in newly created working copy (not shared) and commit this 
changes at the end of operation - everything works Ok (type hierarchy 
refreshed)
Comment 3 Jerome Lanneluc CLA 2003-03-17 07:29:35 EST
Alex, are you saying the problem was in your code?
Comment 4 Alexander Shatalin CLA 2003-03-17 07:46:29 EST
No.. ;-) We have work-arounded this problem by intruducing working copies (NOT 
SHARED). But, as I mentioned in the very beginning of this bug report, this 
problem reproducable with "pure eclipse" (without introducing any additional 
code into it)
Comment 5 Jerome Lanneluc CLA 2003-03-17 09:37:44 EST
If the change is made in the Java editor, a working copy is used and a 
FINE_GRAINED delta is fired. It contains enough information (namely the 
supertype has changed) to determine that the hierarchy needs to be refreshed.

If the change is made in an external editor, the project refresh triggers a 
delta saying that the compilation unit has changed, but no more information can 
be inferred without opening the compilation unit.
Comment 6 Jerome Lanneluc CLA 2003-03-17 10:40:04 EST
Performance wise, this would be too costly to open all compilation units that 
changed to see if the hierarchy needs to be refreshed. 

Using the Java editor doesn't show the problem. Using an external editor, your 
workaround is the right thing to do.

Marking as WONTFIX.