Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2017-04-06 21:30:04 +0000
committerKarsten Thoms2017-06-27 08:09:46 +0000
commitff12ff963d3657c29884b15baa1f105c8a09ac77 (patch)
tree18ddbb6b9b6f80a98598846e55ce8577f466c0aa /bundles/org.eclipse.equinox.p2.publisher.eclipse
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.publisher.eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/FeatureManifestParser.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java7
2 files changed, 5 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/FeatureManifestParser.java b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/FeatureManifestParser.java
index 955bf2ff1..30fa51335 100644
--- a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/FeatureManifestParser.java
+++ b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/FeatureManifestParser.java
@@ -189,7 +189,7 @@ public class FeatureManifestParser extends DefaultHandler {
String versionStr = attributes.getValue("version"); //$NON-NLS-1$
FeatureEntry entry = null;
if ("versionRange".equals(attributes.getValue("match"))) { //$NON-NLS-1$//$NON-NLS-2$
- VersionRange versionRange = new VersionRange(versionStr);
+ VersionRange versionRange = VersionRange.create(versionStr);
entry = FeatureEntry.createRequires(id, versionRange, attributes.getValue("match"), attributes.getValue("filter"), isPlugin); //$NON-NLS-1$ //$NON-NLS-2$
} else {
entry = FeatureEntry.createRequires(id, versionStr, attributes.getValue("match"), attributes.getValue("filter"), isPlugin); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java
index 6bda1aeea..d5cf86b02 100644
--- a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java
+++ b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java
@@ -16,8 +16,9 @@ import java.net.URISyntaxException;
import java.util.*;
import java.util.Map.Entry;
import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.p2.core.helpers.*;
+import org.eclipse.equinox.internal.p2.core.helpers.FileUtils;
import org.eclipse.equinox.internal.p2.core.helpers.FileUtils.IPathComputer;
+import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
import org.eclipse.equinox.internal.p2.metadata.InstallableUnit;
import org.eclipse.equinox.internal.p2.publisher.FileSetDescriptor;
@@ -560,7 +561,7 @@ public class FeaturesAction extends AbstractPublisherAction {
return VersionRange.emptyRange;
String match = entry.getMatch();
if ("versionRange".equals(match)) //$NON-NLS-1$
- return new VersionRange(versionSpec);
+ return VersionRange.create(versionSpec);
Version version = Version.parseVersion(versionSpec);
if (version.equals(Version.emptyVersion))
return VersionRange.emptyRange;
@@ -582,7 +583,7 @@ public class FeaturesAction extends AbstractPublisherAction {
return new VersionRange(version, true, upper, false);
}
if (match.equals("greaterOrEqual")) //$NON-NLS-1$
- return new VersionRange(version, true, new VersionRange(null).getMaximum(), true);
+ return new VersionRange(version, true, VersionRange.create(null).getMaximum(), true);
return null;
}

Back to the top