mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Previously, DefaultResourceLoader instances were created using the default constructor. This causes the resource loader to capture the TCCL that was in place at that time. This can lead to a class loader leak if the resource loader is referenced directly or indirectly from a static field of a class loaded by a different class loader. This commit updates the creation of DefaultResourceLoader instances in main code so that the resource load will use the class loader of the creating class. In almost all cases this will be the same class loader as was the thread context class loader that was being captured so the change in behavior is minimal. Crucially, it will still address the situation where the TCCL was different. Note the DevTools' ApplicationContextResourceLoader has been updated to explicitly use the TCCL. This ensures that it uses the restart class loader which is required for DevTools to function correctly. Fixes gh-20900 |
||
---|---|---|
.. | ||
spring-boot | ||
spring-boot-actuator | ||
spring-boot-actuator-autoconfigure | ||
spring-boot-autoconfigure | ||
spring-boot-cli | ||
spring-boot-dependencies | ||
spring-boot-devtools | ||
spring-boot-docs | ||
spring-boot-parent | ||
spring-boot-properties-migrator | ||
spring-boot-starters | ||
spring-boot-test | ||
spring-boot-test-autoconfigure | ||
spring-boot-tools |