Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2017-04-06 17:30:04 -0400
committerKarsten Thoms2017-06-27 04:09:46 -0400
commitff12ff963d3657c29884b15baa1f105c8a09ac77 (patch)
tree18ddbb6b9b6f80a98598846e55ce8577f466c0aa /bundles/org.eclipse.equinox.p2.engine/src
parentb1b14d5061eb7a9ae592fbd71a2437bfb5d86ba3 (diff)
downloadrt.equinox.p2-ff12ff963d3657c29884b15baa1f105c8a09ac77.tar.gz
rt.equinox.p2-ff12ff963d3657c29884b15baa1f105c8a09ac77.tar.xz
rt.equinox.p2-ff12ff963d3657c29884b15baa1f105c8a09ac77.zip
Bug 514885 Pooling Version and VersionRange
- Introduce weak object pool for Verson and VersionRange - Use VersionRange.create() for getting pooled instances - JavaDoc & check input for empty string Change-Id: Ie42bdc1059d8c667af312038c26c035a6ef674af Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.engine/src')
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstructionParser.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/TouchpointManager.java2
3 files changed, 3 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstructionParser.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstructionParser.java
index 2b9709d20..5aae66b40 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstructionParser.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstructionParser.java
@@ -62,7 +62,7 @@ public class InstructionParser {
while (actionTokenizer.hasMoreTokens()) {
String actionAttribute = actionTokenizer.nextToken().trim();
if (actionAttribute.startsWith(VERSION_EQUALS))
- actionVersionRange = new VersionRange(actionAttribute.substring(VERSION_EQUALS.length() + 1));
+ actionVersionRange = VersionRange.create(actionAttribute.substring(VERSION_EQUALS.length() + 1));
}
result.put(actionKey, new ActionEntry(actionId, actionVersionRange));
result.put(actionId, new ActionEntry(actionId, actionVersionRange));
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java
index 5e91fd6e0..e8ae44844 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java
@@ -643,7 +643,7 @@ public class SimpleProfileRegistry implements IProfileRegistry, IAgentService {
return false;
//check whether the profile contains the p2 engine from 3.5.0 or earlier
- return profile.available(QueryUtil.createIUQuery("org.eclipse.equinox.p2.engine", new VersionRange("[0.0.0, 1.0.101)")), null).isEmpty(); //$NON-NLS-1$//$NON-NLS-2$
+ return profile.available(QueryUtil.createIUQuery("org.eclipse.equinox.p2.engine", VersionRange.create("[0.0.0, 1.0.101)")), null).isEmpty(); //$NON-NLS-1$//$NON-NLS-2$
}
private void deleteProfile(String profileId) {
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/TouchpointManager.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/TouchpointManager.java
index 1775eeee5..bca1a6e8e 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/TouchpointManager.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/TouchpointManager.java
@@ -118,7 +118,7 @@ public class TouchpointManager implements IRegistryChangeListener {
if (entry == null)
return null;
if (versionRange != null) {
- VersionRange range = new VersionRange(versionRange);
+ VersionRange range = VersionRange.create(versionRange);
if (!range.isIncluded(entry.getVersion()))
return null;
}

Back to the top