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

Proper functioning of GraphSONReader depends on order of elements in String representation

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3.0
    • Fix Version/s: 3.2.8, 3.3.2
    • Component/s: io
    • Labels:
      None

      Description

      The following two snippets are basically using the same stringified JSON object, it's just the order of elements that is different.

      gremlin> GraphSONReader.build().create().readObject(new java.io.ByteArrayInputStream('{"@value":{"step":[["addV","poc_int"],["property","bigint1value",{"@value":-4294967295,"@type":"g:Int32"}]]},"@type":"g:Bytecode"}'.getBytes()), Bytecode.class)
      ==>[[], [addV(poc_int), property(bigint1value, 1)]]
      
      gremlin> GraphSONReader.build().create().readObject(new java.io.ByteArrayInputStream('{"@type":"g:Bytecode","@value":{"step":[["addV","poc_int"],["property","bigint1value",{"@type":"g:Int32","@value":-4294967295}]]}}'.getBytes()), Bytecode.class)
      Could not deserialize the JSON value as required. Nested exception: org.apache.tinkerpop.shaded.jackson.databind.JsonMappingException: Could not deserialize the JSON value as required. Nested exception: org.apache.tinkerpop.shaded.jackson.core.JsonParseException: Numeric value (-4294967295) out of range of int
       at [Source: java.io.ByteArrayInputStream@6d367020; line: 1, column: 126]
       at [Source: java.io.ByteArrayInputStream@6d367020; line: 1, column: 115] (through reference chain: java.util.ArrayList[1]->java.util.ArrayList[2])
       at [Source: java.io.ByteArrayInputStream@6d367020; line: 1, column: 115]
      Type ':help' or ':h' for help.
      Display stack trace? [yN]
      

        Attachments

          Activity

            People

            • Assignee:
              spmallette Stephen Mallette
              Reporter:
              dkuppitz Daniel Kuppitz
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: