You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2018/03/06 23:09:00 UTC
[jira] [Resolved] (GROOVY-7624) Collection asImmutable() methods
aren't immutable
[ https://issues.apache.org/jira/browse/GROOVY-7624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King resolved GROOVY-7624.
-------------------------------
Resolution: Fixed
Fix Version/s: 2.5.0-rc-1
Proposed PR merged. Thanks for raising the issue.
> 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
> Assignee: Paul King
> Priority: Minor
> Labels: breaking
> Fix For: 2.5.0-rc-1
>
>
> 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
(v7.6.3#76005)