[Fwd: Code review request: 7072353 JNDI libraries do not build with javac -Xlint:all -Werror]
cgdecker at gmail.com
Thu Aug 4 09:52:13 PDT 2011
No, that copies the Enumeration. I'm talking about something that creates
lazy Iterators backed by Enumerations.
On Thu, Aug 4, 2011 at 12:34 PM, Rémi Forax <forax at univ-mlv.fr> wrote:
> On 08/04/2011 06:17 PM, Colin Decker wrote:
>> One better way to handle this in Java 8 would be to have a utility method
>> that takes a Supplier<Enumeration<E>> SAM argument (with a no-arg method
>> that returns an Enumeration<E>) and returns an Iterable<E> that gets a
>> Enumeration from the supplier each time iterator() is called. It could
>> be used with method references:
>> Iterable<E> iterable = Util.enumerationIterable(#**
> you means Collections.list().
More information about the core-libs-dev