problem with Class#getResource
dawid.weiss at gmail.com
Sun Sep 4 19:30:44 UTC 2016
This kind of "package-list" by getResources seems to be used quite
frequently in the wild... Check out this issue I filed for Log4j2.
I agree it's a side-effect that isn't defined in the spec (and
shouldn't be working).
On Sun, Sep 4, 2016 at 5:32 PM, Uwe Schindler <uschindler at apache.org> wrote:
> 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 Schindler
> uschindler at apache.org
> ASF Member, Apache Lucene PMC / Committer
> Bremen, Germany
>> 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
>> Can anyone tell me why that returns null with jigsaw?
>> bye Jochen
More information about the jigsaw-dev