Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2011-02-16 22:17:33 +0000
committerThomas Watson2011-02-16 22:17:33 +0000
commitf9a44167d85fb65d48bb5acc5337e7ab23e5f9f2 (patch)
treedeb57e6bcf0e6245a39bbd05113dbd746cf7f49b /bundles/org.eclipse.osgi/resolver
parent16d34118868cb761648505affc81265d63d0e570 (diff)
downloadrt.equinox.framework-f9a44167d85fb65d48bb5acc5337e7ab23e5f9f2.tar.gz
rt.equinox.framework-f9a44167d85fb65d48bb5acc5337e7ab23e5f9f2.tar.xz
rt.equinox.framework-f9a44167d85fb65d48bb5acc5337e7ab23e5f9f2.zip
Bug 335279 - Performance: StateHelperImpl: creating of map/set with initial capacity causes resizing
Diffstat (limited to 'bundles/org.eclipse.osgi/resolver')
-rw-r--r--bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateHelperImpl.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateHelperImpl.java b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateHelperImpl.java
index 131d7dd67..5f57914c9 100644
--- a/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateHelperImpl.java
+++ b/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateHelperImpl.java
@@ -73,7 +73,7 @@ public final class StateHelperImpl implements StateHelper {
}
private Map<String, List<ExportPackageDescription>> getExportedPackageMap(State state) {
- Map<String, List<ExportPackageDescription>> result = new HashMap<String, List<ExportPackageDescription>>(11);
+ Map<String, List<ExportPackageDescription>> result = new HashMap<String, List<ExportPackageDescription>>();
BundleDescription[] bundles = state.getBundles();
for (int i = 0; i < bundles.length; i++) {
ExportPackageDescription[] packages = bundles[i].getExportPackages();
@@ -81,7 +81,7 @@ public final class StateHelperImpl implements StateHelper {
ExportPackageDescription description = packages[j];
List<ExportPackageDescription> exports = result.get(description.getName());
if (exports == null) {
- exports = new ArrayList<ExportPackageDescription>(1);
+ exports = new ArrayList<ExportPackageDescription>();
result.put(description.getName(), exports);
}
exports.add(description);
@@ -91,7 +91,7 @@ public final class StateHelperImpl implements StateHelper {
}
private Map<String, List<GenericDescription>> getGenericsMap(State state, boolean resolved) {
- Map<String, List<GenericDescription>> result = new HashMap<String, List<GenericDescription>>(11);
+ Map<String, List<GenericDescription>> result = new HashMap<String, List<GenericDescription>>();
BundleDescription[] bundles = state.getBundles();
for (int i = 0; i < bundles.length; i++) {
if (resolved && !bundles[i].isResolved())
@@ -113,7 +113,7 @@ public final class StateHelperImpl implements StateHelper {
private VersionConstraint[] getUnsatisfiedLeaves(State state, BundleDescription[] bundles, ResolverHook hook) {
Map<String, List<ExportPackageDescription>> packages = getExportedPackageMap(state);
Map<String, List<GenericDescription>> generics = getGenericsMap(state, false);
- Set<VersionConstraint> result = new HashSet<VersionConstraint>(11);
+ Set<VersionConstraint> result = new HashSet<VersionConstraint>();
List<BundleDescription> bundleList = new ArrayList<BundleDescription>(bundles.length);
for (int i = 0; i < bundles.length; i++)
bundleList.add(bundles[i]);

Back to the top