HADOOP-10223. MiniKdc#main() should close the FileReader it creates. (Ted Yu via tucu)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1557627 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Alejandro Abdelnur 2014-01-12 23:24:37 +00:00
parent aa0c489a28
commit bc2a443418
2 changed files with 12 additions and 1 deletions

View File

@ -511,6 +511,9 @@ Release 2.4.0 - UNRELEASED
HADOOP-10214. Fix multithreaded correctness warnings in ActiveStandbyElector
(Liang Xie via kasha)
HADOOP-10223. MiniKdc#main() should close the FileReader it creates.
(Ted Yu via tucu)
Release 2.3.0 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -125,7 +125,15 @@ public static void main(String[] args) throws Exception {
+ file.getAbsolutePath());
}
Properties userConf = new Properties();
userConf.load(new FileReader(file));
FileReader r = null;
try {
r = new FileReader(file);
userConf.load(r);
} finally {
if (r != null) {
r.close();
}
}
for (Map.Entry entry : userConf.entrySet()) {
conf.put(entry.getKey(), entry.getValue());
}