[ 
https://issues.apache.org/jira/browse/MNG-6164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16644104#comment-16644104
 ] 

ASF GitHub Bot commented on MNG-6164:
-------------------------------------

michael-o commented on issue #141: [MNG-6164] Collections inconsistently 
immutable.
URL: https://github.com/apache/maven/pull/141#issuecomment-428354940
 
 
   Please close this one, it has been merged.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Collections inconsistently immutable
> ------------------------------------
>
>                 Key: MNG-6164
>                 URL: https://issues.apache.org/jira/browse/MNG-6164
>             Project: Maven
>          Issue Type: Improvement
>    Affects Versions: 3.5.0
>            Reporter: Christian Schulte
>            Assignee: Michael Osipov
>            Priority: Minor
>             Fix For: 3.6.0
>
>
> There are plenty of places where empty collections are returned from public 
> API in methods written 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 a collection with consistent "mutability": 
> either mutable, either immutable.
> Given empty immutable collections do not cause harm until now, switching 
> consistently to immutable collections is more conservative and should not be 
> risky



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to