Polish ternary expressions
This commit is contained in:
@@ -224,7 +224,7 @@ public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>, O exten
|
||||
}
|
||||
|
||||
private <T> T getLast(List<T> list) {
|
||||
return (CollectionUtils.isEmpty(list) ? null : list.get(list.size() - 1));
|
||||
return CollectionUtils.isEmpty(list) ? null : list.get(list.size() - 1);
|
||||
}
|
||||
|
||||
private void assertNoDuplicateOperations(EndpointBean endpointBean,
|
||||
|
||||
@@ -61,7 +61,7 @@ public class ServletEndpointRegistrar implements ServletContextInitializer {
|
||||
ExposableServletEndpoint endpoint) {
|
||||
String name = endpoint.getId() + "-actuator-endpoint";
|
||||
String path = this.basePath + "/" + endpoint.getRootPath();
|
||||
String urlMapping = (path.endsWith("/") ? path + "*" : path + "/*");
|
||||
String urlMapping = path.endsWith("/") ? path + "*" : path + "/*";
|
||||
EndpointServlet endpointServlet = endpoint.getEndpointServlet();
|
||||
Dynamic registration = servletContext.addServlet(name,
|
||||
endpointServlet.getServlet());
|
||||
|
||||
@@ -188,7 +188,7 @@ public class JerseyEndpointResourceFactory {
|
||||
private Response convertToJaxRsResponse(Object response, String httpMethod) {
|
||||
if (response == null) {
|
||||
boolean isGet = HttpMethod.GET.equals(httpMethod);
|
||||
Status status = (isGet ? Status.NOT_FOUND : Status.NO_CONTENT);
|
||||
Status status = isGet ? Status.NOT_FOUND : Status.NO_CONTENT;
|
||||
return Response.status(status).build();
|
||||
}
|
||||
try {
|
||||
|
||||
@@ -132,7 +132,7 @@ public class MetricsEndpoint {
|
||||
}
|
||||
|
||||
private BiFunction<Double, Double, Double> mergeFunction(Statistic statistic) {
|
||||
return (Statistic.MAX.equals(statistic) ? Double::max : Double::sum);
|
||||
return Statistic.MAX.equals(statistic) ? Double::max : Double::sum;
|
||||
}
|
||||
|
||||
private Map<String, Set<String>> getAvailableTags(List<Meter> meters) {
|
||||
|
||||
@@ -123,7 +123,7 @@ public final class WebMvcTags {
|
||||
|
||||
private static String getPathInfo(HttpServletRequest request) {
|
||||
String pathInfo = request.getPathInfo();
|
||||
String uri = (StringUtils.hasText(pathInfo) ? pathInfo : "/");
|
||||
String uri = StringUtils.hasText(pathInfo) ? pathInfo : "/";
|
||||
return uri.replaceAll("//+", "/").replaceAll("/$", "");
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ public class HttpExchangeTracer {
|
||||
}
|
||||
|
||||
private <T> T getIfIncluded(Include include, Supplier<T> valueSupplier) {
|
||||
return (this.includes.contains(include) ? valueSupplier.get() : null);
|
||||
return this.includes.contains(include) ? valueSupplier.get() : null;
|
||||
}
|
||||
|
||||
private <T> void setIfIncluded(Include include, Supplier<T> supplier,
|
||||
|
||||
Reference in New Issue
Block a user