[ 
https://issues.apache.org/jira/browse/TINKERPOP-3012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17798396#comment-17798396
 ] 

Valentyn Kahamlyk commented on TINKERPOP-3012:
----------------------------------------------

Hi [~tglman],

Equality for vertex properties is defined in the same way as for Elements, i.e. 
by Id, not by value.
DetachedVertexProperty inherits `hashCode` from DetachedElement. 
DetachedVertexProperty overrides `equals` implementation, but code is the same.

The expected behavior of `VertexProperty` can be found, for example here 
https://github.com/apache/tinkerpop/blob/7f350528343606c51046016d9d6e748d0b2bae7c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/ElementHelper.java#L430

> Wrong hashCode implementation for DetachedVertexPropert
> -------------------------------------------------------
>
>                 Key: TINKERPOP-3012
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3012
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.7.0
>            Reporter: Emanuele Tagliaferri
>            Priority: Major
>         Attachments: detached_vertex_property_hashcode.patch
>
>
> Hi,
> I was trying to update OrientDB to TinkerPop 3.7.0, and I got some test 
> failing, with some debugging I noticed that the `DetachedVertexProperty`  
> implement equals for the property, but inherit the hashCode from 
> `DetachedElement` that it does not behave as a property but as an element. It 
> may be there also other `VertextProperty` that do not implement correctly the 
> hashCode.
> Adding a simple example patch in attachment.
> here is the branch I'm working on for the update 
> https://github.com/orientechnologies/orientdb-gremlin/tree/WIP_update_deps I 
> do have additional tests failing to check



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to