Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2010-03-08 18:40:06 +0000
committerPascal Rapicault2010-03-08 18:40:06 +0000
commit0ad884af4592f26894833393b189059827e7f3dd (patch)
tree91b5bb98ddad17a9d53d2d94800548ed970c1f8e /bundles/org.eclipse.equinox.p2.repository.tools
parentd9cdee703e22ad33228f67793ba8a5c3c8a77f50 (diff)
downloadrt.equinox.p2-0ad884af4592f26894833393b189059827e7f3dd.tar.gz
rt.equinox.p2-0ad884af4592f26894833393b189059827e7f3dd.tar.xz
rt.equinox.p2-0ad884af4592f26894833393b189059827e7f3dd.zip
Bug 305031 - Remove reference to the org.osgi.Version type from the Version class
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository.tools')
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/VersionAnalyzer.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/VersionAnalyzer.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/VersionAnalyzer.java
index 81a90bdc7..a43a10601 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/VersionAnalyzer.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/VersionAnalyzer.java
@@ -9,9 +9,8 @@
******************************************************************************/
package org.eclipse.equinox.p2.internal.repository.tools.analyzer;
-import org.eclipse.equinox.p2.metadata.Version;
-
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.tools.analyzer.IUAnalyzer;
@@ -28,7 +27,7 @@ public class VersionAnalyzer extends IUAnalyzer {
return;
}
if (iu.getVersion().isOSGiCompatible()) {
- String qualifier = Version.toOSGiVersion(iu.getVersion()).getQualifier();
+ String qualifier = toOSGiVersion(iu.getVersion()).getQualifier();
if (qualifier != null && qualifier.equals("qualifier")) {
error(iu, "[ERROR] IU: " + iu.getId() + " has not replaced its qualifiier");
return;
@@ -36,6 +35,17 @@ public class VersionAnalyzer extends IUAnalyzer {
}
}
+ private static org.osgi.framework.Version toOSGiVersion(Version version) {
+ if (version == null)
+ return null;
+ if (version == Version.emptyVersion)
+ return org.osgi.framework.Version.emptyVersion;
+ if (version == Version.MAX_VERSION)
+ return new org.osgi.framework.Version(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE);
+
+ return new org.osgi.framework.Version(version.toString());
+ }
+
public void preAnalysis(IMetadataRepository repo) {
// Do nothing
}

Back to the top