RFR: 8335896: Source launcher should set TCCL [v2]

Christian Stein cstein at openjdk.org
Tue Jul 16 08:46:21 UTC 2024


> Please review this change to set the context class loader of the current thread to the in-memory class loader when the `java` launcher is invoked in source mode. Having the source launcher set the TCCL to the in-memory classloader is benefical for scenarious depending on the TCCL being set to the application-loading loader.
> 
> For example, the single-argument taking [`ServiceLoader.load(Class)`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/ServiceLoader.html#load(java.lang.Class)) method creates "a new service loader for the given service type, using the current thread's [context class loader](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Thread.html#getContextClassLoader())."

Christian Stein has updated the pull request incrementally with one additional commit since the last revision:

  Clean up implementation

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20097/files
  - new: https://git.openjdk.org/jdk/pull/20097/files/d549a016..b514deb9

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20097&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20097&range=00-01

  Stats: 6 lines in 2 files changed: 2 ins; 3 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/20097.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20097/head:pull/20097

PR: https://git.openjdk.org/jdk/pull/20097


More information about the compiler-dev mailing list