Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 99093 Details for
Bug 222284
[search] ZipException while searching if linked jar doesn't exist any longer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
v01.txt (text/plain), 4.00 KB, created by
Frederic Fusier
on 2008-05-07 10:58:54 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2008-05-07 10:58:54 EDT
Size:
4.00 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java,v >retrieving revision 1.150 >diff -u -r1.150 JavaSearchBugsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 7 May 2008 11:36:44 -0000 1.150 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 7 May 2008 14:46:35 -0000 >@@ -17,6 +17,8 @@ > > import junit.framework.Test; > >+import org.eclipse.core.resources.IFile; >+import org.eclipse.core.resources.IResource; > import org.eclipse.core.resources.IncrementalProjectBuilder; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IPath; >@@ -10003,6 +10005,53 @@ > } > > /** >+ * @bug 222284: [search] ZipException while searching if linked jar doesn't exist any longer >+ * @test Ensure that no exception is raised while searching for a type of the missing jar file >+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=222284" >+ */ >+public void testBug222284() throws Exception { >+ String jarName = "lib222284.jar"; >+ String jarPath = getExternalPath()+jarName; >+ IFile jarFile = JAVA_PROJECT.getProject().getFile(jarName); >+ try { >+ // Create jar and add it to JavaSearchBugs project build path >+ String[] pathsAndContents = new String[] { >+ "pack/Ref.java", >+ "package pack;\n" + >+ "public class Ref {\n" + >+ "}", >+ }; >+ createJar(pathsAndContents, jarPath); >+ jarFile.createLink(new Path(jarPath), IResource.NONE, null); >+ addLibraryEntry(JAVA_PROJECT, "/JavaSearchBugs/lib222284.jar", null); >+ >+ // Create file and wait for indexes >+ createFile("/JavaSearchBugs/src/Test.java", >+ "import pack.Ref;" + >+ "public class Test {\n" + >+ " Ref ref;" + >+ "}\n" >+ ); >+ waitUntilIndexesReady(); >+ >+ // Exit, delete jar and restart >+ simulateExit(); >+ deleteExternalResource(jarName); >+ simulateRestart(); >+ >+ // Search for references to a class of deleted jar file, expect no result >+ search("pack.Ref", TYPE, REFERENCES); >+ assertSearchResults( >+ "src/Test.java [Ref] POTENTIAL_MATCH\n" + >+ "src/Test.java Test.ref [Ref] POTENTIAL_MATCH" >+ ); >+ } finally { >+ deleteResource(jarFile); >+ removeClasspathEntry(JAVA_PROJECT, new Path(jarPath)); >+ } >+} >+ >+/** > * @bug 228464: Annotation.getMemberValuePairs() empty for single attribute with empty value > * @test Ensure that annotation are correctly recovered > * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=228464" >#P org.eclipse.jdt.core >Index: search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java,v >retrieving revision 1.314 >diff -u -r1.314 MatchLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 7 May 2008 11:06:16 -0000 1.314 >+++ search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 7 May 2008 14:46:36 -0000 >@@ -1566,10 +1566,16 @@ > if (unit.isEmpty()) { > if (this.currentPossibleMatch.openable instanceof ClassFile) { > ClassFile classFile = (ClassFile) this.currentPossibleMatch.openable; >- IBinaryType info = getBinaryInfo(classFile, classFile.resource()); >+ IBinaryType info = null; >+ try { >+ info = getBinaryInfo(classFile, classFile.resource()); >+ } >+ catch (CoreException ce) { >+ // Do nothing >+ } > if (info != null) { > boolean mayBeGeneric = this.patternLocator.mayBeGeneric; >- this.patternLocator.mayBeGeneric = false; // there's no longer generics in class files >+ this.patternLocator.mayBeGeneric = false; // there's no longer generic in class files > try { > new ClassFileMatchLocator().locateMatches(this, classFile, info); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 222284
:
98878
| 99093