Clean up other compiler warnings

This commit is contained in:
Kenzie Togami
2018-12-26 16:50:24 -08:00
parent de7d9421b1
commit 386668d221
4 changed files with 21 additions and 33 deletions

View File

@ -133,9 +133,10 @@ public class Snapshot implements Comparable<Snapshot> {
public boolean containsWorld(String worldname) {
try {
if (file.getName().toLowerCase().endsWith(".zip")) {
ZipFile entry = new ZipFile(file);
return (entry.getEntry(worldname) != null
|| entry.getEntry(worldname + "/level.dat") != null);
try (ZipFile entry = new ZipFile(file)) {
return (entry.getEntry(worldname) != null
|| entry.getEntry(worldname + "/level.dat") != null);
}
} else if (file.getName().toLowerCase().endsWith(".tar.bz2")
|| file.getName().toLowerCase().endsWith(".tar.gz")
|| file.getName().toLowerCase().endsWith(".tar")) {