mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-27 17:10:22 -04:00
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:
parent
6fec837e32
commit
3f8bc36788
4 changed files with 13 additions and 9 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue