8154956: Module system implementation refresh (4/2016)

Peter Levart peter.levart at gmail.com
Mon May 2 07:51:57 UTC 2016



On 05/02/2016 08:24 AM, Alan Bateman wrote:
>>
>> ModuleReader:
>> - the default method read(String name) should close the InputStream 
>> after reading from it, shouldn't it?
> Yes it should, just hasn't been noticed because each of the 
> implementations implement this method. I don't know if you mean to put 
> the try on the same line but I'll make that a bit more readable before 
> pushing the patch.

Good, it's more readable this way.

JmodModuleReader and JarModuleReader use this method, but this hasn't 
presented a problem since all those streams are closed when the JarFile 
is closed. But if there were any custom ModuleReaders (it's a public 
API) not overriding the default method, there would be a possible leak.

Regards, Peter



More information about the jigsaw-dev mailing list