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

Chris Hegarty chris.hegarty at oracle.com
Wed Apr 15 11:36:01 UTC 2015


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 is probably 
better.

> One comment on the javadoc is that it says "the constructors finds the
> value of the system property", I assume this should be "reads" rather
> than "finds".

Thanks. This was a typo in the original spec. Fixed.

 >  Also you can use {@code ...} in the blockquote to avoid
> the escaping.

Done. We have lost the italic font, but that should be fine.

The above changes are capture here
   http://cr.openjdk.java.net/~chegar/8075139/webrev.01/


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).findFirst().orElse(null);

With the restriction we now have on overriding "core" protocol handlers 
we can actually use lambda's in this specific code path. I built a 
webrev based on your suggestion. Not too bad. I marginally favor this 
over webrev.01 above.

http://cr.openjdk.java.net/~chegar/8075139/webrev.02/src/java.base/share/classes/java/net/URL.java.sdiff.html

-Chris.


More information about the net-dev mailing list