Bug 139555 - [hierarchy] Opening a class from Type hierarchy will give the wrong one if source and compiled are in defined in project
Summary: [hierarchy] Opening a class from Type hierarchy will give the wrong one if so...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.3 M1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-01 13:46 EDT by Zorzella Mising name CLA
Modified: 2006-08-07 05:56 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix (7.06 KB, patch)
2006-06-16 11:27 EDT, Jerome Lanneluc CLA
no flags Details | Diff
Regression test (2.07 KB, patch)
2006-06-16 12:11 EDT, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zorzella Mising name CLA 2006-05-01 13:46:30 EDT
Say I have interfaces "A" and "B extends A", and both of these are sources to me, but are, at the same time, also imported from a lib jar. Opening "A" and clicking F4 (show type hierarchy) will bring the hierarchy. Now, clicking on "B" on that hierarchy will open the .class (jar-imported) version of B, rather than the source.

That happens, even though the source is declared to be before the jar in the build class order.
Comment 1 Olivier Thomann CLA 2006-05-08 11:31:43 EDT
Could you please provide the build id?
Comment 2 Zorzella Mising name CLA 2006-05-09 09:49:58 EDT
I first noticed the problem on RC2 (though it could have been there for a long time), and just confirmed that it also happens on RC3. Build id: I20060505-1306

Comment 3 Jerome Lanneluc CLA 2006-06-16 11:27:15 EDT
Created attachment 44653 [details]
Proposed fix

Fix consists in sorting the potential subtypes per roots.
Comment 4 Jerome Lanneluc CLA 2006-06-16 12:11:06 EDT
Created attachment 44656 [details]
Regression test
Comment 5 Jerome Lanneluc CLA 2006-06-19 04:38:31 EDT
Fix and test released for 3.3M1 in HEAD.
Comment 6 Jerome Lanneluc CLA 2006-06-21 11:57:25 EDT
Patch had a bad side effect of not grouping potential subtypes per project. These caused performance degradation in I20060620.

Added the potential subtypes sorting back in IndexBasedHierarchyBuilder#buildFromPotentialSubtypes(...). This bug is still fixed.
Comment 7 Frederic Fusier CLA 2006-08-07 05:56:26 EDT
Verified for 3.3 M1 using build I20060807-0010.

However, I was not able to reproduce the problem in 3.2 build...