RFR [9] 8152277: Move URLClassPath.pathToURLs(String) to RegistryImpl

Chris Hegarty chris.hegarty at oracle.com
Wed Mar 23 15:46:00 UTC 2016


On 21/03/16 18:35, Alan Bateman wrote:
>
> On 21/03/2016 17:45, Chris Hegarty wrote:
>> In the context of 8149122 & 8152190 it was noticed that
>> sun.rmi.registry.RegistryImpl is the only invoker of
>> URLClassPath::pathToURLs.
>> Rather that adding a qualified export to java.rmi for this, it makes
>> sense to move
>> pathToURLs(String) to RegistryImpI ( and "modernize" the
>> implementation a little ).
>>
>> http://cr.openjdk.java.net/~chegar/8152277/
>> https://bugs.openjdk.java.net/browse/JDK-8152277
>>
>>
> Rather than using ParseUtils then you could just do:
>     URL url = Paths.get(p).toRealPath().toUri().toURL();

This is a little more "modernization" than I originally signed
up for ;-) but it has the advantage of not further polluting
the qualified exports, which is good.

> Also I assume that pathToURLs does not need to be public.

Right.

Update webrev:
   http://cr.openjdk.java.net/~chegar/8152277/

I'm not sure under what circumstances toRealPath can fail, but
I tried to be consistent with the old behavior.

-Chris.



More information about the core-libs-dev mailing list