Summary: | JAR with invalid Class-Path entry in MANIFEST.MF crashes the project | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Jay Arthanareeswaran <jarthana> | ||||||||
Component: | Core | Assignee: | Jay Arthanareeswaran <jarthana> | ||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||
Severity: | normal | ||||||||||
Priority: | P3 | CC: | amj87.iitr, eclipse, srikanth_sankaran | ||||||||
Version: | 3.6 | ||||||||||
Target Milestone: | 3.6 M7 | ||||||||||
Hardware: | PC | ||||||||||
OS: | Windows XP | ||||||||||
Whiteboard: | |||||||||||
Attachments: |
|
Description
Jay Arthanareeswaran
2010-04-06 03:05:28 EDT
Created attachment 163892 [details]
Proposed Patch
Fix addresses cases where the referenced library entry is invalid or has zero segments. Tests added in ClasspathTests#testBug308150()
Created attachment 163990 [details]
Updated patch
Fixed an error with the previous patch.
Released in HEAD for 3.6M7. Just came across a related issue. In the above steps to reproduce, I omit step 2 and 3, and use "add external jars" to add the baddie.jar from my downloads folder directly into the classpath, and hit OK - I get the following error message - "Setting build path has encountered a problem" 'C:\Documents and Settings\Administrator' is not a valid location for linked resources. Now, I can see baddie.jar added to the referenced libraries of my project. But checking out the build path or .classpath, I cannot find baddie.jar. This means that even though Eclipse has removed it, the referenced libraries is still showing it. Again, I go to build path -> add external jars and again add baddie.jar. This fails via an exception eclipse.buildId=I20100424-2000 java.version=1.6.0_17 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Command-line arguments: -os win32 -ws win32 -arch x86 Exception while updating external folders org.eclipse.core.internal.resources.ResourceException: 'C:\Documents and Settings\Administrator' is not a valid location for linked resources. at org.eclipse.core.internal.resources.Resource.assertLinkRequirements(Resource.java:166) at org.eclipse.core.internal.resources.Resource.createLink(Resource.java:655) at org.eclipse.core.internal.resources.Resource.createLink(Resource.java:629) at org.eclipse.jdt.internal.core.ExternalFoldersManager.createLinkFolder(ExternalFoldersManager.java:113) at org.eclipse.jdt.internal.core.ExternalFolderChange.updateExternalFoldersIfNecessary(ExternalFolderChange.java:47) at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:1981) at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:470) at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:291) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285) at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149) at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:311) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:136) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) After this if i go the build path I can see baddie.jar added there and can remove it. But all this seems a bit ambiguous. Jay, can you clarify? Raised bug 310764 as a follow up for comment 4. Verified for 3.6M7 using build I20100424-2000. Verified. |