Re: ClassLoader.getResources(String)

2018-03-07 Thread Alan Bateman
On 07/03/2018 15:14, Stephen Colebourne wrote: : Configuration and code are two very different things. Asking projects and end users to write code for something that should be config is a huge no-no. My view is that JPMS has made using configuration files, especially for libraries, a lot harder.

Re: ClassLoader.getResources(String)

2018-03-07 Thread Mark Raynsford
On 2018-03-07T15:14:11 + Stephen Colebourne wrote: > > Effectively what is needed is another way for a library to be informed > of the presence of the calling application. One possible solution to > this would be to allow users to write module initialization code in > module-info.java. Then an

Re: ClassLoader.getResources(String)

2018-03-07 Thread Stephen Colebourne
On 7 March 2018 at 12:59, Alan Bateman wrote: > You've dismissed services but I would expect it to provide a nice solution. > The service interface might be very simple, something like: > > public interface LeapSecondDataProvider { > LeapSecondData data(); > } Configuration and code are two v

Re: ClassLoader.getResources(String)

2018-03-07 Thread Alan Bateman
On 07/03/2018 12:11, Stephen Colebourne wrote: Following up on this, it does feel like the use case is now simply not possible. I have a similar problem with ClassLoader.getResources(String) in threeten-extra. https://github.com/ThreeTen/threetenbp-extra/blob/master/src/main/java/org/threeten/

Re: ClassLoader.getResources(String)

2018-03-07 Thread Stephen Colebourne
Following up on this, it does feel like the use case is now simply not possible. I have a similar problem with ClassLoader.getResources(String) in threeten-extra. https://github.com/ThreeTen/threetenbp-extra/blob/master/src/main/java/org/threeten/extra/scale/SystemUTCRules.java#L202 The ThreeTen-

Re: ClassLoader.getResources(String)

2018-02-07 Thread Alan Bateman
On 07/02/2018 16:56, Stephen Colebourne wrote: : I was using maven to create a jar-with-dependencies file, so I could use jlink. With all the code in one jar file, there shouldn't be any access barriers to worry about. ClassLoader.getResources(String) worked just fine until Java 9. The two APIs

Re: ClassLoader.getResources(String)

2018-02-07 Thread Stephen Colebourne
On 7 February 2018 at 16:35, Alan Bateman wrote: > On 07/02/2018 14:23, Stephen Colebourne wrote: >> >> I've been trying to use ClassLoader.getResources(String). The entire >> application is in one named module, this includes the code that >> invokes the ClassLoader method and the resource that it

Re: ClassLoader.getResources(String)

2018-02-07 Thread Alan Bateman
On 07/02/2018 14:23, Stephen Colebourne wrote: I've been trying to use ClassLoader.getResources(String). The entire application is in one named module, this includes the code that invokes the ClassLoader method and the resource that it is trying to find. Can you summarize what you are trying to d