myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kočí (Created) (JIRA) <...@myfaces.apache.org>
Subject [jira] [Created] (MYFACES-3469) [PERF] Avoid unnecessary AbstractList$Itr instances - do not use java.util.Collections.emptyList()
Date Sun, 19 Feb 2012 14:24:34 GMT
[PERF] Avoid unnecessary AbstractList$Itr instances - do not use java.util.Collections.emptyList()
--------------------------------------------------------------------------------------------------

                 Key: MYFACES-3469
                 URL: https://issues.apache.org/jira/browse/MYFACES-3469
             Project: MyFaces Core
          Issue Type: Improvement
            Reporter: Martin Kočí
            Priority: Trivial


java.util.Collections.emptyList() is singleton instance of java.util.Collections.EmptyList
class, but this class inherits from java.util.AbstractList and creates new garbage iterator
java.util.AbstractList.Itr instance in every foreach  loop.

It is better to use own singleton instance (similar as google guava has)

same for java.util.Collections.emptySet()



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message