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

@ToString creates additional unneeded field

    XMLWordPrintableJSON

Details

    Description

      Using @ToString(includeNames = true) inserts a field called $print$names into the class. This field is neither transient nor static, which causes havoc when using XStream.

      Example XStream output:

      [
        {
          "name": "み +()[]{}.mp3",
          "size": 690037,
          "outputSize": 0,
          "format": {
            "codec": "mp3",
            "name": "mp3",
            "bitDepth": "s16le",
            "samplingRate": 44100,
            "channels": 2,
            "$print$names": true
          }
        }
      ]
      

      I don't understand why the field is there in the first place since printNames is a compile-time thing.

      Attachments

        Activity

          People

            paulk Paul King
            johann Johann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: