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

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.2.1
    • Fix Version/s: None
    • Component/s: test-suite
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: