commonsrdf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [2/2] incubator-commonsrdf git commit: Corrected rdf4j Quad.equals()
Date Fri, 04 Nov 2016 09:15:23 GMT
Corrected rdf4j Quad.equals()


Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/17dab006
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/17dab006
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/17dab006

Branch: refs/heads/master
Commit: 17dab006d254934e21cb1ba36e3336db73cd0c0d
Parents: 33bc626
Author: Stian Soiland-Reyes <stain@apache.org>
Authored: Fri Nov 4 10:15:07 2016 +0100
Committer: Stian Soiland-Reyes <stain@apache.org>
Committed: Fri Nov 4 10:15:07 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/commons/rdf/rdf4j/impl/QuadImpl.java  | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/17dab006/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/QuadImpl.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/QuadImpl.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/QuadImpl.java
index 6962803..228b4f0 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/QuadImpl.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/QuadImpl.java
@@ -51,10 +51,12 @@ final class QuadImpl implements Quad, RDF4JQuad {
 
     @Override
     public boolean equals(Object obj) {
-        if (obj instanceof Triple) {
-            Triple triple = (Triple) obj;
-            return getSubject().equals(triple.getSubject()) && getPredicate().equals(triple.getPredicate())
-                    && getObject().equals(triple.getObject());
+        if (obj instanceof Quad) {
+            Quad quad = (Quad) obj;
+            return getGraphName().equals(quad.getGraphName()) &&
+                    getSubject().equals(quad.getSubject()) && 
+                    getPredicate().equals(quad.getPredicate()) &&
+                    getObject().equals(quad.getObject());
         }
         return false;
     }


Mime
View raw message