Bug 200064

Summary: [search] ResourceException while searching for method reference
Product: [Eclipse Project] JDT Reporter: Frederic Fusier <frederic_fusier>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: eric_jodet, jerome_lanneluc
Version: 3.3   
Target Milestone: 3.4 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

Description Frederic Fusier CLA 2007-08-15 12:40:46 EDT
Using build I20070815-0800.

While searching for 'read' method reference from a test class, I got following resource exception:
!ENTRY org.eclipse.jdt.ui 4 10001 2007-08-15 17:36:31.444
!MESSAGE Internal Error
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Resource '/Cloudscape/cs.jar/com/ibm/db2cs/aq/c.class' does not exist.
        at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:310)
        at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:193)
        at org.eclipse.core.internal.resources.File.getContents(File.java:285)
        at org.eclipse.jdt.internal.core.util.Util.newClassFileReader(Util.java:1467)
        at org.eclipse.jdt.internal.core.search.matching.MatchLocator.getBinaryInfo(MatchLocator.java:767)
        at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process(MatchLocator.java:1504)
        at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1020)
        at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1061)
        at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1168)
        at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(JavaSearchParticipant.java:94)
        at org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(BasicSearchEngine.java:217)
        at org.eclipse.jdt.internal.core.search.BasicSearchEngine.search(BasicSearchEngine.java:497)
        at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:550)
        at org.eclipse.jdt.internal.corext.callhierarchy.CallerMethodWrapper.findChildren(CallerMethodWrapper.java:77)
        at org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper.performSearch(MethodWrapper.java:264)
        at org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper.doFindChildren(MethodWrapper.java:205)
        at org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper.getCalls(MethodWrapper.java:82)
        at org.eclipse.jdt.internal.ui.callhierarchy.DeferredMethodWrapper.getCalls(DeferredMethodWrapper.java:60)
        at org.eclipse.jdt.internal.ui.callhierarchy.DeferredMethodWrapper.fetchDeferredChildren(DeferredMethodWrapper.java:74)
        at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:196)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!SUBENTRY 1 org.eclipse.core.resources 4 368 2007-08-15 17:36:31.444
!MESSAGE Resource '/Cloudscape/cs.jar/com/ibm/db2cs/aq/c.class' does not exist.
Comment 1 Frederic Fusier CLA 2007-08-15 12:42:48 EDT
It's a regression introduced by fix for bug 138184. While indexing the separator is stored in Index but not in index file hence while reading existing file the default separator '/' is used and break indexing for all jar files!
Comment 2 Frederic Fusier CLA 2007-08-15 13:22:33 EDT
This problem does not occur on the first time eclipse is launched on a workspace, but only if eclipse is launched twice or more on this workspace...

The first time eclipse is launched, all index files are rebuild and Search works properly in this session. This explains why all our tests were green... All further launch of eclipse on this workspace will not rebuild the indexes which are not correct and so Search will stop to work properly in these further sessions...

So, when this happen, the workaround is to close the session and clean all index files in .metadata/.plugins/org/eclipse.jdt.core directory. This will force a rebuild while restarting the next eclipse session on this workspace and put back Search to work correctly.
Comment 3 Frederic Fusier CLA 2007-08-15 15:34:43 EDT
Created attachment 76153 [details]
Proposed patch
Comment 4 Frederic Fusier CLA 2007-08-15 15:35:16 EDT
Released for 3.4M2 in HEAD stream.
Comment 5 Eric Jodet CLA 2007-09-18 03:01:21 EDT
(In reply to comment #4)
Verified for 3.4 M2 using build I20070917-0010.