Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2013-08-30 19:31:57 +0000
committerThomas Watson2013-08-30 20:23:18 +0000
commit0ba4188bc161ee52e2f8335dde7a33f9d1789333 (patch)
tree556b5e59758af94df6fab8b6d7fa6f35557480d9 /bundles
parent4af4881573f98cb0eab92922c6302908fd56b389 (diff)
downloadrt.equinox.framework-0ba4188bc161ee52e2f8335dde7a33f9d1789333.tar.gz
rt.equinox.framework-0ba4188bc161ee52e2f8335dde7a33f9d1789333.tar.xz
rt.equinox.framework-0ba4188bc161ee52e2f8335dde7a33f9d1789333.zip
Bug 416073 - Optimize Storage.listEntryPaths for wildcards and recursion.I20130903-0900I20130831-1500I20130830-2000
Minor tweaks: - Change PluginConverterHook to use getBundleFile() to avoid confusion on which bundle file it was using - Change ZipBundleFile to use LinkedHashSet to preserve order.
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.osgi.compatibility.plugins/src/org/eclipse/osgi/compatibility/plugins/PluginConverterHook.java6
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleFile.java8
2 files changed, 7 insertions, 7 deletions
diff --git a/bundles/org.eclipse.osgi.compatibility.plugins/src/org/eclipse/osgi/compatibility/plugins/PluginConverterHook.java b/bundles/org.eclipse.osgi.compatibility.plugins/src/org/eclipse/osgi/compatibility/plugins/PluginConverterHook.java
index b7fd91719..88dca675d 100644
--- a/bundles/org.eclipse.osgi.compatibility.plugins/src/org/eclipse/osgi/compatibility/plugins/PluginConverterHook.java
+++ b/bundles/org.eclipse.osgi.compatibility.plugins/src/org/eclipse/osgi/compatibility/plugins/PluginConverterHook.java
@@ -43,7 +43,7 @@ public class PluginConverterHook implements HookConfigurator {
hookRegistry.addBundleFileWrapperFactoryHook(new BundleFileWrapperFactoryHook() {
@Override
- public BundleFileWrapper wrapBundleFile(final BundleFile bundleFile, Generation generation, boolean base) {
+ public BundleFileWrapper wrapBundleFile(BundleFile bundleFile, Generation generation, boolean base) {
if (!base) {
return null;
}
@@ -51,7 +51,7 @@ public class PluginConverterHook implements HookConfigurator {
@Override
public BundleEntry getEntry(String path) {
- BundleEntry entry = bundleFile.getEntry(path);
+ BundleEntry entry = getBundleFile().getEntry(path);
if (!PluginConverterImpl.OSGI_BUNDLE_MANIFEST.equals(path)) {
return entry;
}
@@ -70,7 +70,7 @@ public class PluginConverterHook implements HookConfigurator {
}
}
try {
- File manifest = converter.convertManifest(bundleFile.getBaseFile(), null, true, null, true, null, false);
+ File manifest = converter.convertManifest(getBaseFile(), null, true, null, true, null, false);
if (manifest == null) {
return entry;
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleFile.java
index eb291d8bc..b810d96bd 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleFile.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleFile.java
@@ -269,7 +269,7 @@ public class ZipBundleFile extends BundleFile {
if (path.length() > 0 && path.charAt(path.length() - 1) != '/')
path = new StringBuilder(path).append("/").toString(); //$NON-NLS-1$
- Set<String> vEntries = new HashSet<String>();
+ LinkedHashSet<String> result = new LinkedHashSet<String>();
// Get all zip file entries and add the ones of interest.
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while (entries.hasMoreElements()) {
@@ -282,14 +282,14 @@ public class ZipBundleFile extends BundleFile {
// path, (2) a file under path, or (3) a subdirectory of path.
if (path.length() < entryPath.length()) {
// If we get here, we know that entry is not equal to path.
- getEntryPaths(path, entryPath.substring(path.length()), recurse, vEntries);
+ getEntryPaths(path, entryPath.substring(path.length()), recurse, result);
}
}
}
- return vEntries.size() == 0 ? null : Collections.enumeration(vEntries);
+ return result.size() == 0 ? null : Collections.enumeration(result);
}
- private void getEntryPaths(String path, String entry, boolean recurse, Set<String> entries) {
+ private void getEntryPaths(String path, String entry, boolean recurse, LinkedHashSet<String> entries) {
if (entry.length() == 0)
return;
int slash = entry.indexOf('/');

Back to the top