mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-10 11:29:20 +00:00
RequireNewOrMatchingContentFileHandler reads the already generated file through content.getInputStream().readAllBytes(). That method does not close the stream, and the stream is never assigned, so it cannot be closed at all. During AOT processing the content is a FileSystemResource, so each comparison leaks a file handle. FileSystemGeneratedFiles already uses try-with-resources when it consumes an InputStreamSource. Read the existing content inside a try-with-resources block. See gh-51398 Signed-off-by: dlwldn30 <dlwldn30@naver.com>