Adapt to cache.evict now throwing IOException
This changed with https://gerrit-review.googlesource.com/#/c/79089
Change-Id: I0136c5972c878a9455338413596142c3f988a54d
diff --git a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/CreateServiceUser.java b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/CreateServiceUser.java
index 5f95945..77383ee 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/CreateServiceUser.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/CreateServiceUser.java
@@ -215,7 +215,7 @@
}
private void addToGroups(Account.Id accountId, String[] groupNames)
- throws OrmException {
+ throws OrmException, IOException {
for (String groupName : groupNames) {
AccountGroup group = groupCache.get(new AccountGroup.NameKey(groupName));
if (group != null) {
diff --git a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/DeleteActive.java b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/DeleteActive.java
index 814b80f..8be9738 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/DeleteActive.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/DeleteActive.java
@@ -23,6 +23,8 @@
import com.google.inject.Provider;
import com.google.inject.Singleton;
+import java.io.IOException;
+
@Singleton
class DeleteActive implements RestModifyView<ServiceUserResource, Input> {
private final Provider<com.google.gerrit.server.account.DeleteActive> deleteActive;
@@ -34,7 +36,7 @@
@Override
public Response<?> apply(ServiceUserResource rsrc, Input input)
- throws ResourceNotFoundException, OrmException {
+ throws ResourceNotFoundException, OrmException, IOException {
return deleteActive.get().apply(rsrc, input);
}
}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/PutActive.java b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/PutActive.java
index 6392dde..07c33d9 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/PutActive.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/PutActive.java
@@ -23,6 +23,8 @@
import com.google.inject.Provider;
import com.google.inject.Singleton;
+import java.io.IOException;
+
@Singleton
class PutActive implements RestModifyView<ServiceUserResource, Input> {
private final Provider<com.google.gerrit.server.account.PutActive> putActive;
@@ -34,7 +36,7 @@
@Override
public Response<String> apply(ServiceUserResource rsrc, Input input)
- throws ResourceNotFoundException, OrmException {
+ throws ResourceNotFoundException, OrmException, IOException {
return putActive.get().apply(rsrc, input);
}
}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/PutEmail.java b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/PutEmail.java
index 6304f0f..270850b 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/PutEmail.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/PutEmail.java
@@ -37,6 +37,8 @@
import com.googlesource.gerrit.plugins.serviceuser.PutEmail.Input;
+import java.io.IOException;
+
@Singleton
class PutEmail implements RestModifyView<ServiceUserResource, Input> {
public static class Input {
@@ -70,7 +72,7 @@
public Response<?> apply(ServiceUserResource rsrc, Input input)
throws AuthException, ResourceNotFoundException,
ResourceConflictException, MethodNotAllowedException, OrmException,
- BadRequestException, EmailException {
+ BadRequestException, EmailException, IOException {
Boolean emailAllowed = getConfig.get().apply(new ConfigResource()).allowEmail;
if ((emailAllowed == null || !emailAllowed)
&& !self.get().getCapabilities().canAdministrateServer()) {
diff --git a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/PutHttpPassword.java b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/PutHttpPassword.java
index 6294780..847e689 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/PutHttpPassword.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/PutHttpPassword.java
@@ -30,6 +30,8 @@
import org.apache.commons.codec.binary.Base64;
+import java.io.IOException;
+
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
@@ -67,7 +69,7 @@
@Override
public Response<String> apply(ServiceUserResource rsrc, Input input)
throws AuthException, ResourceConflictException,
- ResourceNotFoundException, OrmException {
+ ResourceNotFoundException, OrmException, IOException {
if (input == null) {
input = new Input();
}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/PutName.java b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/PutName.java
index d25f028..5558efc 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/serviceuser/PutName.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/serviceuser/PutName.java
@@ -24,6 +24,8 @@
import com.google.inject.Provider;
import com.google.inject.Singleton;
+import java.io.IOException;
+
@Singleton
class PutName implements RestModifyView<ServiceUserResource, Input> {
private Provider<com.google.gerrit.server.account.PutName> putName;
@@ -35,7 +37,8 @@
@Override
public Response<String> apply(ServiceUserResource rsrc, Input input)
- throws MethodNotAllowedException, ResourceNotFoundException, OrmException {
+ throws MethodNotAllowedException, ResourceNotFoundException, OrmException,
+ IOException {
return putName.get().apply(rsrc.getUser(), input);
}
}