Remove redundant throws clause

This commit is contained in:
Anosh D. Ullenius
2022-06-17 20:29:52 +02:00
parent 245f5386ce
commit 258d85b934
5 changed files with 7 additions and 9 deletions
@@ -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<Resource> unpacked)
throws InterruptedException
{
public void unpackResources (ProgressObserver obs, Set<Resource> unpacked) {
List<Resource> rsrcs = getActiveResources();
// remove resources that we don't want to unpack
@@ -406,7 +406,7 @@ public class JarDiff implements JarDiffCodes
return thisName;
}
private void index () throws IOException {
private void index () {
Enumeration<? extends ZipEntry> entries = _archive.entries();
_nameToEntryMap = new HashMap<>();
@@ -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());
@@ -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()));
@@ -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<EnvConfig.Note> notes = new ArrayList<>();
EnvConfig envc = EnvConfig.create(argv, notes);
if (envc == null) {