Changing the default file system provider is broken :(

Remi Forax forax at univ-mlv.fr
Sun Apr 23 18:28:38 UTC 2017


----- Mail original -----
> De: "Alan Bateman" <Alan.Bateman at oracle.com>
> À: jigsaw-dev at openjdk.java.net
> Envoyé: Dimanche 23 Avril 2017 12:38:21
> Objet: Re: Changing the default file system provider is broken :(

> On 22/04/2017 21:48, Peter Levart wrote:
> 
>>
>> Well, it works at least when
>> -Djava.nio.file.spi.DefaultFileSystemProvider=... is specified on the
>> command line. But when the system property is set as 1st thing in
>> main() method, it is already too late. It seems that after boot
>> sequence is finished (VM.isBooted() == true)and before main() method
>> is called, some code needs the FileSystem again, so default file
>> system is already initialized before the main() is executed.
>>
>> Perhaps there needs to be another initLevel which would be set just
>> before the invocation of the main() method?
> I don't think we go there as there are just too many scenarios where
> "user code" can execute before the application main method. Instead, I
> think this is a case where the default file system provider can only be
> overridden by setting the property on the command line.

This should be added to the compatibility list because mocking the FileSystem for testing purpose is common, at least in my own bubble.

> 
> -Alan

Rémi


More information about the jigsaw-dev mailing list