Remove unnecessary calls to String.format in IOException ctors
Change-Id: I97328c47c3df0cd912abfb4e379b61917aff4b88
diff --git a/src/main/java/com/googlesource/gerrit/plugins/oauth/DexOAuthService.java b/src/main/java/com/googlesource/gerrit/plugins/oauth/DexOAuthService.java
index ae1ca98..55f373b 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/oauth/DexOAuthService.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/oauth/DexOAuthService.java
@@ -93,10 +93,10 @@
JsonElement emailElement = claimObject.get("email");
JsonElement nameElement = claimObject.get("name");
if (emailElement == null || emailElement.isJsonNull()) {
- throw new IOException(String.format("Response doesn't contain email field"));
+ throw new IOException("Response doesn't contain email field");
}
if (nameElement == null || nameElement.isJsonNull()) {
- throw new IOException(String.format("Response doesn't contain name field"));
+ throw new IOException("Response doesn't contain name field");
}
String email = emailElement.getAsString();
String name = nameElement.getAsString();
diff --git a/src/main/java/com/googlesource/gerrit/plugins/oauth/FacebookOAuthService.java b/src/main/java/com/googlesource/gerrit/plugins/oauth/FacebookOAuthService.java
index d3ebe8e..7461154 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/oauth/FacebookOAuthService.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/oauth/FacebookOAuthService.java
@@ -96,7 +96,7 @@
JsonObject jsonObject = userJson.getAsJsonObject();
JsonElement id = jsonObject.get("id");
if (id == null || id.isJsonNull()) {
- throw new IOException(String.format("Response doesn't contain id field"));
+ throw new IOException("Response doesn't contain id field");
}
JsonElement email = jsonObject.get("email");
JsonElement name = jsonObject.get("name");
diff --git a/src/main/java/com/googlesource/gerrit/plugins/oauth/GitHubOAuthService.java b/src/main/java/com/googlesource/gerrit/plugins/oauth/GitHubOAuthService.java
index 8a198d3..13f89cb 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/oauth/GitHubOAuthService.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/oauth/GitHubOAuthService.java
@@ -91,7 +91,7 @@
JsonObject jsonObject = userJson.getAsJsonObject();
JsonElement id = jsonObject.get("id");
if (id == null || id.isJsonNull()) {
- throw new IOException(String.format("Response doesn't contain id field"));
+ throw new IOException("Response doesn't contain id field");
}
JsonElement email = jsonObject.get("email");
JsonElement name = jsonObject.get("name");
diff --git a/src/main/java/com/googlesource/gerrit/plugins/oauth/GoogleOAuthService.java b/src/main/java/com/googlesource/gerrit/plugins/oauth/GoogleOAuthService.java
index 4a33b79..66e6831 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/oauth/GoogleOAuthService.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/oauth/GoogleOAuthService.java
@@ -115,7 +115,7 @@
JsonObject jsonObject = userJson.getAsJsonObject();
JsonElement id = jsonObject.get("id");
if (id == null || id.isJsonNull()) {
- throw new IOException(String.format("Response doesn't contain id field"));
+ throw new IOException("Response doesn't contain id field");
}
JsonElement email = jsonObject.get("email");
JsonElement name = jsonObject.get("name");
diff --git a/src/main/java/com/googlesource/gerrit/plugins/oauth/Office365OAuthService.java b/src/main/java/com/googlesource/gerrit/plugins/oauth/Office365OAuthService.java
index 360b650..e1ccd29 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/oauth/Office365OAuthService.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/oauth/Office365OAuthService.java
@@ -97,7 +97,7 @@
JsonObject jsonObject = userJson.getAsJsonObject();
JsonElement id = jsonObject.get("id");
if (id == null || id.isJsonNull()) {
- throw new IOException(String.format("Response doesn't contain id field"));
+ throw new IOException("Response doesn't contain id field");
}
JsonElement email = jsonObject.get("mail");
JsonElement name = jsonObject.get("displayName");