Bug 222284 - [search] ZipException while searching if linked jar doesn't exist any longer
Summary: [search] ZipException while searching if linked jar doesn't exist any longer
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 RC1   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-11 14:15 EDT by Jerome Lanneluc CLA
Modified: 2008-05-13 10:19 EDT (History)
1 user (show)

See Also:
jerome_lanneluc: review+


Attachments
Regression test case (2.86 KB, patch)
2008-05-06 12:12 EDT, Frederic Fusier CLA
no flags Details | Diff
Proposed patch (4.00 KB, patch)
2008-05-07 10:58 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 Jerome Lanneluc CLA 2008-03-11 14:15:17 EDT
I20080305-1100

1. Create a linked file to an existing .jar outside the workspace
2. Add the linked file to the build path of the project
3. Shutdown
4. Delete the .jar on the file system
5. Restart
6. Search for a reference that you know existed in the .jar
Observe: You get an error dialog with a ZipException

!ENTRY org.eclipse.jdt.core 4 -1 2008-03-11 17:07:13.875
!MESSAGE I/O exception
!STACK 0
java.util.zip.ZipException: The system cannot find the file specified
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(ZipFile.java:203)
	at java.util.zip.ZipFile.<init>(ZipFile.java:234)
	at org.eclipse.jdt.internal.core.JavaModelManager.getZipFile(JavaModelManager.java:2149)
	at org.eclipse.jdt.internal.core.JarPackageFragmentRoot.getJar(JarPackageFragmentRoot.java:143)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.getBinaryInfo(MatchLocator.java:770)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process(MatchLocator.java:1562)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1036)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1077)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1194)
	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:500)
	at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:550)
	at org.eclipse.jdt.internal.ui.search.JavaSearchQuery.run(JavaSearchQuery.java:143)
	at org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:94)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Frederic Fusier CLA 2008-05-06 12:12:23 EDT
Created attachment 98878 [details]
Regression test case
Comment 2 Frederic Fusier CLA 2008-05-07 10:58:54 EDT
Created attachment 99093 [details]
Proposed patch
Comment 3 Frederic Fusier CLA 2008-05-07 10:59:43 EDT
Jerome, could you please review?
Comment 4 Jerome Lanneluc CLA 2008-05-07 12:22:00 EDT
Patch looks good
Comment 5 Frederic Fusier CLA 2008-05-07 13:59:20 EDT
Released for 3.4RC1 in HEAD stream.
Comment 6 Eric Jodet CLA 2008-05-13 10:19:10 EDT
Verified for 3.4RC1 using build I20080510-2000.