Community
Participate
Working Groups
0.203 In Java Search I was searching for the type "Differencer" in the Compare plugin. For the file CompilationUnitDelta.java I got 6 matches. When stepping through them the second match was bogus. Here is the relevant line of CompilationUnitDelta.java where the problem occured and the three matches: Differencer differencer= new Differencer() { 11111111111 22222222222 33333333333 I wasn't able to reproduce this problem with a standalone setup.
Created attachment 1 [details] Java file where the problem occurred
pls investigate whether this is the matchlocator or the UI
Searching the attached file works fine i.e. does not report the (wrong) match 22222222222.
Debugged on actual workspace (see http://www.zrh.oti.com/webprojects/jabiru2000/testing/EclipseWorkspace_4368.zip) with breakpoint in: JavaSearchResultCollector.accept(...). 1.Match: OK start= 3886 end= 3897 enclosingElement= SourceMethod (id=3128) fLEType= 9 fName= "CompilationUnitDelta" fOccurrenceCount= 1 fParameterTypes= String[2] (id=3131) fParent= SourceType (id=3132) accuracy= 0 2. Match (NOT OK) start= 3887 end= 3898 enclosingElement= SourceMethod (id=3133) fLEType= 9 fName= "CompilationUnitDelta" fOccurrenceCount= 1 fParameterTypes= String[2] (id=3136) fParent= SourceType (id=3132) accuracy= 1 This 2nd match is reported as POTENTIAL match but it rather looks like search engine bug: why should "ifferencer " be a potential match? Maybe it is an indexer problem but please note that I could reproduce the bug with a completely new workspace (see http://www.zrh.oti.com/webprojects/jabiru2000/testing/EclipseWorkspace_4368.zip) . Moving to JDT Core
Downloaded EclipseWorkspace_4368.zip. With 202a, I find 5 matches with correct positions in CompilationUnitDelta.java. With 203 I find no matches at all in CompilationUnitDelta.java (it seems that search was broken in this build.) With 205, I find 5 matches with correct positions in CompilationUnitDelta.java. With our latest, I also find 5 matches with correct positions in CompilationUnitDelta.java.
What's your 0.205 version? I used: jre-win32-Eclipse-SDK-SHIPPED-20011018.zip (aka 0.205) I did the following steps (again): 1. Extract EclipseWorkspace_4368.zip to: D:\ 2. Download http://home.ott.oti.com/hubba/drops/sdk/20011018/jre-win32-Eclipse-SDK-SHIPPED-2 0011018.zip 3. Extract jre-win32-Eclipse-SDK-SHIPPED-20011018.zip to D:\ 4. Open D:\eclipse 5. Create shortcut for eclipse.exe: Target: D:\eclipse\eclipse.exe -data d:\EclipseWorkspace_Bug\plugins 6. Double-click the shortcut 7. Open Search Dialog 8. Search for type refs of "Differencer" ==> I get 6 results
Followed exactly the above steps (except I didn't download again jre-win32- Eclipse-SDK-SHIPPED-20011018.zip as I already had it). After step 8, I got 80 matches in total, and CompilationUnitDelta had 5 matches.
Created attachment 14 [details] Here is a sreen copy that shows the search results
Adam has repeated the test and could not reproduce either, so it is not just on your side. I repeated the test on my machine once again (also using download) ==> bug still there I know that the WindowsNT WinZip version behaves different than the Windows2000. Ensure that eventually hidden files are also extracted. Could you test if all files are extracted (unzip the workspace again - they were changed). The properties of d:\EclipseWorkspace_Bug should be: 8486 files 940 directories 84192818 bytes Regional Settings: English (United States) Input Locale: German (Swiss)
When looking at the properties of EclipseWorkspace_Bug, I also have: 8486 files 940 directories 84192818 bytes For the regional settings, the difference is that I have English (United States) as the input locale.
André verified the bug on his machine and can't reproduce either. I guess the following could happen: Eclipse fixes / changes files (index?) when an existing workspace is started on another machine than the one which it was created. There was definitely a bug in the search/index infrastructure because André (Windows2000) and I (WindowsNT) have seen the bug. Ok to close if you don't have another idea where the bug could be.
This bug makes me think of bug "5021 Refactoring trashed my code" but I cannot be sure as I cannot reproduce the problem (even with a clean install). Bug 5021 was fixed in 206/20011025. Closing