Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2017-07-03 03:21:26 -0400
committerKarsten Thoms2018-03-09 15:04:17 -0500
commit5a00dcccfbbe404bca8c620b2fbe45304f611d6f (patch)
tree7fc5aabb581d2228b58eb53e242e3bc2315d0d3c /bundles/org.eclipse.equinox.p2.core
parentac7a5b7a66b44e27bcc9a9b0d5db3a3fd76e496f (diff)
downloadrt.equinox.p2-5a00dcccfbbe404bca8c620b2fbe45304f611d6f.tar.gz
rt.equinox.p2-5a00dcccfbbe404bca8c620b2fbe45304f611d6f.tar.xz
rt.equinox.p2-5a00dcccfbbe404bca8c620b2fbe45304f611d6f.zip
Bug 519085 Reduced memory consumption of SimpleArtifactDescriptorI20180312-2000I20180311-2000I20180310-1500I20180309-2000
Also of OrderedProperties by interning keys. Change-Id: Ic86797dd633b0537e99d86aad89de26f1c80e497 Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.core')
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java
index f41cc5ce5..81ad8c7f8 100644
--- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java
@@ -43,6 +43,12 @@ public class OrderedProperties extends Dictionary<String, String> implements Map
propertyMap = new LinkedHashMap<>(size);
}
+ public OrderedProperties(Map<String, String> properties) {
+ super();
+ propertyMap = new LinkedHashMap<>(properties.size());
+ putAll(properties);
+ }
+
/**
* Set the property value.
* <p>
@@ -57,7 +63,7 @@ public class OrderedProperties extends Dictionary<String, String> implements Map
*/
public Object setProperty(String key, String value) {
init();
- return propertyMap.put(key, value);
+ return propertyMap.put(key.intern(), value);
}
public String getProperty(String key) {
@@ -91,7 +97,7 @@ public class OrderedProperties extends Dictionary<String, String> implements Map
@Override
public String put(String key, String value) {
init();
- return propertyMap.put(key, value);
+ return propertyMap.put(key.intern(), value);
}
@Override

Back to the top