You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Christian Schulte (JIRA)" <ji...@apache.org> on 2017/03/25 22:41:42 UTC
[jira] [Commented] (MNG-6164) Collections inconsistently immutable.
[ https://issues.apache.org/jira/browse/MNG-6164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15942021#comment-15942021 ]
Christian Schulte commented on MNG-6164:
----------------------------------------
Issue is fixed in the master branch of [my private maven repository on github|https://github.com/ChristianSchulte/maven/tree/master]. When interested, you can cherry pick the commit to your own repository and create a pull request for the apache master branch with just this commit yourself from there.
> Collections inconsistently immutable.
> -------------------------------------
>
> Key: MNG-6164
> URL: https://issues.apache.org/jira/browse/MNG-6164
> Project: Maven
> Issue Type: Bug
> Reporter: Christian Schulte
> Priority: Critical
> Fix For: 3.5.1-candidate
>
>
> There are plenty of places where empty collections are returned from public API methods like:
> {code}
> public List<Exception> getExceptions()
> {
> return exceptions == null ? Collections.<Exception> emptyList() : exceptions;
> }
> {code}
> The issue with this is that the empty list is immutable but the collection returned for the nun-null case is not immutable. All those methods should return an immutable collection consistently.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)