[
https://issues.apache.org/jira/browse/TINKERPOP-1259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15234357#comment-15234357
]
Dylan Millikin commented on TINKERPOP-1259:
-------------------------------------------
Is that the only test that fails? It might be interesting to add a test
somewhere that would make this a little more explicit. It's a bit missleading
to get a failure from a tree serialization test on an incorrectly implemented
VertexProperty
> SerializationTest.shouldSerializeTree fails due to id() and hashCode()
> ----------------------------------------------------------------------
>
> Key: TINKERPOP-1259
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1259
> Project: TinkerPop
> Issue Type: Bug
> Components: test-suite
> Affects Versions: 3.2.1
> Reporter: pieter martin
>
> The tests fails on the last
> {code}
> assertEquals("The objects differ", after, before)
> {code}
> The 2 trees are however correct but due to differences in the
> {{DetachedVertexProperty}} and {{SqlgVertexProperty}} {{id()}}, {{equals()}}
> and {{hashCode()}} implementation the 2 trees are not equal.
> {{DetachedVertexProperty}} uses the {{element}}'s {{id}} as its {{id}} and
> that is used in the {{equals}} and {{hashCode}} method basically making a
> property equal to an element.
> {{SqlgVertexProperty}} has a more sophisticated {{id()}}
> {code}
> return (long) (this.key().hashCode() + this.value().hashCode() +
> this.element().id().hashCode())
> {code}
> If I change this to be the same as {{DetachedVertexProperty}} then the test
> passes but I am not sure that it would be correct.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)