Merge pull request #4152 from FlXME/master

Fix various bugs
This commit is contained in:
Robert Alan Chapton 2020-05-01 14:29:35 -07:00 committed by GitHub
commit 53c5fb7328
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 7 deletions

View File

@ -54,15 +54,15 @@ public class WorldBlacklist {
if(!blacklist.contains(currentLine)) if(!blacklist.contains(currentLine))
blacklist.add(currentLine); blacklist.add(currentLine);
} }
//Close readers
bufferedReader.close();
fileReader.close();
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
} catch (IOException e) } catch (IOException e)
{ {
e.printStackTrace(); e.printStackTrace();
} finally {
//Close readers
if(bufferedReader != null) bufferedReader.close();
if(fileReader != null) fileReader.close();
} }
plugin.getLogger().info(blacklist.size()+" entries in mcMMO World Blacklist"); plugin.getLogger().info(blacklist.size()+" entries in mcMMO World Blacklist");

View File

@ -346,7 +346,7 @@ public class HashChunkletManager implements ChunkletManager {
try { try {
fileIn = new FileInputStream(location); fileIn = new FileInputStream(location);
objIn = new ObjectInputStream(fileIn); objIn = new ObjectInputStream(new BufferedInputStream(fileIn));
storeIn = (ChunkletStore) objIn.readObject(); storeIn = (ChunkletStore) objIn.readObject();
} }
catch (IOException ex) { catch (IOException ex) {

View File

@ -75,7 +75,7 @@ public class BlockStoreConversionMain implements Runnable {
public void softStop() { public void softStop() {
stop(); stop();
if (this.dataDir.exists() || this.dataDir.isDirectory()) { if (this.dataDir.exists() && this.dataDir.isDirectory()) {
start(); start();
return; return;
} }

View File

@ -49,7 +49,9 @@ public class UUIDFetcher implements Callable<Map<String, UUID>> {
String body = array.toString(); String body = array.toString();
writeBody(connection, body); writeBody(connection, body);
JsonObject[] jsonStreamArray = gson.fromJson(new InputStreamReader(connection.getInputStream()), JsonObject[].class); InputStreamReader tempStream = new InputStreamReader(connection.getInputStream());
JsonObject[] jsonStreamArray = gson.fromJson(tempStream, JsonObject[].class);
tempStream.close();
for (JsonObject jsonProfile : jsonStreamArray) { for (JsonObject jsonProfile : jsonStreamArray) {
String id = jsonProfile.get("id").getAsString(); String id = jsonProfile.get("id").getAsString();