Fix Gradle File leaks (#105597)

Fixing a couple of file leaks (and cleaning up one missing
try-with-resources). The directory descriptor leaks in particular
were leaking massively on every precommit run, to the point where it
slows down the whole system and/or we're running into descriptor limits.
This commit is contained in:
Armin Braun 2024-02-18 17:56:22 +01:00 committed by GitHub
parent 6fec837e32
commit 3f8bc36788
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 9 deletions

View file

@ -21,11 +21,8 @@ import java.util.Properties;
public class VersionPropertiesLoader {
static Properties loadBuildSrcVersion(File input, ProviderFactory providerFactory) throws IOException {
Properties props = new Properties();
InputStream is = new FileInputStream(input);
try {
try (InputStream is = new FileInputStream(input)) {
props.load(is);
} finally {
is.close();
}
loadBuildSrcVersion(props, providerFactory);
return props;