Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 338747
Collapse All | Expand All

(-)src/org/eclipse/b3/aggregator/p2view/IUPresentation.java (-9 / +13 lines)
Lines 1-5 Link Here
1
/**
1
/**
2
 * Copyright (c) 2006-2009, Cloudsmith Inc.
2
 * Copyright (c) 2006-2011, Cloudsmith Inc.
3
 * The code, documentation and other materials contained herein have been
3
 * The code, documentation and other materials contained herein have been
4
 * licensed under the Eclipse Public License - v 1.0 by the copyright holder
4
 * licensed under the Eclipse Public License - v 1.0 by the copyright holder
5
 * listed above, as the Initial Contributor under such license. The text of
5
 * listed above, as the Initial Contributor under such license. The text of
Lines 12-18 Link Here
12
import java.util.Comparator;
12
import java.util.Comparator;
13
13
14
import org.eclipse.b3.aggregator.InstallableUnitType;
14
import org.eclipse.b3.aggregator.InstallableUnitType;
15
import org.eclipse.b3.p2.util.IUSelectionComparator;
16
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
15
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
17
import org.eclipse.equinox.p2.metadata.Version;
16
import org.eclipse.equinox.p2.metadata.Version;
18
17
Lines 38-55 Link Here
38
 * @generated
37
 * @generated
39
 */
38
 */
40
public interface IUPresentation {
39
public interface IUPresentation {
41
	// Compares IU presentation by id (ascending) and version (descending)
40
	// Compares IU presentation by label
42
	static class IUPresentationComparator implements Comparator<IUPresentation> {
41
	static class IUPresentationComparator implements Comparator<IUPresentation> {
43
42
44
		public int compare(IUPresentation iup1, IUPresentation iup2) {
43
		public int compare(IUPresentation iup1, IUPresentation iup2) {
45
			IInstallableUnit iu1 = iup1 != null
44
			String label1 = iup1 != null
46
					? iup1.getInstallableUnit()
45
					? iup1.getLabel()
47
					: null;
46
					: null;
48
			IInstallableUnit iu2 = iup2 != null
47
			String label2 = iup2 != null
49
					? iup2.getInstallableUnit()
48
					? iup2.getLabel()
50
					: null;
49
					: null;
51
50
			return label1 != null
52
			return IUSelectionComparator.INSTANCE.compare(iu1, iu2);
51
					? (label2 == null
52
							? 1
53
							: label1.compareTo(label2))
54
					: (label2 != null
55
							? -1
56
							: 0);
53
		}
57
		}
54
	}
58
	}
55
59

Return to bug 338747