Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354557 - [Regression] ExternalLibraryCache causes false classpath problem markers.
Summary: [Regression] ExternalLibraryCache causes false classpath problem markers.
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on: 348035
Blocks:
  Show dependency tree
 
Reported: 2011-08-11 17:11 EDT by Curtis Windatt CLA
Modified: 2011-08-25 17:19 EDT (History)
7 users (show)

See Also:
ankur_sharma: review+
daniel_megert: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Windatt CLA 2011-08-11 17:11:35 EDT
+++ This bug was initially created as a clone of Bug #348035 +++

Cloned for releasing to 3.7.1

There is a regression in the recent fix for Bug 147831 which causes false classpath problem markers... 
"Archive for required library: 'C:/indigo/devWorkspace/.metadata/.plugins/org.eclipse.pde.core/.external_libraries/oracle.eclipse.tools.common.templating_4.1.0.201105211528/build/xmlbeans' in project 'oracle.eclipse.tools.weblogic' cannot be read or is not a valid ZIP file."


To reproduce, import a plugin which has a dependency on another plugin that has a bundle classpath that includes a directory name as well as the bundle itself, '.'. The marker requires that the classpath error is fixed before you can compile the 

The ExternalLibraryCache for the ExternalModelManager creates an external library classpath entry to an empty file in PDE's metadata location for a directory listed in a bundle's classPath.

A Bundle classpath can contain the name of a directory, a resource or the bundle itself. The routine ExternalLibraryCache.getExtractedLibraries() checks for the "." entry for the bundle itself, then tries to extract a jar for the other entries on the bundle's classpath. For a jar file, that works fine (Bug 147831). However, if the entry is a directory, there is still a call to extractJar() which ends up creating an empty file in the PDE metadata location AND adds the empty file as an extracted lib.

When ClasspathValidation.validate() is executed in JDT, the entry for this empty file causes a failure. JavaModelManager.getZipFile() cannot read the empty file, throwing an IOException which eventually causes JDT to record a marker for a classpath problem.

Seems like ExternalLibraryCache.getExtractedLibraries() should check if the ZipEntry is not a directory (at least until there's support for directory entries in the bundle classpath).
Comment 1 Curtis Windatt CLA 2011-08-11 17:14:48 EDT
Released to 3.7.1
Comment 2 Curtis Windatt CLA 2011-08-17 09:43:30 EDT
As per http://www.eclipse.org/eclipse/development/plans/freeze_plan_3_7_1.php
this bug needs a review+ on the patch from another committer and a review+ from
a component lead to be committed into 3.7.1.

Dani and Ankur, please review.
Comment 3 Ankur Sharma CLA 2011-08-17 14:36:41 EDT
+1
Comment 4 Curtis Windatt CLA 2011-08-18 17:16:58 EDT
Fix is released for 3.7.1.  Ankur's review satisfies the SR1 freeze requirements.
Comment 5 Curtis Windatt CLA 2011-08-25 17:19:57 EDT
Verified M20110825-0847