You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Martin Kočí (Created JIRA)" <de...@myfaces.apache.org> on 2012/02/19 15:24:34 UTC

[jira] [Created] (MYFACES-3469) [PERF] Avoid unnecessary AbstractList$Itr instances - do not use java.util.Collections.emptyList()

[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