JDK-8177155 : Examine @CS methods when called from attached thread with no caller
  • Type: Task
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 8,9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-03-20
  • Updated: 2022-05-16
  • Resolved: 2022-05-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 19
19Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8280902 :  
JDK-8281000 :  
JDK-8281001 :  
JDK-8281003 :  
JDK-8281005 :  
JDK-8281006 :  
JDK-8281242 :  
JDK-8281244 :  
Description
Reflection::getCallerClass may return null if there is no caller on the stack.   We need to examine @CS methods when called from a thread attached via JNI for proper handling of the null caller class case.  We should create new tests to catch these cases.
Comments
All CSMs in JDK 19 are examined. Subtasks are created for the ones that will throw NPE or its existing behavior should be revisited.
16-05-2022

java.sql.DriverManager::getDriver, getDrivers, deregisterDriver, drivers methods check if the caller has access a driver if the driver class is visible to the caller's loader. If the caller is null, it will default to use the boot loader. java.sql.DriverManager::getConnection connects to a driver that it can access. It has access to the driver if the driver's class is visible to the caller's loader. If the caller is null, it will default to the thread's context class loader.
04-02-2022