Clean up formatting & Update NIO in some remaining files

This commit is contained in:
Đạt Nhân Trương
2022-08-01 14:25:32 +07:00
parent a44744c05b
commit 4496e0854f
29 changed files with 603 additions and 613 deletions

View File

@@ -136,10 +136,10 @@ public class IdRetriever {
}
private static void fetchDataOnMapleHandbook() throws SQLException {
try(BufferedReader br = Files.newBufferedReader(INPUT_FILE);
PrintWriter printWriter = new PrintWriter(Files.newOutputStream(OUTPUT_FILE));) {
bufferedReader = br;
String line;
try (BufferedReader br = Files.newBufferedReader(INPUT_FILE);
PrintWriter printWriter = new PrintWriter(Files.newOutputStream(OUTPUT_FILE));) {
bufferedReader = br;
String line;
while ((line = bufferedReader.readLine()) != null) {
if (line.isEmpty()) {
printWriter.println("");
@@ -171,14 +171,12 @@ public class IdRetriever {
public static void main(String[] args) {
Instant instantStarted = Instant.now();
try {
try (con) {
if (INSTALL_SQLTABLE) {
parseMapleHandbook();
} else {
fetchDataOnMapleHandbook();
}
con.close();
} catch (SQLException e) {
System.out.println("Error: invalid SQL syntax");
e.printStackTrace();