[jira] [Created] (GROOVY-9401) JsonOutput.prettyPrint generates string with null bytes on OpenJ9 JVM

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (GROOVY-9401) JsonOutput.prettyPrint generates string with null bytes on OpenJ9 JVM

Paul King (Jira)
Giovanni Pardini created GROOVY-9401:
----------------------------------------

             Summary: JsonOutput.prettyPrint generates string with null bytes on OpenJ9 JVM
                 Key: GROOVY-9401
                 URL: https://issues.apache.org/jira/browse/GROOVY-9401
             Project: Groovy
          Issue Type: Bug
          Components: JSON
    Affects Versions: 2.5.9
         Environment: Ubuntu 18.04.4 LTS

JVM
DEB package: adoptopenjdk-8-openj9 8u242-b08.openj9-0.18.1-2

openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b08)
Eclipse OpenJ9 VM (build openj9-0.18.1, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20200122_511 (JIT enabled, AOT enabled)
OpenJ9   - 51a5857d2
OMR      - 7a1b0239a
JCL      - 8cf8a30581 based on jdk8u242-b08)

            Reporter: Giovanni Pardini
             Fix For: 3.0.0


Using OpenJDK with Eclipse OpenJ9 JVM from [https://adoptopenjdk.net/,] the method JsonOutput.prettyPrint() generates a string which contains null bytes.
h3. {{TEST CODE}}

{{import groovy.json.JsonOutput}}

{{String s = JsonOutput.prettyPrint('\{"id":123}')}}
{{println s.getBytes().encodeHex().toString()}}
{{println s}}
h3. {{OUTPUT}}

{{7b0a20202020226964223a20313233000000000000000000000000000a7d}}
{{{}}
{{ "id": 123}}
{{}}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)