You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Divij Vaidya (Jira)" <ji...@apache.org> on 2020/11/18 00:53:00 UTC

[jira] [Created] (TINKERPOP-2477) Equality check for detached elements does not check properties

Divij Vaidya created TINKERPOP-2477:
---------------------------------------

             Summary: Equality check for detached elements does not check properties
                 Key: TINKERPOP-2477
                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2477
             Project: TinkerPop
          Issue Type: Bug
          Components: process
    Affects Versions: 3.4.8
            Reporter: Divij Vaidya


Detached elements may contain label and properties in addition to the Id of the element. However the equality check for detached elements is based on checking of Id alone. Which implies that a vertex A with null properties and label "vertex" is considered equal to another vertex B with null properties and label "person".

This can lead to bugs not getting caught in test cases. As a hypothetical example let's say I made a change in query transformation where I missed copying the properties. When I am validating the results with older version (without my change), I will find that the test is passing since ID is the only field being considered when checking for equality. 

Code reference:
{code:java}
DetachedElement.java

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

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)