problem with Class#getResource

Jochen Theodorou blackdrag at gmx.org
Sun Sep 4 21:33:11 UTC 2016


hmmm... makes a sad sense to me. Though.... it seems to extend to 
ClassLoader#getResources(). That can´t be because of multi-release JAR 
files, can it?

bye Jochen

On 04.09.2016 17:32, Uwe Schindler wrote:
> Hi,
>
> I think this is related to multi-release JAR files because directories are no longer "unique" for the same resource. I am not 100% sure, but according to specs, Resources are only files, never directories, so I'd always say the above code is wrong and it is just caused by an implementation detail that it works at all. :-)
>
> Uwe
>
> -----
> Uwe Schindler
> uschindler at apache.org
> ASF Member, Apache Lucene PMC / Committer
> Bremen, Germany
> http://lucene.apache.org/
>> Sent: Sunday, September 4, 2016 3:36 PM
>> To: jigsaw-dev at openjdk.java.net
>> Subject: problem with Class#getResource
>>
>> Hi all,
>>
>>
>> I am using build 9-ea+132
>>
>> I have a test, that does in the setup this.class.getResource("/jars"),
>> to get a URL to the jars directory. The parent directory is on the
>> classpath, but the call returns null... This code is not run in a named
>> module.
>>
>> Can anyone tell me why that returns null with jigsaw?
>>
>> bye Jochen
>



More information about the jigsaw-dev mailing list