Minor code cleanup

This commit is contained in:
libraryaddict 2014-05-31 05:34:34 +12:00
parent 2cb8d90158
commit 93f807e6c9

View File

@ -144,10 +144,11 @@ public class LibsDisguises extends JavaPlugin {
private String read(Reader reader) { private String read(Reader reader) {
String toWrite = ""; String toWrite = "";
BufferedReader input = null;
try { try {
BufferedReader input = new BufferedReader(reader); input = new BufferedReader(reader);
String currentPath = ""; String currentPath = "";
try {
String line; String line;
while ((line = input.readLine()) != null) { while ((line = input.readLine()) != null) {
@ -173,14 +174,20 @@ public class LibsDisguises extends JavaPlugin {
toWrite += "\n"; toWrite += "\n";
} }
} }
} finally {
input.close();
}
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} finally { } finally {
try { try {
if (input != null) {
input.close();
}
} catch (IOException e) {
e.printStackTrace();
}
try {
if (reader != null) {
reader.close(); reader.close();
}
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }