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

Immutable classes break in groovy 2.5.2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.2
    • 3.0.0-alpha-4, 2.5.3
    • None
    • None

    Description

      We've being running tests of gradle plugins with latest gradle nightly release which upgraded to groovy 2.5.2

      Since then, we've seen multiple plugins breaking with errors around immutability:

       

      > Unsupported type (org.ajoberstar.grgit.Branch) found for field 'trackingBranch' while constructing immutable class org.ajoberstar.grgit.Branch.
      Immutable classes only support properties with effectively immutable types including:
      - Strings, primitive types, wrapper types, Class, BigInteger and BigDecimal, enums
      - classes annotated with @KnownImmutable and known immutables (java.awt.Color, java.net.URI)
      - Cloneable classes, collections, maps and arrays, and other classes with special handling
      (java.util.Date and various java.time.* classes and interfaces)
      Other restrictions apply, please see the groovydoc for ImmutableOptions for further details

       

      I was wondering if this change is related to https://github.com/apache/groovy/commit/3471f55ea5839ab3c9dfa51cdca081bc7b4c020e#diff-8f745c460bc1abf332f21067b21ec551R754 

       

      And also,  looks like gradle plugins that use the gradleApi and are compiled with groovy 2.4 could break with groovy 2.5 with usages like this one

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              rpalcolea Roberto Perez Alcolea
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: