geforkt von Mirrors/FastAsyncWorldEdit
Clean up some io close() calls
Dieser Commit ist enthalten in:
Ursprung
9637871969
Commit
1fef255d77
@ -69,11 +69,11 @@ public class FlatFilePermissionsResolver implements PermissionsResolver {
|
|||||||
public Map<String, Set<String>> loadGroupPermissions() {
|
public Map<String, Set<String>> loadGroupPermissions() {
|
||||||
Map<String, Set<String>> userGroupPermissions = new HashMap<String, Set<String>>();
|
Map<String, Set<String>> userGroupPermissions = new HashMap<String, Set<String>>();
|
||||||
|
|
||||||
FileReader input = null;
|
BufferedReader buff = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
input = new FileReader(this.groupFile);
|
FileReader input = new FileReader(this.groupFile);
|
||||||
BufferedReader buff = new BufferedReader(input);
|
buff = new BufferedReader(input);
|
||||||
|
|
||||||
String line;
|
String line;
|
||||||
while ((line = buff.readLine()) != null) {
|
while ((line = buff.readLine()) != null) {
|
||||||
@ -101,8 +101,8 @@ public class FlatFilePermissionsResolver implements PermissionsResolver {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
if (input != null) {
|
if (buff != null) {
|
||||||
input.close();
|
buff.close();
|
||||||
}
|
}
|
||||||
} catch (IOException e2) {
|
} catch (IOException e2) {
|
||||||
}
|
}
|
||||||
@ -122,11 +122,11 @@ public class FlatFilePermissionsResolver implements PermissionsResolver {
|
|||||||
defaultPermissionsCache = userGroupPermissions.get("default");
|
defaultPermissionsCache = userGroupPermissions.get("default");
|
||||||
}
|
}
|
||||||
|
|
||||||
FileReader input = null;
|
BufferedReader buff = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
input = new FileReader(this.userFile);
|
FileReader input = new FileReader(this.userFile);
|
||||||
BufferedReader buff = new BufferedReader(input);
|
buff = new BufferedReader(input);
|
||||||
|
|
||||||
String line;
|
String line;
|
||||||
while ((line = buff.readLine()) != null) {
|
while ((line = buff.readLine()) != null) {
|
||||||
@ -166,8 +166,8 @@ public class FlatFilePermissionsResolver implements PermissionsResolver {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
if (input != null) {
|
if (buff != null) {
|
||||||
input.close();
|
buff.close();
|
||||||
}
|
}
|
||||||
} catch (IOException e2) {
|
} catch (IOException e2) {
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ public abstract class LegacyChunkStore extends ChunkStore {
|
|||||||
|
|
||||||
return rootTag;
|
return rootTag;
|
||||||
} finally {
|
} finally {
|
||||||
stream.close();
|
nbt.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ public abstract class McRegionChunkStore extends ChunkStore {
|
|||||||
|
|
||||||
return rootTag;
|
return rootTag;
|
||||||
} finally {
|
} finally {
|
||||||
stream.close();
|
nbt.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,6 +68,7 @@ public class MCEditSchematicFormat extends SchematicFormat {
|
|||||||
|
|
||||||
// Schematic tag
|
// Schematic tag
|
||||||
CompoundTag schematicTag = (CompoundTag) nbtStream.readTag();
|
CompoundTag schematicTag = (CompoundTag) nbtStream.readTag();
|
||||||
|
nbtStream.close();
|
||||||
if (!schematicTag.getName().equals("Schematic")) {
|
if (!schematicTag.getName().equals("Schematic")) {
|
||||||
throw new DataException("Tag \"Schematic\" does not exist or is not first");
|
throw new DataException("Tag \"Schematic\" does not exist or is not first");
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren