Wrap ternary operator within parentheses as outlined in Code Style

Closes gh-25232
This commit is contained in:
GardenLee 2020-06-11 01:39:21 +09:00 committed by Sam Brannen
parent 663f2e8afd
commit e866fac8e7
4 changed files with 4 additions and 4 deletions

View File

@ -583,7 +583,7 @@ class ConcurrentReferenceHashMapTests {
}
// For testing we want more control of the hash
this.supplementalHash = super.getHash(o);
return o == null ? 0 : o.hashCode();
return (o == null ? 0 : o.hashCode());
}
public int getSupplementalHash() {

View File

@ -95,7 +95,7 @@ class HttpComponentsClientHttpResponse implements ClientHttpResponse {
private long getMaxAgeSeconds(Cookie cookie) {
String maxAgeAttribute = cookie.getAttribute(Cookie.MAX_AGE_ATTR);
return maxAgeAttribute == null ? -1 : Long.parseLong(maxAgeAttribute);
return (maxAgeAttribute == null ? -1 : Long.parseLong(maxAgeAttribute));
}
@Override

View File

@ -139,7 +139,7 @@ public class DefaultResponseErrorHandler implements ResponseErrorHandler {
return preface + "[no body]";
}
charset = charset == null ? StandardCharsets.UTF_8 : charset;
charset = (charset == null ? StandardCharsets.UTF_8 : charset);
int maxChars = 200;
if (responseBody.length < maxChars * 2) {

View File

@ -364,7 +364,7 @@ public class ForwardedHeaderFilter extends OncePerRequestFilter {
public String getContextPath() {
return this.forwardedPrefix == null ? this.delegate.get().getContextPath() : this.forwardedPrefix;
return (this.forwardedPrefix == null ? this.delegate.get().getContextPath() : this.forwardedPrefix);
}
public String getRequestUri() {