ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: [1/2] ant git commit: Deprecate CollectionUtils and Enumerations; reduce explicit use of Enumeration
Date Fri, 18 May 2018 14:51:44 GMT
On 2018-05-18, Gintautas Grigelionis wrote:

> I believe that Streams API can at least implement the logic run by an
> original Enumeration in a more concise way, or provide more powerful idioms.
> That IMO makes it worth the while to investigate the Streams alternatives.

I agree to do that as soon as we want to change the code to do something
that wants to use said idioms. I don't really see a reason to change the
code before that point in time.

> In the process I also found out that other iterators could be used in a
> more efficient way, or that there is a redundant object construction going
> on.
> If you wish, I may spend some time to describe the changes I introduced,
> and maybe then we could discuss the their merits.

Let's use the concrete example that raised Maarten's email. In
ZipScanner we've gone from

            Enumeration<ZipEntry> e = zf.getEntries();
            while (e.hasMoreElements()) {
                ZipEntry entry = e.nextElement();


            StreamUtils.enumerationAsStream(zf.getEntries()).forEach(entry -> {

the Enumeration instance is created in both cases. What is the benfit
for the ZipScanner class right now?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message