Close opened resources

- Add BufferedReader instantiation into try-with-resources statement
- Close scanner that was opened
- Create utility class to format a caught exception
This commit is contained in:
ljacqu
2015-11-25 22:51:30 +01:00
parent 5f9ba208de
commit c83e983dea
4 changed files with 40 additions and 11 deletions
@@ -33,11 +33,6 @@ public class vAuthFileReader {
this.sender = sender;
}
/**
* Method convert.
*
* @throws IOException
*/
public void convert() {
final File file = new File(plugin.getDataFolder().getParent() + "" + File.separator + "vAuth" + File.separator + "passwords.yml");
Scanner scanner;
@@ -63,6 +58,7 @@ public class vAuthFileReader {
}
database.saveAuth(auth);
}
scanner.close();
} catch (Exception e) {
ConsoleLogger.writeStackTrace(e);
}