Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-1259

SerializationTest.shouldSerializeTree fails due to id() and hashCode()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 3.2.1
    • None
    • test-suite
    • None

    Description

      The tests fails on the last

      assertEquals("The objects differ", after, before)
      

      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()

      return (long) (this.key().hashCode() + this.value().hashCode() + this.element().id().hashCode())
      

      If I change this to be the same as DetachedVertexProperty then the test passes but I am not sure that it would be correct.

      Attachments

        Activity

          People

            Unassigned Unassigned
            pietermartin pieter martin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: