Bug 210070 - Type hierarchy unpredictable
Summary: Type hierarchy unpredictable
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 210422
Blocks:
  Show dependency tree
 
Reported: 2007-11-16 04:54 EST by Dani Megert CLA
Modified: 2008-01-30 06:36 EST (History)
1 user (show)

See Also:


Attachments
-debug trace (19.00 KB, text/plain, text/file)
2007-11-16 04:55 EST, Dani Megert CLA
no flags Details
Proposed fix and regression test (4.01 KB, patch)
2007-11-19 11:15 EST, Jerome Lanneluc CLA
no flags Details | Diff
Another approach for the fix (and same regression test) (4.01 KB, text/plain)
2007-11-20 07:58 EST, Jerome Lanneluc CLA
no flags Details
Assuming compiler is fixed, this should fix the problem (includes same regression test) (4.71 KB, text/plain)
2007-11-21 07:09 EST, Jerome Lanneluc CLA
no flags Details
Improved fix and new test (from comment 6) (6.09 KB, patch)
2007-11-21 11:43 EST, 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 Dani Megert CLA 2007-11-16 04:54:53 EST
I20071113-0800.

Sometimes types are missing in the type hierarchy. So far I could narrow down one test case:

1. load the 'platform-ui', 'platform-text' and 'jdt' modules from CVS
   (wait until build is done)
3. replace RefreshEditorAction with rev. 1.1
4. Use Open Type to open org.eclipse.ui.actions.RefreshAction
   (wait for the index to be built)
4. Ctrl+T
   ==> OK: observe the anonymous inner class subclass
5. exit
6. start
7. Ctrl+T on org.eclipse.ui.actions.RefreshAction
   ==> BUG: observe the anonymous inner subclass is not there

Some strange stuff:
1. after opening RefreshEditorAction in the Java Editor Ctrl+T correctly reports the anonymous inner subclass.

2. exit, delete the search indexes and restart: problem is gone. Exit, restart: problem is back again.

As alternative I can either offer my test workspace (60 MB) or we can debug it together via NetMeeting.
Comment 1 Dani Megert CLA 2007-11-16 04:55:52 EST
Created attachment 83049 [details]
-debug trace
Comment 2 Dani Megert CLA 2007-11-16 05:04:33 EST
>2. exit, delete the search indexes and restart: problem is gone. Exit, restart:
>problem is back again.
Actually deleting the index doesn't fix it.
Comment 3 Jerome Lanneluc CLA 2007-11-19 11:15:06 EST
Created attachment 83246 [details]
Proposed fix and regression test
Comment 4 Jerome Lanneluc CLA 2007-11-20 07:58:21 EST
Created attachment 83323 [details]
Another approach for the fix (and same regression test)

With the first proposed fix, the type hierarchy creation is slowed down quite a bit. This new approach attempts to make the compiler more fault-tolerant. However this fix makes ResolveTests#testConstructor3() and testConstrictor4() fail with a NPE, and AnnotationTest#test113() fail as another error is introduced.

Need to talk to Philippe to decide what to do.
Comment 5 Jerome Lanneluc CLA 2007-11-20 12:41:21 EST
There is more work on the compiler side to make it work correctly. Bug 210422 has been opened against the compiler.
Comment 6 Jerome Lanneluc CLA 2007-11-20 13:36:14 EST
Other test case:

public final class X {
	
	X(int i) {}
	
	void foo() {
		new X(12) {};
	}  
}

Hierarchy on X misses anonymous type.
Comment 7 Jerome Lanneluc CLA 2007-11-21 07:09:26 EST
Created attachment 83421 [details]
Assuming compiler is fixed, this should fix the problem (includes same regression test)
Comment 8 Jerome Lanneluc CLA 2007-11-21 11:43:30 EST
Created attachment 83443 [details]
Improved fix and new test (from comment 6)
Comment 9 Jerome Lanneluc CLA 2007-11-21 11:49:21 EST
Fix and tests released for 3.4M4
Comment 10 Maxime Daniel CLA 2007-12-12 04:28:29 EST
Verified for 3.4 M4 using build I20071211-0010.