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

Java final fields may be changed by Groovy

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.5
    • Fix Version/s: 1.6-beta-1, 1.5.7
    • Component/s: None
    • Labels:
      None

      Description

      From GROOVY-1875:

      def s = '12'
      s.value = 'ABCD'
      println s
      ==>
      AB

      The 'value' field is a private final variable in class java.lang.String.
      Therfore Groovy makes String mutable!

        Attachments

          Activity

            People

            • Assignee:
              blackdrag Jochen Theodorou
              Reporter:
              vrvolle Victor Volle
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: