geforkt von Mirrors/FastAsyncWorldEdit
use try-with-resources
Dieser Commit ist enthalten in:
Ursprung
bd692917e6
Commit
39e1026400
@ -439,9 +439,10 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
|
|||||||
File actual = new File(getDataFolder(), name);
|
File actual = new File(getDataFolder(), name);
|
||||||
if (!actual.exists()) {
|
if (!actual.exists()) {
|
||||||
try {
|
try {
|
||||||
InputStream stream = getResource("defaults/" + name);
|
try (InputStream stream = getResource("defaults/" + name)) {
|
||||||
if (stream == null) throw new FileNotFoundException();
|
if (stream == null) throw new FileNotFoundException();
|
||||||
copyDefaultConfig(stream, actual, name);
|
copyDefaultConfig(stream, actual, name);
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
getLogger().severe("Unable to read default configuration: " + name);
|
getLogger().severe("Unable to read default configuration: " + name);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren