Skip to content

Commit

Permalink
fix: correct equals and hashcode of vertexproperty to use element logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tglman committed Jun 25, 2024
1 parent 117b5ac commit a32d5f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public String toString() {
}

@Override
public final boolean equals(final Object object) {
public boolean equals(final Object object) {
return ElementHelper.areEqual(this, object);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
import com.orientechnologies.orient.core.record.impl.ODocument;
import java.util.*;
import java.util.stream.Stream;
import org.apache.tinkerpop.gremlin.structure.Element;
import org.apache.tinkerpop.gremlin.structure.Property;
import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;

public class OrientVertexProperty<V> extends OrientProperty<V> implements VertexProperty<V> {

Expand Down Expand Up @@ -89,6 +91,16 @@ private String metadataKey() {
return "_meta_" + key;
}

@Override
public boolean equals(final Object object) {
return ElementHelper.areEqual(this, object);
}

@Override
public int hashCode() {
return ElementHelper.hashCode((Element) this);
}

@Override
public Vertex element() {
return (Vertex) element;
Expand Down

0 comments on commit a32d5f4

Please sign in to comment.