Bug 161409 - [index] "Open Type" function often fails to find types
Summary: [index] "Open Type" function often fails to find types
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2006-10-18 09:50 EDT by Ken Larson CLA
Modified: 2022-05-21 19:56 EDT (History)
2 users (show)

See Also:


Attachments
screenshot showing files found by find-in-files, but type is not found (259.50 KB, image/png)
2006-10-18 09:56 EDT, Ken Larson CLA
no flags Details
my eclipse log file (331.14 KB, text/plain)
2007-02-15 08:34 EST, Ken Larson CLA
no flags Details
Proposed patch (18.35 KB, patch)
2007-04-23 07:50 EDT, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ken Larson CLA 2006-10-18 09:50:27 EDT
Since I upgraded to 3.2 I've been sporadically having problems with the "Open Type" function.  I'll attach a screenshot showing Java files that I found with the find in files, but that are not showing up when I do "Open Type".  I have this happen relatively often, but less than half of the time.

I find this very frustrating, because we have thousands and thousands of class files, and this was how I always found what I was looking for, and it no longer works reliably.

I know this isn't the forum for this, but I've been a bit frustrated by the "two steps forward, one step back" that eclipse always seems to do when I upgrade, even with final, stable builds.
Comment 1 Ken Larson CLA 2006-10-18 09:55:24 EDT
There is another, similarly frustrating behavior: sometimes in the class hierarchy, child classes are missing.  This is really dangerous, because often one needs to make a change to a parent class and all child classes.  When some of them hide, they don't get updated, and the result is bugs in my code.

Also, the references in workspace search for a type sometimes returns nothing when it should return something.
Comment 2 Ken Larson CLA 2006-10-18 09:56:50 EDT
Created attachment 52226 [details]
screenshot showing files found by find-in-files, but type is not found
Comment 3 Frederic Fusier CLA 2006-10-18 11:15:44 EDT
It sounds to be a problem with indexes. Do you have anything in the .log?
Comment 4 Ken Larson CLA 2006-10-18 11:51:57 EDT
Unfortunately I don't see anything interesting in the log.

I also tried exiting, deleting the log, launching eclipse, cleaning all projects, then finding the type (still not found), but nothing relevant in the log
Comment 5 Frederic Fusier CLA 2006-10-18 12:07:27 EDT
Hmm, then it will be dificult to understand what happen there...
One thing to verify that it comes from indexes (and also may be to workaround your problem), can you please, shutdown your eclipse session, delete all files in .metadata\.plugins\org.eclipse.jdt.core sub-directory of your workspace and restart eclipse, then try to reopen the Open Type dialog...

If problem is still there after indexing finished, then it's something else but if you got back types correctly, this would confirm that your indexes were corrupted...
Comment 6 Ken Larson CLA 2006-10-25 10:05:21 EDT
Exiting, deleting everything in .metadata\.plugins\org.eclipse.jdt.core, then restarting - that fixed the problem.  I now see the classes that were being hidden before.
Comment 7 Frederic Fusier CLA 2006-10-25 10:23:54 EDT
Next step will be now to reopen this bug and attach .log file *as soon as* you get this problem again. As this is an indexing issue which runs in background, problem may have occurred some times ago when you see it in Open Type dialog or while performing a search request. I need to get log rapidly, hoping the reason of the crash will have been logged there and won't have been reset since it occurred.
Then perhaps, this will give me some clue to understand what happened...
Thanks
Comment 8 Mark A. Ziesemer CLA 2006-12-20 16:10:20 EST
I'm having the same problem under 3.3M4, Windows.

I don't even have an error log generated to attach (no errors).  Deleting org.eclipse.jdt.core from .metadata\.plugins didn't help, either.  I was even able to reproduce the problem in a new workspace.  

I'll find a one or more milestones of 3.3 to test, just to make sure this was fixed, and new to 3.3M4.
Comment 9 Mark A. Ziesemer CLA 2006-12-20 16:57:19 EST
My comment #8 appears to be bug 167743...
Comment 10 Ken Larson CLA 2007-02-15 08:34:02 EST
Created attachment 59051 [details]
my eclipse log file

