Closes a buffered reader in saveStateTest properly and removes a .close causing server consoles not to display text

This commit is contained in:
Kristian Knarvik 2020-09-20 20:38:21 +02:00
parent 44b9bcc960
commit 31d167a8a4
2 changed files with 1 additions and 1 deletions

View File

@ -200,7 +200,6 @@ public final class CommonFunctions {
while (reader.ready() && (line = reader.readLine()) != null) {
text.append(line).append("\n");
}
reader.close();
return text.toString().trim();
}

View File

@ -44,6 +44,7 @@ public class ServerVersionContainerTest {
serverVersionContainer.saveState();
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(versionFile)));
String savedData = CommonFunctions.readBufferedReader(reader);
reader.close();
assertEquals(serverVersionContainer.toString(), savedData);
}