On Thu, 22 Jun 2023 14:20:30 GMT, Alan Bateman <al...@openjdk.org> wrote:

>> There are a few references to rt.jar in comments and in the codebase itself. 
>> Some of them might be removed or adjusted.
>
> src/java.sql/share/classes/java/sql/DriverManager.java line 658:
> 
>> 656:          * (which is invoking this class indirectly)
>> 657:          * classloader, so that the JDBC driver class outside the image
>> 658:          * can be loaded from here.
> 
> This code should probably be changed to use VM.isSystemDomainLoader(callerCL).
> 
> I think the comment should be replaced because it doesn't match what it 
> actually does and it's nothing to do with the whether the JDBC driver is in 
> the run-time image or not. How about:
> 
> "If the caller is defined to the bootstrap or platform class loader then use 
> the Thread CCL as the initiating class loader so that a JDBC on the class 
> path, or bundled with an application, is found."

Hi Alan, regarding usage of class VM I get 
'package jdk.internal.misc is declared in module java.base, which does not 
export it to module java.sql'
Is there any concern to export it as well to module java.sql  ?
And btw did you mean to use it like this, in the if  ?

`        if (callerCL == null || VM.isSystemDomainLoader(callerCL)) {
            callerCL = Thread.currentThread().getContextClassLoader();
        }`

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14593#discussion_r1245164604

Reply via email to