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

deprecated @groovy.lang.Immutable feature broken on current trunk (1.8-beta-2)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.8-beta-1
    • 1.8-beta-2
    • None
    • None

    Description

      The following code is not supposed to go through, as it defeats the whole purpose of @Immutable. It correctly fails with ReadOnlyPropertyException on 1.7.5, but on trunk it works.

      @Immutable final class Person {
           boolean married
      }
        
      person = new Person(married:false)
      
      /* should not be allowed as it is mutating the object after it is formed */
      person.married = true 
      

      Attachments

        Activity

          People

            paulk Paul King
            roshandawrani Roshan Dawrani
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: