Hi all,
Re:
https://github.com/galderz/infinispan/commit/0609207d13216de81d77ff51dc20...
Please avoid using these JDK methods where possible. I've created alternative versions
in InfinispanCollections util class that provide a better implementation.
The problem with the JDK versions is that even if these collections are immutable, if you
wanna iterate them (i.e. for(X : emptySet) ), they'll create a brand new Iterator
every time they're looped, and that generates useless garbage.
The InfinispanCollections versions of emptyX will return a constant singleton iterator
which avoids this problem, and avoids the need for client code to check if the collection
is empty before looping.
Cheers,
--
Galder Zamarreño
galder(a)redhat.com
twitter.com/galderz
Project Lead, Escalante
http://escalante.io
Engineer, Infinispan
http://infinispan.org