Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2010-01-05 18:35:02 +0000
committerAndrew Niefer2010-01-05 18:35:02 +0000
commit0d5feae3552aaef4b8200481f3165613ae754147 (patch)
tree1c3818dc0340b08baa07cbd750661faeb3a7cfd4
parent75de4dc7ba6e49d3f5da1a43f5e74c1d58e95aaa (diff)
downloadrt.equinox.p2-0d5feae3552aaef4b8200481f3165613ae754147.tar.gz
rt.equinox.p2-0d5feae3552aaef4b8200481f3165613ae754147.tar.xz
rt.equinox.p2-0d5feae3552aaef4b8200481f3165613ae754147.zip
bug 298047 - Artifact.equals breaks contract
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/spi/ArtifactDescriptor.java2
2 files changed, 3 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
index 233e49d05..a786bc666 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
@@ -395,7 +395,8 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
}
public synchronized boolean contains(IArtifactDescriptor descriptor) {
- return artifactDescriptors.contains(descriptor);
+ SimpleArtifactDescriptor simpleDescriptor = createInternalDescriptor(descriptor);
+ return artifactDescriptors.contains(simpleDescriptor);
}
public synchronized boolean contains(IArtifactKey key) {
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/spi/ArtifactDescriptor.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/spi/ArtifactDescriptor.java
index 3a5db5ae8..8f82ba1a0 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/spi/ArtifactDescriptor.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/spi/ArtifactDescriptor.java
@@ -95,7 +95,7 @@ public class ArtifactDescriptor implements IArtifactDescriptor {
return false;
// Other implementations of IArtifactDescriptor must not be considered equal
- if (!(obj instanceof ArtifactDescriptor))
+ if (!(obj.getClass().equals(getClass())))
return false;
ArtifactDescriptor other = (ArtifactDescriptor) obj;

Back to the top