A DESCRIPTION OF THE PROBLEM :
If you look at the SDK documentation:
https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html#load-java.lang.Class-
You will see that if no ClassLoader is specified, the default ClassLoader used is:
Thread.currentThread().getContextClassLoader()
whereas it should be:
caller.class.getClassLoader()
This allows:
- Obtaining an SPI service in the same way you obtain a Class instance with new or Class.forName().
- No longer requiring the SPI service to be placed in the Java classpath, which allows it to be loaded dynamically (via a URLClassLoader).
- Ensuring that the use of SPI services follows and benefits from the ClassLoader inheritance logic.
REGRESSION : Java version that customer using for All
FREQUENCY :
ALWAYS
If you look at the SDK documentation:
https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html#load-java.lang.Class-
You will see that if no ClassLoader is specified, the default ClassLoader used is:
Thread.currentThread().getContextClassLoader()
whereas it should be:
caller.class.getClassLoader()
This allows:
- Obtaining an SPI service in the same way you obtain a Class instance with new or Class.forName().
- No longer requiring the SPI service to be placed in the Java classpath, which allows it to be loaded dynamically (via a URLClassLoader).
- Ensuring that the use of SPI services follows and benefits from the ClassLoader inheritance logic.
REGRESSION : Java version that customer using for All
FREQUENCY :
ALWAYS