Files
spring-framework/spring-core
junhyeong9812 03d80feed0 Close class resource InputStream in ThrowawayClassLoader
Prior to this commit, ThrowawayClassLoader#loadClassFromResource opened
an InputStream via getResourceAsStream(...) but never closed it. The
stream leaked on both the success path (after defineClass) and the
IOException path, as the surrounding try-block had neither a finally
nor a try-with-resources clause.

This commit adapts the existing inputStream variable as a
try-with-resources resource so that it is closed on every path, leaving
the loading logic unchanged.

Closes gh-36933

Signed-off-by: junhyeong9812 <pickjog@gmail.com>
2026-06-17 13:12:23 +02:00
..