From 258d85b934615e992be8e69ca011f684f6f433a2 Mon Sep 17 00:00:00 2001 From: "Anosh D. Ullenius" Date: Fri, 17 Jun 2022 20:29:52 +0200 Subject: [PATCH] Remove redundant throws clause --- .../main/java/com/threerings/getdown/data/Application.java | 6 ++---- .../src/main/java/com/threerings/getdown/tools/JarDiff.java | 2 +- .../main/java/com/threerings/getdown/util/VersionUtil.java | 3 ++- .../java/com/threerings/getdown/data/ClassPathTest.java | 2 +- .../java/com/threerings/getdown/launcher/GetdownApp.java | 3 +-- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/com/threerings/getdown/data/Application.java b/core/src/main/java/com/threerings/getdown/data/Application.java index 1e02b5f..bc7cc42 100644 --- a/core/src/main/java/com/threerings/getdown/data/Application.java +++ b/core/src/main/java/com/threerings/getdown/data/Application.java @@ -235,7 +235,7 @@ public class Application /** * Reads the {@code getdown.txt} config file into a {@code Config} object and returns it. */ - public static Config readConfig (EnvConfig envc, boolean checkPlatform) throws IOException { + public static Config readConfig (EnvConfig envc, boolean checkPlatform) { Config config = null; File cfgfile = new File(envc.appDir, CONFIG_FILE); Config.ParseOpts opts = Config.createOpts(checkPlatform); @@ -1438,9 +1438,7 @@ public class Application * * @param unpacked a set of resources to skip because they're already unpacked. */ - public void unpackResources (ProgressObserver obs, Set unpacked) - throws InterruptedException - { + public void unpackResources (ProgressObserver obs, Set unpacked) { List rsrcs = getActiveResources(); // remove resources that we don't want to unpack diff --git a/core/src/main/java/com/threerings/getdown/tools/JarDiff.java b/core/src/main/java/com/threerings/getdown/tools/JarDiff.java index f0db8ac..845f3a2 100644 --- a/core/src/main/java/com/threerings/getdown/tools/JarDiff.java +++ b/core/src/main/java/com/threerings/getdown/tools/JarDiff.java @@ -406,7 +406,7 @@ public class JarDiff implements JarDiffCodes return thisName; } - private void index () throws IOException { + private void index () { Enumeration entries = _archive.entries(); _nameToEntryMap = new HashMap<>(); diff --git a/core/src/main/java/com/threerings/getdown/util/VersionUtil.java b/core/src/main/java/com/threerings/getdown/util/VersionUtil.java index b2f2894..7bdcb76 100644 --- a/core/src/main/java/com/threerings/getdown/util/VersionUtil.java +++ b/core/src/main/java/com/threerings/getdown/util/VersionUtil.java @@ -12,6 +12,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintStream; +import java.nio.file.Files; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -48,7 +49,7 @@ public final class VersionUtil */ public static void writeVersion (File vfile, long version) throws IOException { - try (PrintStream out = new PrintStream(new FileOutputStream(vfile))) { + try (PrintStream out = new PrintStream(Files.newOutputStream(vfile.toPath()))) { out.println(version); } catch (Exception e) { log.warning("Unable to write version file: " + e.getMessage()); diff --git a/core/src/test/java/com/threerings/getdown/data/ClassPathTest.java b/core/src/test/java/com/threerings/getdown/data/ClassPathTest.java index c66ddc7..7091976 100644 --- a/core/src/test/java/com/threerings/getdown/data/ClassPathTest.java +++ b/core/src/test/java/com/threerings/getdown/data/ClassPathTest.java @@ -40,7 +40,7 @@ public class ClassPathTest _classPath.asArgumentString(_folder.getRoot())); } - @Test public void shouldProvideJarUrls () throws MalformedURLException, URISyntaxException + @Test public void shouldProvideJarUrls () throws URISyntaxException { URL[] actualUrls = _classPath.asUrls(); assertEquals(_firstJar, new File(actualUrls[0].toURI())); diff --git a/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java b/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java index 843e160..a00a4be 100644 --- a/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java +++ b/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java @@ -55,9 +55,8 @@ public class GetdownApp * Runs Getdown as an application, using the arguments supplie as {@code argv}. * @return the {@code Getdown} instance that is running. {@link Getdown#run} will have been * called on it. - * @throws Exception if anything goes wrong starting Getdown. */ - public static Getdown start (String[] argv) throws Exception { + public static Getdown start (String[] argv) { List notes = new ArrayList<>(); EnvConfig envc = EnvConfig.create(argv, notes); if (envc == null) {