From 6aa30927618f9213a4200ce15704b9cd42f18708 Mon Sep 17 00:00:00 2001 From: nbaars Date: Mon, 5 Jan 2015 20:57:38 +0100 Subject: [PATCH] changing language level to Java 7 --- pom.xml | 4 ++-- .../java/org/owasp/webgoat/plugins/PluginExtractor.java | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 2b306b367..2da36fb25 100644 --- a/pom.xml +++ b/pom.xml @@ -38,8 +38,8 @@ org.apache.maven.plugins maven-compiler-plugin - 1.6 - 1.6 + 1.7 + 1.7 ISO-8859-1 diff --git a/src/main/java/org/owasp/webgoat/plugins/PluginExtractor.java b/src/main/java/org/owasp/webgoat/plugins/PluginExtractor.java index abcf30350..2cf8fdb9a 100644 --- a/src/main/java/org/owasp/webgoat/plugins/PluginExtractor.java +++ b/src/main/java/org/owasp/webgoat/plugins/PluginExtractor.java @@ -36,9 +36,7 @@ public class PluginExtractor { } public void extract() { - FileSystem zip = null; - try { - zip = createZipFileSystem(); + try (FileSystem zip = createZipFileSystem()) { final Path root = zip.getPath("/"); baseDirectory = Paths.get(System.getProperty("java.io.tmpdir"), DIRECTORY); Files.walkFileTree(root, new SimpleFileVisitor() { @@ -55,8 +53,6 @@ public class PluginExtractor { }); } catch (IOException io) { logger.error(String.format("Unable to extract: %s", pluginArchive.getFileName()), io); - } finally { - closeZipFileSystem(zip); } }