Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7519

JsonOuput.toJson() leads to StackOverflowException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.4.4
    • Fix Version/s: 2.4.5
    • Component/s: JSON
    • Labels:
      None

      Description

      If one wants to generate JSON with groovy.json.JsonOutpout that contains a java.io.File object as property in the object hierarchy a StackOverflowException is thrown

      groovy.json.JsonOutput.toJson(new File('.'))
      
      
      java.lang.StackOverflowError
      	at groovy.json.internal.CharBuf.addLong(CharBuf.java:788)
      	at groovy.json.JsonOutput.writeNumber(JsonOutput.java:216)
      	at groovy.json.JsonOutput.writeObject(JsonOutput.java:264)
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dariusan dariusan
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: