problem with Class#getResource
Uwe Schindler
uschindler at apache.org
Sun Sep 4 15:32:08 UTC 2016
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