Do not declare unchecked StorageException. * To suppress some Java coding style warnings. Change-Id: I7cdcec512f760c9af1b82370ee88b4684f7982c3
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 0e80906..c9b39fe 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/findowners/Action.java +++ b/src/main/java/com/googlesource/gerrit/plugins/findowners/Action.java
@@ -112,14 +112,13 @@ } @Override - public Response<RestResult> apply(RevisionResource rev) - throws IOException, StorageException, BadRequestException { + public Response<RestResult> apply(RevisionResource rev) throws IOException, BadRequestException { return apply(rev.getChangeResource(), new Parameters()); } // Used by integration tests, because they do not have ReviewDb Provider. public Response<RestResult> apply(ChangeResource rsrc, Parameters params) - throws StorageException, BadRequestException { + throws BadRequestException { ChangeData changeData = changeDataFactory.create(rsrc.getChange()); return getChangeData(params, changeData); } @@ -142,7 +141,7 @@ /** Returns the current patchset number or the given patchsetNum if it is valid. */ static int getValidPatchsetNum(ChangeData changeData, Integer patchsetNum) - throws StorageException, BadRequestException { + throws BadRequestException { int patchset = changeData.currentPatchSet().id().get(); if (patchsetNum != null) { if (patchsetNum < 1 || patchsetNum > patchset) { @@ -159,7 +158,7 @@ /** REST API to return owners info of a change. */ public Response<RestResult> getChangeData(Parameters params, ChangeData changeData) - throws StorageException, BadRequestException { + throws BadRequestException { int patchset = getValidPatchsetNum(changeData, params.patchset); ProjectState projectState = projectCache.get(changeData.project()); Boolean useCache = params.nocache == null || !params.nocache;
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 0a54970..62b124d 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/findowners/Cache.java +++ b/src/main/java/com/googlesource/gerrit/plugins/findowners/Cache.java
@@ -16,7 +16,6 @@ import com.google.common.cache.CacheBuilder; import com.google.common.flogger.FluentLogger; -import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.server.account.AccountCache; import com.google.gerrit.server.account.Emails; import com.google.gerrit.server.git.GitRepositoryManager; @@ -100,8 +99,7 @@ AccountCache accountCache, Emails emails, GitRepositoryManager repoManager, - ChangeData changeData) - throws StorageException { + ChangeData changeData) { return get( useCache, permissionBackend, @@ -122,8 +120,7 @@ Emails emails, GitRepositoryManager repoManager, ChangeData changeData, - int patchset) - throws StorageException { + int patchset) { String branch = changeData.change().getDest().branch(); 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/GetOwners.java b/src/main/java/com/googlesource/gerrit/plugins/findowners/GetOwners.java index b786ecc..411ce02 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/findowners/GetOwners.java +++ b/src/main/java/com/googlesource/gerrit/plugins/findowners/GetOwners.java
@@ -15,7 +15,6 @@ package com.googlesource.gerrit.plugins.findowners; import com.google.common.flogger.FluentLogger; -import com.google.gerrit.exceptions.StorageException; import com.google.gerrit.extensions.restapi.BadRequestException; import com.google.gerrit.extensions.restapi.Response; import com.google.gerrit.extensions.restapi.RestReadView; @@ -77,7 +76,7 @@ } @Override - public Response<RestResult> apply(ChangeResource rsrc) throws IOException, StorageException { + public Response<RestResult> apply(ChangeResource rsrc) throws IOException { Action.Parameters params = new Action.Parameters(); params.patchset = patchset; params.debug = (debug != null) ? Util.parseBoolean(debug) : null;