From ccdefff8bd10e74ed00f573ad39cd3be3d1e410a Mon Sep 17 00:00:00 2001 From: Edwin Kempin Date: Thu, 22 Aug 2013 15:43:32 +0200 Subject: [PATCH] Remove unneeded @SuppressWarnings("resource") Change-Id: Ief5d5536fb34e55dfb14e3977f59b23823b2d132 Signed-off-by: Edwin Kempin --- .../src/test/java/com/google/gerrit/acceptance/SshSession.java | 1 - .../java/com/google/gerrit/pgm/init/InitPluginStepsLoader.java | 2 -- gerrit-pgm/src/main/java/com/google/gerrit/pgm/util/IoUtil.java | 1 - 3 files changed, 4 deletions(-) diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/SshSession.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/SshSession.java index dc648fcd82..a150eba6d0 100644 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/SshSession.java +++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/SshSession.java @@ -36,7 +36,6 @@ public class SshSession { this.account = account; } - @SuppressWarnings("resource") public String exec(String command) throws JSchException, IOException { ChannelExec channel = (ChannelExec) getSession().openChannel("exec"); try { diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/InitPluginStepsLoader.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/InitPluginStepsLoader.java index 3f0f7cff65..76587017c8 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/InitPluginStepsLoader.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/InitPluginStepsLoader.java @@ -64,11 +64,9 @@ public class InitPluginStepsLoader { private InitStep loadInitStep(File jar) { try { - @SuppressWarnings("resource") ClassLoader pluginLoader = new URLClassLoader(new URL[] {jar.toURI().toURL()}, InitPluginStepsLoader.class.getClassLoader()); - @SuppressWarnings("resource") JarFile jarFile = new JarFile(jar); Attributes jarFileAttributes = jarFile.getManifest().getMainAttributes(); String initClassName = jarFileAttributes.getValue("Gerrit-InitStep"); diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/util/IoUtil.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/util/IoUtil.java index f750748aa5..e28af7c057 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/util/IoUtil.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/util/IoUtil.java @@ -57,7 +57,6 @@ public final class IoUtil { if (!(cl instanceof URLClassLoader)) { throw noAddURL("Not loaded by URLClassLoader", null); } - @SuppressWarnings("resource") URLClassLoader urlClassLoader = (URLClassLoader) cl; Method addURL;