diff options
4 files changed, 9 insertions, 72 deletions
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/P2InfUtils.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/P2InfUtils.java index f366ce4e..37dfea98 100644 --- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/P2InfUtils.java +++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/P2InfUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 IBM Corporation and others. All rights reserved. + * Copyright (c) 2009 IBM Corporation and others. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html @@ -92,7 +92,7 @@ public class P2InfUtils { } public static void printRequires(StringBuffer buffer, String prefix, int i, String namespace, String name, VersionRange range, String filter, boolean greedy) { - printRequires(buffer, prefix, i, namespace, name, Utils.toString(range), filter, greedy); + printRequires(buffer, prefix, i, namespace, name, range.toString(), filter, greedy); } public static void printRequires(StringBuffer buffer, String prefix, int i, String namespace, String name, String range, String filter, boolean greedy) { @@ -118,7 +118,7 @@ public class P2InfUtils { prefix = ""; //$NON-NLS-1$ buffer.append(prefix + "hostRequirements." + i + ".namespace=" + namespace + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ buffer.append(prefix + "hostRequirements." + i + ".name=" + name + '\n'); //$NON-NLS-1$ //$NON-NLS-2$ - buffer.append(prefix + "hostRequirements." + i + ".range=" + Utils.toString(range) + '\n'); //$NON-NLS-1$ //$NON-NLS-2$ + buffer.append(prefix + "hostRequirements." + i + ".range=" + range.toString() + '\n'); //$NON-NLS-1$ //$NON-NLS-2$ buffer.append(prefix + "hostRequirements." + i + ".greedy=" + Boolean.toString(greedy) + '\n'); //$NON-NLS-1$ //$NON-NLS-2$ } diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ProductGenerator.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ProductGenerator.java index aed86da5..fc89d736 100644 --- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ProductGenerator.java +++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/ProductGenerator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2012 IBM Corporation and others. + * Copyright (c) 2006, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -199,7 +199,7 @@ public class ProductGenerator extends AbstractScriptGenerator { productVersionString = productVersion.getMajor() + "." + productVersion.getMinor() + "." + productVersion.getMicro() + ".$qualifier$"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ productRangeString = "[" + productVersionString + "," + productVersionString + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } else { - productRangeString = Utils.toString(new VersionRange(new Version(productVersionString), true, new Version(productVersionString), true)); + productRangeString = new VersionRange(new Version(productVersionString), true, new Version(productVersionString), true).toString(); } if (cus) { @@ -256,7 +256,7 @@ public class ProductGenerator extends AbstractScriptGenerator { //in case of no version on the product, the branding defaults to the version of the launcher provider if (executableFeature != null && productVersionString.equals(Version.emptyVersion.toString())) { String brandedVersion = executableFeature.getVersion(); - brandedRange = Utils.toString(new VersionRange(new Version(brandedVersion), true, new Version(brandedVersion), true)); + brandedRange = new VersionRange(new Version(brandedVersion), true, new Version(brandedVersion), true).toString(); } List configs = getConfigInfos(); diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/Utils.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/Utils.java index e3bf801e..ed1bf91b 100644 --- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/Utils.java +++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/Utils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -1050,67 +1050,4 @@ public final class Utils implements IPDEBuildConstants, IBuildPropertiesConstant } return result.toString(); } - - static public String toString(VersionRange range) { - // never qualify for now since p2 does not support fully qualified versions with empty qualifiers - return toString(range, false); - } - - private static String toString(VersionRange range, boolean qualify) { - // Do not use the VersionRange.toString method because it will fully qualify the versions - Version left = range.getLeft(); - Version right = range.getRight(); - String leftVersion = left.toString(); - if (right == null) { - return toString(left, range.getLeftType(), qualify); - } - String rightVerion = right.toString(); - StringBuffer result = new StringBuffer(leftVersion.length() + rightVerion.length() + 5); - result.append(range.getLeftType()); - result.append(toString(left, range.getLeftType(), qualify)); - result.append(','); - result.append(toString(right, range.getRightType(), qualify)); - result.append(range.getRightType()); - return result.toString(); - } - - private static String toString(Version version, char endPointType, boolean qualify) { - // need to avoid fully qualifying the versions if not needed. - if (version == null) - return ""; //$NON-NLS-1$ - int q = version.getQualifier().length(); - if (q > 0) { - return version.toString(); - } - StringBuffer buffer = new StringBuffer(version.toString().length() + 1); - buffer.append(version.getMajor()); - buffer.append('.'); - buffer.append(version.getMinor()); - buffer.append('.'); - buffer.append(version.getMicro()); - if (!qualify) // we never want to qualify in this case - return buffer.toString(); - char separator = version.isReleaseVersion() ? '.' : '-'; - switch (endPointType) { - case VersionRange.LEFT_CLOSED : - if (separator == '.') // left release version [x.y.z. must fully qualify - buffer.append(separator); - break; - case VersionRange.LEFT_OPEN : - if (separator == '-') // left pre-release version [x.y.z- must fully qualify - buffer.append(separator); - break; - case VersionRange.RIGHT_CLOSED : - if (separator == '-') // right release version x.y.z.) must fully qualify - buffer.append(separator); - break; - case VersionRange.RIGHT_OPEN : - if (separator == '.') // right pre-release version x.y.z-] must fully qualify - buffer.append(separator); - break; - default : - break; - } - return buffer.toString(); - } } diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/BuildTimeSite.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/BuildTimeSite.java index c5f6d20a..7c0ffdc3 100644 --- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/BuildTimeSite.java +++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/BuildTimeSite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -280,7 +280,7 @@ public class BuildTimeSite /*extends Site*/implements IPDEBuildConstants, IXMLCo VersionRange versionSpec = constraint.getVersionRange(); if (versionSpec == null) return constraint.getName(); - return constraint.getName() + '_' + Utils.toString(versionSpec); + return constraint.getName() + '_' + versionSpec; } public BuildTimeFeature findFeature(String featureId, String versionId, boolean throwsException) throws CoreException { |