Remove declarations of unthrown IOException
Change-Id: I820c55ef258a1129dadb4d3f800eb7bd59804330
diff --git a/src/main/java/com/googlesource/gerrit/plugins/findowners/Action.java b/src/main/java/com/googlesource/gerrit/plugins/findowners/Action.java
index 2d5e78c..6e38b29 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/findowners/Action.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/findowners/Action.java
@@ -115,7 +115,7 @@
// Used by integration tests, because they do not have ReviewDb Provider.
public Response<RestResult> apply(ChangeResource rsrc, Parameters params)
- throws IOException, StorageException, BadRequestException {
+ throws StorageException, BadRequestException {
ChangeData changeData = changeDataFactory.create(rsrc.getChange());
return getChangeData(params, changeData);
}
@@ -155,7 +155,7 @@
/** REST API to return owners info of a change. */
public Response<RestResult> getChangeData(Parameters params, ChangeData changeData)
- throws StorageException, BadRequestException, IOException {
+ throws StorageException, BadRequestException {
int patchset = getValidPatchsetNum(changeData, params.patchset);
ProjectState projectState = projectCache.get(changeData.project());
Boolean useCache = params.nocache == null || !params.nocache;
@@ -235,7 +235,7 @@
.setLabel("Find Owners")
.setTitle("Find owners to add to Reviewers list")
.setVisible(needFindOwners);
- } catch (IOException | StorageException e) {
+ } catch (StorageException e) {
logger.atSevere().withCause(e).log("Exception for %s", Config.getChangeId(changeData));
throw new IllegalStateException(e);
}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/findowners/Cache.java b/src/main/java/com/googlesource/gerrit/plugins/findowners/Cache.java
index 71fa1f9..e3c9242 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/findowners/Cache.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/findowners/Cache.java
@@ -25,7 +25,6 @@
import com.google.gerrit.server.git.GitRepositoryManager;
import com.google.gerrit.server.project.ProjectState;
import com.google.gerrit.server.query.change.ChangeData;
-import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
@@ -98,7 +97,7 @@
GitRepositoryManager repoManager,
PluginConfigFactory configFactory,
ChangeData changeData)
- throws StorageException, IOException {
+ throws StorageException {
return get(
useCache,
projectState,
@@ -120,7 +119,7 @@
PluginConfigFactory configFactory,
ChangeData changeData,
int patchset)
- throws StorageException, IOException {
+ throws StorageException {
String branch = changeData.change().getDest().get();
String dbKey = Cache.makeKey(changeData.getId().get(), patchset, repoManager);
// TODO: get changed files of the given patchset?
diff --git a/src/main/java/com/googlesource/gerrit/plugins/findowners/Checker.java b/src/main/java/com/googlesource/gerrit/plugins/findowners/Checker.java
index c3422ef..6fae98f 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/findowners/Checker.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/findowners/Checker.java
@@ -26,7 +26,6 @@
import com.google.gerrit.server.query.change.ChangeData;
import com.google.gerrit.server.rules.StoredValues;
import com.googlecode.prolog_cafe.lang.Prolog;
-import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
@@ -135,14 +134,14 @@
minVoteLevel);
return checker.findApproval(
StoredValues.ACCOUNT_CACHE.get(engine), StoredValues.EMAILS.get(engine));
- } catch (StorageException | IOException e) {
+ } catch (StorageException e) {
logger.atSevere().withCause(e).log("Exception for %s ", Config.getChangeId(changeData));
return 0; // owner approval may or may not be required.
}
}
/** Returns 1 if owner approval is found, -1 if missing, 0 if unneeded. */
- int findApproval(AccountCache accountCache, Emails emails) throws StorageException, IOException {
+ int findApproval(AccountCache accountCache, Emails emails) throws StorageException {
if (isExemptFromOwnerApproval(changeData)) {
return 0;
}