forked from penberg/classpath
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize emptySet/Map/List() in Collections class
2012-10-16 Ivan Maidanski <ivmai@mail.ru> * java/util/Collections.java: (emptySet(), EmptySet.iterator(), emptyList(), emptyMap(), EmptyMap.entrySet(), EmptyMap.keySet(), EmptyMap.values()): Suppress "unchecked" warnings. (emptySet(), emptyList(), emptyMap()): Don't create new instance (use the corresponding immutable container instance); remove FIXME. (EmptySet.equals(Object), EmptyList.equals(Object), EmptyMap.entrySet(), EmptyMap.equals(Object), EmptyMap.keySet(), EmptyMap.values()): Add generic typing. (SingletonList.subList(int, int)): Use emptyList() instead of EMPTY_LIST (to eliminate "unchecked" warning). (SynchronizedCollection.toArray(T[])): Rename T type to E (to suppress compiler warning about type hiding).
- Loading branch information
Showing
2 changed files
with
34 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters