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

Collection asImmutable() methods aren't immutable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4.5
    • 2.5.0-rc-1
    • groovy-jdk

    Description

      The contract for the Collection asImmutable() methods specify that the returned collection is immutable, but in fact the collection is merely read-only; it uses Collections.unmodifiable*(), which wraps an underlying collection that is still mutable.

      These methods should return actual immutable collections, either using Collections unmodifiables with copies of the underlying collections or using an actual immutable backing implementation, a la Guava.

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              chrylis Christopher Smith
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: