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

@Immutable gives slightly vague error message if used on a class that cannot be made immutable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.6.2
    • 1.6.3, 1.7-beta-1
    • Compiler
    • None

    Description

      Instead of:

      Possible mutable field 'x' of type 'java.lang.Object' found while compiling
      @Immutable class.

      Maybe:

      Possible mutable field 'x' of type 'java.lang.Object' found while compiling
      @Immutable class; fields may only be other @Immutable classes, primitive
      types or their associated wrappers (such as Integer, BigInteger, Double,
      etc.), enums or other known immutable classes (such as java.awt.Color). Note
      that any field defined as 'def' considered to be mutable and so cannot be
      used in an @Immutable class.

      or the less verbose:

      All fields of @Immutable classes must be of a supported immutable type
      but found field 'x' of type 'java.lang.Object' during compilation.

      See also email thread:
      http://markmail.org/thread/qr4allr73hpivm4q

      Attachments

        Activity

          People

            paulk Paul King
            alpheratz alpheratz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: