Summary: | DefaultBundleReader unzips the same dependency several times | ||||||
---|---|---|---|---|---|---|---|
Product: | z_Archived | Reporter: | Anthony Dahanne <anthony.dahanne> | ||||
Component: | Tycho | Assignee: | Jan Sievers <jan.sievers> | ||||
Status: | RESOLVED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | jan.sievers, mn, sebastien.angers | ||||
Version: | unspecified | Keywords: | performance | ||||
Target Milestone: | --- | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Anthony Dahanne
2011-07-23 00:02:51 EDT
your suggestion makes sense. The only case I can imagine where the optimization fails is if there are overlapping classpath entries of type directory, e.g. Bundle-ClassPath: lib/lib.jar, lib/ If we extracted lib/lib.jar we will not extract lib/ recursively because the directory already exists... Created attachment 200293 [details]
fix to extract only once each nestedjar
Jan,
you're right that this solution (checking the directory exists) is not valid; even more because the unArchiver extracts from the bundle just the required lib;so if you have
Bundle-ClassPath: lib/lib.jar, lib/lib2.jar
then the first call to
zipUnArchiver.extract(path, outputDirectory);
just extracts lib.jar but not lib2.jar ...
I just orignally thought that zipUnArchiver was extracting the whole jar each time.
So, the enhancement could be just about extracting those libs once (not for every module in the reactor that needs it)
I added a patch, please tell me if you think this is acceptable.
(In reply to comment #2) > I added a patch, please tell me if you think this is acceptable. your patch has no tests to prove it works and it introdues the bug I described in comment#1. commit 0bf42ea85b5 implements an extraction cache that handles both nested dirs and jars properly. Hello Jan, Thanks for reviewing my patch and committing an enhanced version + tests. |