Re: RFR [9] 8075139: Restore java.protocol.handler.pkgs to work as a fallback for migration

2015-04-15 Thread Paul Sandoz
On Apr 14, 2015, at 9:33 PM, Alan Bateman wrote: > On 14/04/2015 17:24, Chris Hegarty wrote: >> The work done as part of JDK-8064924 [1] to introduce a new service type, >> java.net.spi.URLStreamHandlerProvider, provides a clean provider mechanism >> that will work well with modules. That part

Re: RFR [9] 8075139: Restore java.protocol.handler.pkgs to work as a fallback for migration

2015-04-15 Thread Alan Bateman
On 15/04/2015 10:36, Paul Sandoz wrote: : Yes, one could use a Pattern.splitAsStream, sorry could not resist :-) assuming this area is not sensitive to bootstrap issues e.g. hander = p.splitAsStream().map(String::trim).flatMap(this::getHandler).findFirst().orElse(null); This is a fallback

Re: RFR [9] 8075139: Restore java.protocol.handler.pkgs to work as a fallback for migration

2015-04-15 Thread Chris Hegarty
On 14/04/15 20:33, Alan Bateman wrote: This looks okay to me although maybe we can use the opportunity to replace the use of StringTokenizer with a regex. Right. I used String.split("\\|"), but reverted to the original code as the regex doesn't use the fast-path. But you are right split i

Re: RFR [9] 8075139: Restore java.protocol.handler.pkgs to work as a fallback for migration

2015-04-15 Thread Paul Sandoz
On Apr 15, 2015, at 1:36 PM, Chris Hegarty wrote: > > Paul, > > > > > Yes, one could use a Pattern.splitAsStream, sorry could not resist :-) > > assuming this area is not sensitive to bootstrap issues e.g. > > > >hander = > > p.splitAsStream().map(String::trim).flatMap(this::getHandler).fi

Re: RFR [9] 8075139: Restore java.protocol.handler.pkgs to work as a fallback for migration

2015-04-15 Thread Chris Hegarty
On 15/04/15 15:16, Paul Sandoz wrote: On Apr 15, 2015, at 1:36 PM, Chris Hegarty wrote: Paul, Yes, one could use a Pattern.splitAsStream, sorry could not resist :-) assuming this area is not sensitive to bootstrap issues e.g. hander = p.splitAsStream().map(String::trim).flatMap(this:

Re: RFR [9] 8075139: Restore java.protocol.handler.pkgs to work as a fallback for migration

2015-04-15 Thread Alan Bateman
On 15/04/2015 15:35, Chris Hegarty wrote: That's better. For completeness, the updated webrev: http://cr.openjdk.java.net/~chegar/8075139/webrev.03/ Either is okay with me, the main thing is that the legacy tokenizer is gone. -Alan.

Re: RFR [9] 8075139: Restore java.protocol.handler.pkgs to work as a fallback for migration

2015-04-15 Thread Paul Sandoz
On Apr 15, 2015, at 4:35 PM, Chris Hegarty wrote: >> >> I marginally prefer using flatMap rather than map/filter e.g. change >> getHandler to return Stream< URLStreamHandler> and change the last line to >> be "return Stream.ofNullable(handle). Up to you. > > That's better. For completeness, th