Upgrade codes

0.5
Li Shengzhao 2016-05-18 22:56:34 +08:00
parent 458c3a12ef
commit 0e192ba4f4
1 changed files with 2 additions and 3 deletions

View File

@ -82,7 +82,7 @@ public class OAuthRestController implements InitializingBean, ApplicationContext
TokenRequest tokenRequest = oAuth2RequestFactory.createTokenRequest(parameters, authenticatedClient);
if (clientId != null && !clientId.equals("")) {
if (clientId != null && !"".equals(clientId)) {
// Only validate the client details if a client authenticated during this
// request.
if (!clientId.equals(tokenRequest.getClientId())) {
@ -100,7 +100,7 @@ public class OAuthRestController implements InitializingBean, ApplicationContext
if (!StringUtils.hasText(grantType)) {
throw new InvalidRequestException("Missing grant type");
}
if (grantType.equals("implicit")) {
if ("implicit".equals(grantType)) {
throw new InvalidGrantException("Implicit grant type not supported from token endpoint");
}
@ -165,7 +165,6 @@ public class OAuthRestController implements InitializingBean, ApplicationContext
}
private boolean isRefreshTokenRequest(Map<String, String> parameters) {
return "refresh_token".equals(parameters.get("grant_type")) && parameters.get("refresh_token") != null;
}