Bug 215033 - [search] Cannot find classes using Open Type dialog
Summary: [search] Cannot find classes using Open Type dialog
Status: CLOSED DUPLICATE of bug 320809
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC All
: P5 normal (vote)
Target Milestone: 3.7 M2   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-11 10:42 EST by Frederic Fusier CLA
Modified: 2019-12-29 07:59 EST (History)
3 users (show)

See Also:


Attachments
Example with a non-named type as the first selection (23.82 KB, image/png)
2008-07-10 13:02 EDT, Paul Webster CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2008-01-11 10:42:23 EST
Using I20080108-1320 build.

Suddenly the Open type dialog stops to work for the classes of one of my project in my workspace (unfortunately org.eclipse.jdt.core project)...

Nothing obvious in the Search Engine was displayed: the scope used is the JavaWorkspaceScope and the pattern looks OK.
Comment 1 Frederic Fusier CLA 2008-01-11 10:45:55 EST
Hopefully, I was able to debug this problem in my self-hosted eclipse session and discovered that the project was no longer in the JavaWorkspaceScope.

I'll investigate further, but set as major as this make the session hard to use!
Comment 2 Frederic Fusier CLA 2008-01-17 09:37:03 EST
Unfortunately, I didn't clearly understand what was the reason of this problem when it occurred in my workspace. I wrongly thought I had the explanation and restart my eclipse session to verify my assumption but I wasn't able to reproduce the problem since then :-(

So, I reduce the severity and priority for now and I'll try to catch this issue more properly the next time (approx. once per month!)...
Comment 3 Paul Webster CLA 2008-07-10 13:01:12 EDT
I see this (or something similar to it in I20080708-0830

Open type will not find some classes in org.eclipse.jface.  If I type Action it offers the jface Action as an option.  If I type MenuManager, it offers a random choice as the first selection and then MenuManagerTest as the second one.

But MenuManager is there (I checked :-)

PW
Comment 4 Paul Webster CLA 2008-07-10 13:02:12 EDT
Created attachment 107106 [details]
Example with a non-named type as the first selection

I can open a separate bug if you'd like (since this doesn't effect all classes in org.eclipse.jface, just specific ones)

PW
Comment 5 Paul Webster CLA 2008-07-10 13:10:29 EDT
Sorry, I don't believe my problem is related to this, please disregard comment #3 and comment #4

Opened bug 240363 to track my issue.

PW
Comment 6 Frederic Fusier CLA 2008-09-08 10:30:30 EDT
I got it once again and for the same project: org.eclipse.jdt.core...
However, this time the workspace scope was valid (i.e. it includes the project). The problem was that index file was not found in the .metadata although the Index was still referenced by IndexManager.indexes table...
Comment 7 Frederic Fusier CLA 2009-10-20 05:35:35 EDT
I now got this issue in a recurrent manner :-( Tracking down in a remote debug session I saw that in fact the Index for the org.eclipse.jdt.core project was no longer referenced in the indexes lookup table but there's still an entry for its path in the indexLocations lookup table! Furthermore, this entry refers to the index of another Index file: org.eclipse.jdt.core.tests.model, hence there's no chance to find any match in the org.eclipse.jdt.core project!!!

Kent, do you see any reason why the indexLocations table may have been messed up and could return the location of an other index file? Looking at the code, it appears that the only place where the indexLocations table is modified is in IndexManager.computeIndexLocation(IPath) which is not synchronized, could it be a possible explanation?

Any hints on this would be greatly appreciated :-)
Comment 8 Kent Johnson CLA 2009-10-20 10:35:02 EDT
There are 11 direct senders of computeIndexLocation() & 7 are already synchronized & IndexManager.saveIndex(Index) uses a sync block inside

The other 3 are :

IndexManager.addBinary(IFile, IPath)
IndexManager.addSource(IFile, IPath, SourceElementParser)
IndexSelector.initializeIndexLocations()

It seems like a reasonable change to synchronize computeIndexLocation().

Some methods are using the ReadWriteMonitor on the index, but I suggest you double check the code into the 3 methods above.
Comment 9 Eclipse Genie CLA 2019-12-29 05:18:02 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 10 Stephan Herrmann CLA 2019-12-29 07:59:44 EST
(In reply to Kent Johnson from comment #8)
> There are 11 direct senders of computeIndexLocation() & 7 are already
> synchronized & IndexManager.saveIndex(Index) uses a sync block inside
> 
> The other 3 are :
> 
> IndexManager.addBinary(IFile, IPath)
> IndexManager.addSource(IFile, IPath, SourceElementParser)
> IndexSelector.initializeIndexLocations()
> 
> It seems like a reasonable change to synchronize computeIndexLocation().
> 
> Some methods are using the ReadWriteMonitor on the index, but I suggest you
> double check the code into the 3 methods above.

computeIndexLocation() is synchronized since the fix for bug 320809, and so is the overload added via bug 395897.

*** This bug has been marked as a duplicate of bug 320809 ***