It is happening again.  It started sometime in the past few weeks, sorry for not getting you the log right away.
I should point out that recently my computer has been shutting down from overheating, so eclipse would have been killed ungracefully many times over the past few weeks.  But eclipse crashing is not unheard of, so i think the issue still needs resolution even if that is the cause.
Again, I think it is important that a clean get rid of those files.
Comment 11 Ken Larson CLA 2007-02-15 08:34:30 EST
reopening...
Comment 12 Frederic Fusier CLA 2007-02-19 06:29:33 EST
(In reply to comment #10)
> Created an attachment (id=59051) [details]
> my eclipse log file
> 
> It is happening again.  It started sometime in the past few weeks, sorry for
> not getting you the log right away.
>
No problem as the log file started on 2006-12-19 and so should cover period when you got this problem... However, there's no traces from IndexManager in this log file. This means that either there was no specific issue in this area or the problem was not logged :-(

> I should point out that recently my computer has been shutting down from
> overheating, so eclipse would have been killed ungracefully many times over 
> the past few weeks.  But eclipse crashing is not unheard of, so i think the 
> issue still needs resolution even if that is the cause.
> Again, I think it is important that a clean get rid of those files.
> 
Indexing is supposed to take into account this kind of troubles and clean malformed index files itself when it happens. Looking again at your snapshot I realized that perhaps this is not a problem with indexes as SearchEngine found the class during the type declaration search request. If indexes were corrupted, this request also would miss it... There's something I can't explain here!?

What is the exact Search request you performed to get the results displayed in the Search View? Are you sure that the Search Scope used in Open type dialog is on the entire workspace?

Would it be possible to start eclipse using a console and the Search trace activated? To do this, create an .options file in eclipse launch directory (where the eclipse.exe file is located) with following lines:

# Turn on debug tracing for org.eclipse.jdt.core plugin
org.eclipse.jdt.core/debug=true
# Reports java search activity
org.eclipse.jdt.core/debug/search=true

If you already use a .options file, then just add/modify corresponding lines in it...

In command line to launch eclipse, add following parameters:
-consoleLog -debug
Comment 13 Frederic Fusier CLA 2007-04-23 07:50:42 EDT
Created attachment 64599 [details]
Proposed patch
Comment 14 Frederic Fusier CLA 2007-04-23 07:52:16 EDT
Comment on attachment 64599 [details]
Proposed patch

Sorry, wrong bug
Comment 15 Gerhard Langs CLA 2007-06-12 08:04:04 EDT
Hello
Just have seen the same effect here (eclipse 3.2.1 on Windows). Some types did not show up in "Open Type". However, single types showed up AGAIN, when I modified the source and it was then recompiled.
deleting things below ...jdt.core helped in my case, however Full Clean and Rebuild did NOT.
I sometimes stop eclipse with CTRL-C on the command-box, I can NOT remember that it directly crashed.
.. dont know if this helps much... I've the feeling, that the index-data somehow get out of sync, and the systems doesn't notice it....
Comment 16 Frederic Fusier CLA 2007-11-08 04:57:37 EST
Ken, Gerhard,

When you got these issues, did you use Eclipse SDK standalone or did you have other plugins/install above it (WTP for example)?

I wonder if it could be the same problem than bug 1978012...
Comment 17 Gerhard Langs CLA 2007-11-12 11:31:03 EST
Hello Frederik

Unfortunately:
1. I must say, I cant remember. What I'm quite sure is, that I used some extension, which brought good xml-editing support (was this part of wtp ?).
Since June, I cant remember another occurance of this problem, maybe because I no longer to press CTRL-C on the console-window any more....
Meanwhile I'm using eclipse 3.3.

2. I wanted to take a look at your referenced 1978012, but it seems to be invalid.

Gerhard.
Comment 18 Frederic Fusier CLA 2007-11-12 13:35:57 EST
(In reply to comment #17)
> Hello Frederik
> 
> Unfortunately:
> 1. I must say, I cant remember. What I'm quite sure is, that I used some
> extension, which brought good xml-editing support (was this part of wtp ?).
> Since June, I cant remember another occurance of this problem, maybe because I
> no longer to press CTRL-C on the console-window any more....
> Meanwhile I'm using eclipse 3.3.
> 
Not sure, I just need to know whether the jst.jsp plugin was loaded in your workspace or not...

> 2. I wanted to take a look at your referenced 1978012, but it seems to be
> invalid.
> 
Sorry, I wanted to say bug 197812 :-(

> Gerhard.
> 

Comment 19 Gerhard Langs CLA 2007-11-12 15:15:47 EST
Again, not sure, if jst.jsp was loaded at that time, but i'm quite sure that it was not *active* as we dont work with JSP here.

hope it helps a little
Gerhard
Comment 20 Eclipse Genie CLA 2020-05-27 12:02:40 EDT
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 21 Eclipse Genie CLA 2022-05-21 19:56:47 EDT
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.