Bug 89815 - Types not found using Open Type and search for declaration
Summary: Types not found using Open Type and search for declaration
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-31 08:03 EST by Dani Megert CLA
Modified: 2005-05-11 07:06 EDT (History)
2 users (show)

See Also:


Attachments
Proposed patch (10.98 KB, patch)
2005-04-01 05:51 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 2005-03-31 08:03:40 EST
I20050331-0010

In my workspace "Open Type" and search for declaration found no (0) type that
was imported as binary project (not linked) with PDE and where the project was
JARed (and hence got deflated to individual class files).

The Java model correctly answered the deflated types (i.e. looks OK in Package
Explorer) and I had no compile errors. I could also open those class files and
got the source.

After shutting down Eclipse I deleted all JDT Core index files and restarted:
same problem.

I imported all projects again and now it works again. Nothing in .log.

I cannot reproduce with a fresh workspace.

Dirk saw the same this week.
Comment 1 Jerome Lanneluc CLA 2005-03-31 08:44:02 EST
Next time (before reimporting all projects) can you please zip your workspace
and send it to me ?
Comment 2 Dani Megert CLA 2005-03-31 08:48:13 EST
It's several gigs.
Comment 3 Dirk Baeumer CLA 2005-03-31 08:50:45 EST
I was now able to reproduce this. Here is what I did:

- new workspace
- imported swt and swt.win32 as binary plug-ins
> Control is in open type dialog
- close workspace
- reopen workspace
- import org.eclipse.jdt.ui and all its required plug-ins as binary
> Control is in open type dialog
- close workspace
- reopen workspace

< Control is not in Open Type dialog. Searching for declaration of 
  "org.eclipse.swt.widgets.Control" reports zero matches. However the class
  exist in the workspace and I can open it from the package explorer. Searching
  for references to org.eclipse.swt.widgets.Control reports lots of matches

Interestingly only classes form swt are missing in this scenario. All other
classes are present.
Comment 4 Dirk Baeumer CLA 2005-03-31 08:54:48 EST
I have zipped the test workspace that reveal the problem. Its ~ 50MB.
Comment 5 Dani Megert CLA 2005-03-31 08:55:48 EST
In my case really all (at least those I tried) imported types were missing, e.g.
classes from the OSGi plug-in.
Comment 6 Jerome Lanneluc CLA 2005-03-31 10:20:52 EST
From Dirk's workspace, the index for org.eclipse.swt.win32 exists but it is empty.
This project contains no source folder, but one class folder that is the project
itself. So it looks like the class folder's index and the project's index
collide. And in this case, the project's index won.
Comment 7 Jerome Lanneluc CLA 2005-04-01 05:15:24 EST
Unfortunately, I cannot reproduce reliably enough. So it is hard to understand
the root of the problem. However I can add a protection in IndexAllProject to
not create an empty index if the project has no source folder.
Comment 8 Jerome Lanneluc CLA 2005-04-01 05:51:46 EST
Created attachment 19436 [details]
Proposed patch
Comment 9 Dani Megert CLA 2005-04-04 04:15:38 EDT
This is a major or even critical bug. It makes 3.1 M6 almost unusable for me.
The types are missing again today in my workspace and I must now try to
re-import and hope it works this time. And as already mentioned most of the
imported types are missing, not just SWT.
Comment 10 Markus Keller CLA 2005-04-05 04:36:52 EDT
I also had this problem. Everything was working fine until I moved a new CU to a
new package. The CU was saved, but not committed yet. I selected the main type,
chose Refactor > Move..., created a new package and moved the CU into the new
package.

From then on, the Open Type dialog stayed completely empty. Restarting eclipse
solved the problem for me.
Comment 11 Jerome Lanneluc CLA 2005-04-05 04:50:26 EDT
Patch released. Please reopen if you still see the problem in I20050305.
Comment 12 Dirk Baeumer CLA 2005-04-05 05:10:13 EDT
Thanks for releasing this. It started to drive me nuts as well ;-)
Comment 13 Frederic Fusier CLA 2005-05-11 07:06:19 EDT
Comment 3 scenario verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD.