GitLabApi: Fix eclipse warnings
Change-Id: Ib95f3d7c7cd75d60a269e183547b283a8291b1fd
diff --git a/src/main/java/com/googlesource/gerrit/plugins/oauth/GitLabApi.java b/src/main/java/com/googlesource/gerrit/plugins/oauth/GitLabApi.java
index 9cc7618..f4ee8b7 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/oauth/GitLabApi.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/oauth/GitLabApi.java
@@ -17,16 +17,19 @@
import org.scribe.builder.api.DefaultApi20;
import org.scribe.exceptions.OAuthException;
import org.scribe.extractors.AccessTokenExtractor;
-import org.scribe.model.*;
+import org.scribe.model.OAuthConfig;
+import org.scribe.model.OAuthConstants;
+import org.scribe.model.OAuthRequest;
+import org.scribe.model.Response;
+import org.scribe.model.Token;
+import org.scribe.model.Verb;
+import org.scribe.model.Verifier;
import org.scribe.oauth.OAuthService;
-
import org.scribe.utils.Preconditions;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import static java.lang.String.format;
-
public class GitLabApi extends DefaultApi20 {
private static final String AUTHORIZE_URL =
"%s/oauth/authorize?client_id=%s&response_type=code&redirect_uri=%s";
@@ -152,10 +155,9 @@
Matcher matcher = accessTokenPattern.matcher(response);
if (matcher.find()) {
return new Token(matcher.group(1), "", response);
- } else {
- throw new OAuthException(
- "Cannot extract an acces token. Response was: " + response);
}
+ throw new OAuthException(
+ "Cannot extract an acces token. Response was: " + response);
}
}
}