ASF GitHub Bot commented on GROOVY-7624:

GitHub user paulk-asert opened a pull request:


    GROOVY-7624: Collection asImmutable() methods aren't immutable


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/paulk-asert/groovy groovy7624

Alternatively you can review and apply these changes as the patch at:


To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #672
commit 9326ebe6040bb242d68fc8a835429a846ac9edc1
Author: paulk <paulk@...>
Date:   2018-03-06T12:16:29Z

    GROOVY-7624: Collection asImmutable() methods aren't immutable


> Collection asImmutable() methods aren't immutable
> -------------------------------------------------
>                 Key: GROOVY-7624
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7624
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-jdk
>    Affects Versions: 2.4.5
>            Reporter: Christopher Smith
>            Priority: Minor
> 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.

This message was sent by Atlassian JIRA

Reply via email to