Wrap ternary operator within parentheses

See gh-31076
This commit is contained in:
70825 2023-08-19 15:35:33 +09:00 committed by Stephane Nicoll
parent a55b50b512
commit 6712c044b1
4 changed files with 7 additions and 7 deletions

View File

@ -76,7 +76,7 @@ public class ResourceDecoder extends AbstractDataBufferDecoder<Resource> {
}
Class<?> clazz = elementType.toClass();
String filename = hints != null ? (String) hints.get(FILENAME_HINT) : null;
String filename = (hints != null ? (String) hints.get(FILENAME_HINT) : null);
if (clazz == InputStreamResource.class) {
return new InputStreamResource(new ByteArrayInputStream(bytes)) {
@Override

View File

@ -399,7 +399,7 @@ public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport
}
protected String formatMappingName() {
return this.beanName != null ? "'" + this.beanName + "'" : getClass().getName();
return (this.beanName != null ? "'" + this.beanName + "'" : getClass().getName());
}
@ -589,9 +589,9 @@ public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport
private RequestPath getRequestPath(HttpServletRequest request) {
// Expect pre-parsed path with DispatcherServlet,
// but otherwise parse per handler lookup + cache for handling
return request.getAttribute(DispatcherServlet.WEB_APPLICATION_CONTEXT_ATTRIBUTE) != null ?
return (request.getAttribute(DispatcherServlet.WEB_APPLICATION_CONTEXT_ATTRIBUTE) != null ?
ServletRequestPathUtils.getParsedRequestPath(request) :
ServletRequestPathUtils.parseAndCache(request);
ServletRequestPathUtils.parseAndCache(request));
}
/**

View File

@ -676,7 +676,7 @@ public class ResourceHttpRequestHandler extends WebContentGenerator
prev = curr;
}
}
return sb != null ? sb.toString() : path;
return (sb != null ? sb.toString() : path);
}
private String cleanLeadingSlash(String path) {

View File

@ -233,8 +233,8 @@ public class ContentNegotiatingViewResolver extends WebApplicationObjectSupport
}
}
String mediaTypeInfo = logger.isDebugEnabled() && requestedMediaTypes != null ?
" given " + requestedMediaTypes.toString() : "";
String mediaTypeInfo = (logger.isDebugEnabled() && requestedMediaTypes != null ?
" given " + requestedMediaTypes.toString() : "");
if (this.useNotAcceptableStatusCode) {
if (logger.isDebugEnabled()) {