problem with Class#getResource
blackdrag at gmx.org
Mon Sep 5 14:50:42 UTC 2016
On 05.09.2016 15:15, Jochen Theodorou wrote:
> On 04.09.2016 22:05, Alan Bateman wrote:
>> On 04/09/2016 14:35, Jochen Theodorou wrote:
>>> 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?
>> Can you say what "this.class" is in the example? Also do you see any
>> difference in behavior between the regular JDK 9 downloads and the
>> Jigsaw EA downloads?
> this.class is the same as this.getClass().
> Anyway... turns out this is working if I make a standalone example.
> Which means the test setup part must do something wrong when forking a
> new JVM.
getResource did not get caller sensitive, right?
More information about the jigsaw-dev