mirror of
https://github.com/apache/druid.git
synced 2025-02-15 22:44:53 +00:00
properly close reader
This commit is contained in:
parent
c8b8e3f6e9
commit
0c35fe2cf4
@ -33,6 +33,7 @@ import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
@ -68,8 +69,8 @@ public class PropertiesModule implements Module
|
||||
|
||||
if (stream != null) {
|
||||
log.info("Loading properties from %s", propertiesFile);
|
||||
try {
|
||||
fileProps.load(new InputStreamReader(stream, Charsets.UTF_8));
|
||||
try(Reader reader = new InputStreamReader(stream, Charsets.UTF_8)) {
|
||||
fileProps.load(reader);
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw Throwables.propagate(e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user