Statement unnecessarily nested within else clause.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1726950 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
40140009a1
commit
8c840c918b
|
@ -109,7 +109,7 @@ public class AuthChallengeParser {
|
|||
}
|
||||
}
|
||||
return new AuthChallenge(scheme, null, params.size() > 0 ? params : null);
|
||||
} else {
|
||||
}
|
||||
if (params.size() == 1) {
|
||||
final NameValuePair nvp = params.get(0);
|
||||
if (nvp.getValue() == null) {
|
||||
|
@ -118,6 +118,5 @@ public class AuthChallengeParser {
|
|||
}
|
||||
throw new ParseException("Malformed auth challenge");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -89,9 +89,8 @@ public class BasicAuthCache implements AuthCache {
|
|||
return host;
|
||||
}
|
||||
return new HttpHost(host.getHostName(), port, host.getSchemeName());
|
||||
} else {
|
||||
return host;
|
||||
}
|
||||
return host;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -141,9 +140,8 @@ public class BasicAuthCache implements AuthCache {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -145,12 +145,11 @@ public class BasicScheme implements AuthScheme, Serializable {
|
|||
this.username = credentials.getUserPrincipal().getName();
|
||||
this.password = credentials.getPassword();
|
||||
return true;
|
||||
} else {
|
||||
}
|
||||
this.username = null;
|
||||
this.password = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Principal getPrincipal() {
|
||||
|
|
|
@ -160,11 +160,7 @@ public class DigestScheme implements AuthScheme, Serializable {
|
|||
@Override
|
||||
public boolean isChallengeComplete() {
|
||||
final String s = this.paramMap.get("stale");
|
||||
if ("true".equalsIgnoreCase(s)) {
|
||||
return false;
|
||||
} else {
|
||||
return this.complete;
|
||||
}
|
||||
return "true".equalsIgnoreCase(s) ? false : this.complete;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -181,12 +177,11 @@ public class DigestScheme implements AuthScheme, Serializable {
|
|||
this.username = credentials.getUserPrincipal().getName();
|
||||
this.password = credentials.getPassword();
|
||||
return true;
|
||||
} else {
|
||||
}
|
||||
this.username = null;
|
||||
this.password = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Principal getPrincipal() {
|
||||
|
|
|
@ -105,7 +105,7 @@ public class HttpAuthenticator {
|
|||
clearCache(host, clientContext);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
}
|
||||
switch (authExchange.getState()) {
|
||||
case CHALLENGED:
|
||||
case HANDSHAKE:
|
||||
|
@ -120,7 +120,6 @@ public class HttpAuthenticator {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean prepareAuthResponse(
|
||||
final HttpHost host,
|
||||
|
@ -210,16 +209,14 @@ public class HttpAuthenticator {
|
|||
authExchange.reset();
|
||||
authExchange.setState(AuthExchange.State.FAILURE);
|
||||
return false;
|
||||
} else {
|
||||
}
|
||||
authExchange.setState(AuthExchange.State.HANDSHAKE);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
authExchange.reset();
|
||||
// Retry authentication with a different scheme
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final List<AuthScheme> preferredSchemes = authStrategy.select(challengeType, challengeMap, context);
|
||||
final CredentialsProvider credsProvider = clientContext.getCredentialsProvider();
|
||||
|
@ -251,9 +248,8 @@ public class HttpAuthenticator {
|
|||
authExchange.setState(AuthExchange.State.CHALLENGED);
|
||||
authExchange.setOptions(authOptions);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void addAuthResponse(
|
||||
|
@ -299,9 +295,8 @@ public class HttpAuthenticator {
|
|||
}
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
Asserts.notNull(authScheme, "AuthScheme");
|
||||
}
|
||||
Asserts.notNull(authScheme, "AuthScheme");
|
||||
default:
|
||||
}
|
||||
if (authScheme != null) {
|
||||
|
|
|
@ -133,9 +133,8 @@ public class NTLMScheme implements AuthScheme {
|
|||
if (credentials instanceof NTCredentials) {
|
||||
this.credentials = (NTCredentials) credentials;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue