Remove unused exceptions Fix the related warnings in Eclipse. Change-Id: Idf793a9fd4b1e33621dedf9ec1a1d36cb9c40246
diff --git a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/CreateServiceUserNotes.java b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/CreateServiceUserNotes.java index eb10974..93fc84c 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/CreateServiceUserNotes.java +++ b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/CreateServiceUserNotes.java
@@ -25,12 +25,10 @@ import com.google.gerrit.server.GerritPersonIdent; import com.google.gerrit.server.config.AnonymousCowardName; import com.google.gerrit.server.git.NotesBranchUtil; -import com.google.gerrit.server.permissions.PermissionBackendException; import com.google.inject.Inject; import com.google.inject.assistedinject.Assisted; import com.googlesource.gerrit.plugins.serviceuser.GetServiceUser.ServiceUserInfo; import java.io.IOException; -import org.eclipse.jgit.errors.ConfigInvalidException; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectInserter; @@ -81,7 +79,7 @@ } void createNotes(String branch, ObjectId oldObjectId, ObjectId newObjectId) - throws IOException, ConfigInvalidException, PermissionBackendException, RestApiException { + throws IOException, RestApiException { if (ObjectId.zeroId().equals(newObjectId)) { return; } @@ -153,13 +151,13 @@ } private ObjectId createNoteContent(String branch, ServiceUserInfo serviceUser) - throws IOException, PermissionBackendException, RestApiException, RuntimeException { + throws IOException, RestApiException, RuntimeException { return getInserter() .insert(Constants.OBJ_BLOB, createServiceUserNote(branch, serviceUser).getBytes(UTF_8)); } private String createServiceUserNote(String branch, ServiceUserInfo serviceUser) - throws PermissionBackendException, RestApiException, RuntimeException { + throws RestApiException, RuntimeException { HeaderFormatter fmt = new HeaderFormatter(gerritServerIdent.getTimeZone(), anonymousCowardName); fmt.appendDate(); fmt.append("Project", project.get());
diff --git a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/RefUpdateListener.java b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/RefUpdateListener.java index 887f1e3..31d1a56 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/RefUpdateListener.java +++ b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/RefUpdateListener.java
@@ -23,11 +23,9 @@ import com.google.gerrit.server.git.GitRepositoryManager; import com.google.gerrit.server.git.ProjectRunnable; import com.google.gerrit.server.git.WorkQueue; -import com.google.gerrit.server.permissions.PermissionBackendException; import com.google.inject.Inject; import com.google.inject.Singleton; import java.io.IOException; -import org.eclipse.jgit.errors.ConfigInvalidException; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.Repository; import org.slf4j.Logger; @@ -107,10 +105,7 @@ ObjectId.fromString(e.getOldObjectId()), ObjectId.fromString(e.getNewObjectId())); crn.commitNotes(); - } catch (IOException - | ConfigInvalidException - | PermissionBackendException - | RestApiException x) { + } catch (IOException | RestApiException x) { log.error(x.getMessage(), x); } }