[
https://issues.apache.org/jira/browse/TINKERPOP-2477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18018207#comment-18018207
]
Ken Hu commented on TINKERPOP-2477:
-----------------------------------
If equality checking of Elements was changed to include properties, it could
lead to a noticeable performance loss. It might be best to make this change
only for testing to ensure that Element properties are being properly asserted
in tests.
> 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
> Priority: Major
>
> 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.20.10#820010)