diff options
author | Susan Franklin | 2009-04-29 22:07:39 +0000 |
---|---|---|
committer | Susan Franklin | 2009-04-29 22:07:39 +0000 |
commit | d6b5b26d5760c1cc7fa9a354f894f79a98e1a073 (patch) | |
tree | 807097448c7114498df3ead8c224b71fbbaa7af4 /bundles/org.eclipse.equinox.p2.ui | |
parent | 104eb7ce3d97c720ab6c71e64f07ce26ea1b7abf (diff) | |
download | rt.equinox.p2-d6b5b26d5760c1cc7fa9a354f894f79a98e1a073.tar.gz rt.equinox.p2-d6b5b26d5760c1cc7fa9a354f894f79a98e1a073.tar.xz rt.equinox.p2-d6b5b26d5760c1cc7fa9a354f894f79a98e1a073.zip |
Bug 273966 - [ui] Invalid plan created when an update and a patch are available at the same time
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableUpdateElement.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableUpdateElement.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableUpdateElement.java index e1b84efbe..2cb4c9cc6 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableUpdateElement.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableUpdateElement.java @@ -46,4 +46,27 @@ public class AvailableUpdateElement extends AvailableIUElement { request.addInstallableUnits(new IInstallableUnit[] {getIU()}); return ProvisioningUtil.getProvisioningPlan(request, new ProvisioningContext(), monitor); } + + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (!(obj instanceof AvailableUpdateElement)) + return false; + if (iu == null) + return false; + if (iuToBeUpdated == null) + return false; + AvailableUpdateElement other = (AvailableUpdateElement) obj; + return iu.equals(other.getIU()) && iuToBeUpdated.equals(other.getIUToBeUpdated()); + } + + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((iu == null) ? 0 : iu.hashCode()); + result = prime * result + ((iuToBeUpdated == null) ? 0 : iuToBeUpdated.hashCode()); + return result; + } } |