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

@Immutable should provide a no-arg constructor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.6, 2.0.5
    • 2.2.2
    • xforms
    • None
    • Ubuntu Precise
      Groovy Version: 1.8.6 JVM: 1.6.0_27 Vendor: Sun Microsystems Inc. OS: Linux
      Groovy Version: 2.0.5 JVM: 1.7.0_25 Vendor: Oracle Corporation OS: Linux

    Description

      Given this class:

      @Immutable class Y { Collection c = []; int foo = 1 }
      

      I expect the following to succeed:

      def y = new Y()
      assert y.c.class.name.constains('Unmodifiable')
      

      In general, calling the no-arg constructor won't provide an interesting result unless the properties have default values but the constructor call should pass nonetheless.

      Attachments

        Activity

          People

            paulk Paul King
            wu-lee Nick Stokoe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: