From ed59c713eb5b20a7610503a6a94da9f9b1f4c504 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Wed, 26 Apr 2023 16:28:04 +0200 Subject: [PATCH] Remove unused 'throws IOException' declarations --- .../main/java/sop/external/operation/ArmorExternal.java | 5 ++--- .../main/java/sop/external/operation/DearmorExternal.java | 3 +-- .../sop/external/operation/DetachedVerifyExternal.java | 4 ++-- .../main/java/sop/external/operation/EncryptExternal.java | 2 +- .../java/sop/external/operation/InlineSignExternal.java | 2 +- .../java/sop/testsuite/operation/ListProfilesTest.java | 7 +++---- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/external-sop/src/main/java/sop/external/operation/ArmorExternal.java b/external-sop/src/main/java/sop/external/operation/ArmorExternal.java index cb53573..4df7fca 100644 --- a/external-sop/src/main/java/sop/external/operation/ArmorExternal.java +++ b/external-sop/src/main/java/sop/external/operation/ArmorExternal.java @@ -10,11 +10,10 @@ import sop.exception.SOPGPException; import sop.external.ExternalSOP; import sop.operation.Armor; -import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; -import java.util.Properties; import java.util.List; +import java.util.Properties; /** * Implementation of the {@link Armor} operation using an external SOP binary. @@ -37,7 +36,7 @@ public class ArmorExternal implements Armor { } @Override - public Ready data(InputStream data) throws SOPGPException.BadData, IOException { + public Ready data(InputStream data) throws SOPGPException.BadData { return ExternalSOP.executeTransformingOperation(Runtime.getRuntime(), commandList, envList, data); } } diff --git a/external-sop/src/main/java/sop/external/operation/DearmorExternal.java b/external-sop/src/main/java/sop/external/operation/DearmorExternal.java index 7fa1fdc..bedf018 100644 --- a/external-sop/src/main/java/sop/external/operation/DearmorExternal.java +++ b/external-sop/src/main/java/sop/external/operation/DearmorExternal.java @@ -9,7 +9,6 @@ import sop.exception.SOPGPException; import sop.external.ExternalSOP; import sop.operation.Dearmor; -import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; @@ -30,7 +29,7 @@ public class DearmorExternal implements Dearmor { } @Override - public Ready data(InputStream data) throws SOPGPException.BadData, IOException { + public Ready data(InputStream data) throws SOPGPException.BadData { return ExternalSOP.executeTransformingOperation(Runtime.getRuntime(), commandList, envList, data); } } diff --git a/external-sop/src/main/java/sop/external/operation/DetachedVerifyExternal.java b/external-sop/src/main/java/sop/external/operation/DetachedVerifyExternal.java index b9cd182..2f19c5b 100644 --- a/external-sop/src/main/java/sop/external/operation/DetachedVerifyExternal.java +++ b/external-sop/src/main/java/sop/external/operation/DetachedVerifyExternal.java @@ -54,13 +54,13 @@ public class DetachedVerifyExternal implements DetachedVerify { } @Override - public DetachedVerify cert(InputStream cert) throws SOPGPException.BadData, IOException { + public DetachedVerify cert(InputStream cert) throws SOPGPException.BadData { this.certs.add(cert); return this; } @Override - public VerifySignatures signatures(InputStream signatures) throws SOPGPException.BadData, IOException { + public VerifySignatures signatures(InputStream signatures) throws SOPGPException.BadData { this.signatures = signatures; return this; } diff --git a/external-sop/src/main/java/sop/external/operation/EncryptExternal.java b/external-sop/src/main/java/sop/external/operation/EncryptExternal.java index 1a7208e..bc40208 100644 --- a/external-sop/src/main/java/sop/external/operation/EncryptExternal.java +++ b/external-sop/src/main/java/sop/external/operation/EncryptExternal.java @@ -93,7 +93,7 @@ public class EncryptExternal implements Encrypt { @Override public Ready plaintext(InputStream plaintext) - throws IOException, SOPGPException.KeyIsProtected { + throws SOPGPException.KeyIsProtected { return ExternalSOP.executeTransformingOperation(Runtime.getRuntime(), commandList, envList, plaintext); } } diff --git a/external-sop/src/main/java/sop/external/operation/InlineSignExternal.java b/external-sop/src/main/java/sop/external/operation/InlineSignExternal.java index d78dd7b..68a630d 100644 --- a/external-sop/src/main/java/sop/external/operation/InlineSignExternal.java +++ b/external-sop/src/main/java/sop/external/operation/InlineSignExternal.java @@ -62,7 +62,7 @@ public class InlineSignExternal implements InlineSign { } @Override - public Ready data(InputStream data) throws IOException, SOPGPException.KeyIsProtected, SOPGPException.ExpectedText { + public Ready data(InputStream data) throws SOPGPException.KeyIsProtected, SOPGPException.ExpectedText { return ExternalSOP.executeTransformingOperation(Runtime.getRuntime(), commandList, envList, data); } } diff --git a/sop-java/src/testFixtures/java/sop/testsuite/operation/ListProfilesTest.java b/sop-java/src/testFixtures/java/sop/testsuite/operation/ListProfilesTest.java index f566dd3..6d3c4c4 100644 --- a/sop-java/src/testFixtures/java/sop/testsuite/operation/ListProfilesTest.java +++ b/sop-java/src/testFixtures/java/sop/testsuite/operation/ListProfilesTest.java @@ -11,7 +11,6 @@ import sop.Profile; import sop.SOP; import sop.exception.SOPGPException; -import java.io.IOException; import java.util.List; import java.util.stream.Stream; @@ -26,7 +25,7 @@ public class ListProfilesTest extends AbstractSOPTest { @ParameterizedTest @MethodSource("provideInstances") - public void listGenerateKeyProfiles(SOP sop) throws IOException { + public void listGenerateKeyProfiles(SOP sop) { List profiles = sop .listProfiles() .generateKey(); @@ -36,7 +35,7 @@ public class ListProfilesTest extends AbstractSOPTest { @ParameterizedTest @MethodSource("provideInstances") - public void listEncryptProfiles(SOP sop) throws IOException { + public void listEncryptProfiles(SOP sop) { List profiles = sop .listProfiles() .encrypt(); @@ -46,7 +45,7 @@ public class ListProfilesTest extends AbstractSOPTest { @ParameterizedTest @MethodSource("provideInstances") - public void listUnsupportedProfiles(SOP sop) throws IOException { + public void listUnsupportedProfiles(SOP sop) { assertThrows(SOPGPException.UnsupportedProfile.class, () -> sop .listProfiles() .subcommand("invalid"));