Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2317

JsonReader should support parsing regular characters if they begin with \u

    Details

      Description

      When a string comes from a JSON document containing an escaped u character, the JsonReader class incorrectly expects (always) a Unicode escape character. This is an incorrect assumption.

      For example, the following is a legal path on Windows:

      "url" : "jdbc:h2:file:path\\upstream.jboss-integration.modeshape\\modeshape-jcr\\target/db/h2/modeshape;DB_CLOSE_DELAY=-1"
      

      while the JsonReader expects after \u a series of numbers, raising the following exception:

      java.lang.NumberFormatException: For input string: "pstr"
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
      at java.lang.Integer.parseInt(Integer.java:492)
      at org.infinispan.schematic.internal.document.JsonReader$DateValueMatcher.unescapeValue(JsonReader.java:986)
      at org.infinispan.schematic.internal.document.JsonReader$DateValueMatcher.parseValue(JsonReader.java:950)
      at org.infinispan.schematic.internal.document.JsonReader$Parser.parseValue(JsonReader.java:517)
      at org.infinispan.schematic.internal.document.JsonReader$Parser.parseDocument(JsonReader.java:420)
      at org.infinispan.schematic.internal.document.JsonReader$Parser.parseValue(JsonReader.java:505)
      at org.infinispan.schematic.internal.document.JsonReader$Parser.parseDocument(JsonReader.java:420)
      at org.infinispan.schematic.internal.document.JsonReader$Parser.parseValue(JsonReader.java:505)
      at org.infinispan.schematic.internal.document.JsonReader$Parser.parseDocument(JsonReader.java:420)
      at org.infinispan.schematic.internal.document.JsonReader$Parser.parseDocument(JsonReader.java:364)
      at org.infinispan.schematic.internal.document.JsonReader.read(JsonReader.java:211)
      at org.infinispan.schematic.internal.document.JsonReader.read(JsonReader.java:196)
      at org.infinispan.schematic.internal.document.JsonReader.read(JsonReader.java:180)
      at org.infinispan.schematic.internal.document.JsonReader.read(JsonReader.java:115)
      at org.infinispan.schematic.document.Json.read(Json.java:198)
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                hchiorean Horia Chiorean
                Reporter:
                hchiorean Horia Chiorean
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: