shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Bishop (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SHIRO-566) CollectionUtils should use Collections wrappers of arrays if possible
Date Mon, 30 May 2016 17:45:12 GMT
Matt Bishop created SHIRO-566:
---------------------------------

             Summary: CollectionUtils should use Collections wrappers of arrays if possible
                 Key: SHIRO-566
                 URL: https://issues.apache.org/jira/browse/SHIRO-566
             Project: Shiro
          Issue Type: Improvement
          Components: Authorization (access control) 
    Affects Versions: 1.2.4
         Environment: Any
            Reporter: Matt Bishop
            Priority: Trivial


org.apache.shiro.util.CollectionUtils.asSet() and .asList() could use Collections wrappers
for the passed-in elements. These are smaller and faster than copying the contents into other
collections.

The editability of the returned Collections is not required as currently it will return either
an unmodifiable emptyList() / emptySet() or a modifiable ArrayList / LinkedHashSet. Ideally
it would wrap the LinkedHashSet in unmodifiableSet and declare the immutability of the returned
collections in the docs.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message