RFR(s): 8072726: add adapter to convert Enumeration to Iterator (original) (raw)
Tomasz Kowalczewski tomasz.kowalczewski at gmail.com
Tue May 19 13:46:54 UTC 2015
- Previous message: RFR(s): 8072726: add adapter to convert Enumeration to Iterator
- Next message: RFR(s): 8072726: add adapter to convert Enumeration to Iterator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Are you talking about ClassLoader::{findResources, getBootstrapResources, getResources, getSystemResources} and NetworkInterface::{getInetAddresses, getNetworkInterfaces, getSubInterfaces}?
On Tue, May 19, 2015 at 2:26 PM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
On May 19, 2015, at 12:41 PM, Tomasz Kowalczewski <_ _tomasz.kowalczewski at gmail.com> wrote: > Is there a plan to override the default method asIterator() in specific implementations of Enumeration to avoid creating new object? JarFile::entries already returns JarEntryIterator which is both. >
I suppose one could, it's easy to do in some cases like in JarFile. Given that Enumeration is a legacy thing time could be better spent on adding Stream returning methods, which already exist on JarFile/ZipFile. Contributions will be warmly received for Stream returning methods on ClassLoader, NetworkInterface etc.!
> To be fair I did some tests and when I wrap Enumerable into simple Iterator adapter it will almost always get scalar replaced by escape analysis (unless, of course, it actually escapes :)). > Right :-) works until it doesn't. Paul.
-- Tomasz Kowalczewski
- Previous message: RFR(s): 8072726: add adapter to convert Enumeration to Iterator
- Next message: RFR(s): 8072726: add adapter to convert Enumeration to Iterator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]