Skip to content

Commit 7fc4556

Browse files
committed
Fix checkstyle ternary issues
Fix checkstyle issues with ternary expressions following the spring-javaformat upgrade. See spring-projectsgh-13932
1 parent ec1100a commit 7fc4556

File tree

293 files changed

+714
-685
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

293 files changed

+714
-685
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscoverer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private boolean isHealthEndpointExtension(Object extensionBean) {
7272
AnnotationAttributes attributes = AnnotatedElementUtils
7373
.getMergedAnnotationAttributes(extensionBean.getClass(),
7474
EndpointWebExtension.class);
75-
Class<?> endpoint = (attributes != null ? attributes.getClass("endpoint") : null);
75+
Class<?> endpoint = (attributes != null) ? attributes.getClass("endpoint") : null;
7676
return (endpoint != null && HealthEndpoint.class.isAssignableFrom(endpoint));
7777
}
7878

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundryActuatorAutoConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ private ReactiveCloudFoundrySecurityService getCloudFoundrySecurityService(
126126
String cloudControllerUrl = environment.getProperty("vcap.application.cf_api");
127127
boolean skipSslValidation = environment.getProperty(
128128
"management.cloudfoundry.skip-ssl-validation", Boolean.class, false);
129-
return (cloudControllerUrl != null ? new ReactiveCloudFoundrySecurityService(
130-
webClientBuilder, cloudControllerUrl, skipSslValidation) : null);
129+
return (cloudControllerUrl != null) ? new ReactiveCloudFoundrySecurityService(
130+
webClientBuilder, cloudControllerUrl, skipSslValidation) : null;
131131
}
132132

133133
private CorsConfiguration getCorsConfiguration() {

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ private CloudFoundrySecurityService getCloudFoundrySecurityService(
130130
String cloudControllerUrl = environment.getProperty("vcap.application.cf_api");
131131
boolean skipSslValidation = environment.getProperty(
132132
"management.cloudfoundry.skip-ssl-validation", Boolean.class, false);
133-
return (cloudControllerUrl != null ? new CloudFoundrySecurityService(
134-
restTemplateBuilder, cloudControllerUrl, skipSslValidation) : null);
133+
return (cloudControllerUrl != null) ? new CloudFoundrySecurityService(
134+
restTemplateBuilder, cloudControllerUrl, skipSslValidation) : null;
135135
}
136136

137137
private CorsConfiguration getCorsConfiguration() {

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/condition/ConditionsReportEndpoint.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ public ContextConditionEvaluation(ConfigurableApplicationContext context) {
125125
this.unconditionalClasses = report.getUnconditionalClasses();
126126
report.getConditionAndOutcomesBySource().forEach(
127127
(source, conditionAndOutcomes) -> add(source, conditionAndOutcomes));
128-
this.parentId = (context.getParent() != null ? context.getParent().getId()
129-
: null);
128+
this.parentId = (context.getParent() != null) ? context.getParent().getId()
129+
: null;
130130
}
131131

132132
private void add(String source, ConditionAndOutcomes conditionAndOutcomes) {

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticsearchHealthIndicatorAutoConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public HealthIndicator elasticsearchHealthIndicator() {
8282
protected ElasticsearchHealthIndicator createHealthIndicator(Client client) {
8383
Duration responseTimeout = this.properties.getResponseTimeout();
8484
return new ElasticsearchHealthIndicator(client,
85-
responseTimeout != null ? responseTimeout.toMillis() : 100,
85+
(responseTimeout != null) ? responseTimeout.toMillis() : 100,
8686
this.properties.getIndices());
8787
}
8888

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/jdbc/DataSourceHealthIndicatorAutoConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ protected DataSourceHealthIndicator createHealthIndicator(DataSource source) {
112112
private String getValidationQuery(DataSource source) {
113113
DataSourcePoolMetadata poolMetadata = this.poolMetadataProvider
114114
.getDataSourcePoolMetadata(source);
115-
return (poolMetadata != null ? poolMetadata.getValidationQuery() : null);
115+
return (poolMetadata != null) ? poolMetadata.getValidationQuery() : null;
116116
}
117117

118118
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterRegistryConfigurer.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ class MeterRegistryConfigurer {
5151
Collection<MeterFilter> filters,
5252
Collection<MeterRegistryCustomizer<?>> customizers,
5353
boolean addToGlobalRegistry) {
54-
this.binders = (binders != null ? binders : Collections.emptyList());
55-
this.filters = (filters != null ? filters : Collections.emptyList());
56-
this.customizers = (customizers != null ? customizers : Collections.emptyList());
54+
this.binders = (binders != null) ? binders : Collections.emptyList();
55+
this.filters = (filters != null) ? filters : Collections.emptyList();
56+
this.customizers = (customizers != null) ? customizers : Collections.emptyList();
5757
this.addToGlobalRegistry = addToGlobalRegistry;
5858
}
5959

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilter.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ public DistributionStatisticConfig configure(Meter.Id id,
6767
}
6868

6969
private long[] convertSla(Meter.Type meterType, ServiceLevelAgreementBoundary[] sla) {
70-
long[] converted = Arrays.stream(sla != null ? sla : EMPTY_SLA)
70+
long[] converted = Arrays.stream((sla != null) ? sla : EMPTY_SLA)
7171
.map((candidate) -> candidate.getValue(meterType))
7272
.filter(Objects::nonNull).mapToLong(Long::longValue).toArray();
73-
return (converted.length != 0 ? converted : null);
73+
return (converted.length != 0) ? converted : null;
7474
}
7575

7676
private <T> T lookup(Map<String, T> values, Id id, T defaultValue) {
@@ -84,7 +84,7 @@ private <T> T lookup(Map<String, T> values, Id id, T defaultValue) {
8484
return result;
8585
}
8686
int lastDot = name.lastIndexOf('.');
87-
name = (lastDot != -1 ? name.substring(0, lastDot) : "");
87+
name = (lastDot != -1) ? name.substring(0, lastDot) : "";
8888
}
8989
return values.getOrDefault("all", defaultValue);
9090
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/properties/PropertiesConfigAdapter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public PropertiesConfigAdapter(T properties) {
5151
*/
5252
protected final <V> V get(Function<T, V> getter, Supplier<V> fallback) {
5353
V value = getter.apply(this.properties);
54-
return (value != null ? value : fallback.get());
54+
return (value != null) ? value : fallback.get();
5555
}
5656

5757
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/wavefront/WavefrontPropertiesConfigAdapter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public String globalPrefix() {
6060
}
6161

6262
private String getUriAsString(WavefrontProperties properties) {
63-
return (properties.getUri() != null ? properties.getUri().toString() : null);
63+
return (properties.getUri() != null) ? properties.getUri().toString() : null;
6464
}
6565

6666
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/tomcat/TomcatMetricsAutoConfiguration.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public class TomcatMetricsAutoConfiguration {
4747
@Bean
4848
@ConditionalOnMissingBean
4949
public TomcatMetrics tomcatMetrics() {
50-
return new TomcatMetrics(this.context != null ? this.context.getManager() : null,
50+
return new TomcatMetrics(
51+
(this.context != null) ? this.context.getManager() : null,
5152
Collections.emptyList());
5253
}
5354

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementContextConfigurationImportSelector.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,17 @@ private ManagementContextType readContextType(
125125
Map<String, Object> annotationAttributes = annotationMetadata
126126
.getAnnotationAttributes(
127127
ManagementContextConfiguration.class.getName());
128-
return (annotationAttributes != null
128+
return (annotationAttributes != null)
129129
? (ManagementContextType) annotationAttributes.get("value")
130-
: ManagementContextType.ANY);
130+
: ManagementContextType.ANY;
131131
}
132132

133133
private int readOrder(AnnotationMetadata annotationMetadata) {
134134
Map<String, Object> attributes = annotationMetadata
135135
.getAnnotationAttributes(Order.class.getName());
136-
Integer order = (attributes != null ? (Integer) attributes.get("value")
137-
: null);
138-
return (order != null ? order : Ordered.LOWEST_PRECEDENCE);
136+
Integer order = (attributes != null) ? (Integer) attributes.get("value")
137+
: null;
138+
return (order != null) ? order : Ordered.LOWEST_PRECEDENCE;
139139
}
140140

141141
public String getClassName() {

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementPortType.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -47,9 +47,9 @@ static ManagementPortType get(Environment environment) {
4747
if (managementPort != null && managementPort < 0) {
4848
return DISABLED;
4949
}
50-
return ((managementPort == null)
50+
return ((managementPort == null
5151
|| (serverPort == null && managementPort.equals(8080))
52-
|| (managementPort != 0 && managementPort.equals(serverPort)) ? SAME
52+
|| (managementPort != 0 && managementPort.equals(serverPort))) ? SAME
5353
: DIFFERENT);
5454
}
5555

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/MockServletWebServerFactory.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ public MockServletWebServer getWebServer() {
5252
}
5353

5454
public ServletContext getServletContext() {
55-
return (getWebServer() != null ? getWebServer().getServletContext() : null);
55+
return (getWebServer() != null) ? getWebServer().getServletContext() : null;
5656
}
5757

5858
public RegisteredServlet getRegisteredServlet(int index) {
59-
return (getWebServer() != null ? getWebServer().getRegisteredServlet(index)
60-
: null);
59+
return (getWebServer() != null) ? getWebServer().getRegisteredServlet(index)
60+
: null;
6161
}
6262

6363
public RegisteredFilter getRegisteredFilter(int index) {
64-
return (getWebServer() != null ? getWebServer().getRegisteredFilters(index)
65-
: null);
64+
return (getWebServer() != null) ? getWebServer().getRegisteredFilters(index)
65+
: null;
6666
}
6767

6868
public static class MockServletWebServer

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/AuditEvent.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public AuditEvent(Instant timestamp, String principal, String type,
8686
Assert.notNull(timestamp, "Timestamp must not be null");
8787
Assert.notNull(type, "Type must not be null");
8888
this.timestamp = timestamp;
89-
this.principal = (principal != null ? principal : "");
89+
this.principal = (principal != null) ? principal : "";
9090
this.type = type;
9191
this.data = Collections.unmodifiableMap(data);
9292
}

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/AuditEventsEndpoint.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public AuditEventsDescriptor events(@Nullable String principal,
5050
}
5151

5252
private Instant getInstant(OffsetDateTime offsetDateTime) {
53-
return (offsetDateTime != null ? offsetDateTime.toInstant() : null);
53+
return (offsetDateTime != null) ? offsetDateTime.toInstant() : null;
5454
}
5555

5656
/**

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/beans/BeansEndpoint.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ private static ContextBeans describing(ConfigurableApplicationContext context) {
118118
}
119119
ConfigurableApplicationContext parent = getConfigurableParent(context);
120120
return new ContextBeans(describeBeans(context.getBeanFactory()),
121-
parent != null ? parent.getId() : null);
121+
(parent != null) ? parent.getId() : null);
122122
}
123123

124124
private static Map<String, BeanDescriptor> describeBeans(

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ private ContextConfigurationProperties describeConfigurationProperties(
118118
prefix, sanitize(prefix, safeSerialize(mapper, bean, prefix))));
119119
});
120120
return new ContextConfigurationProperties(beanDescriptors,
121-
context.getParent() != null ? context.getParent().getId() : null);
121+
(context.getParent() != null) ? context.getParent().getId() : null);
122122
}
123123

124124
private ConfigurationBeanFactoryMetadata getBeanFactoryMetadata(

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchHealthIndicator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class ElasticsearchHealthIndicator extends AbstractHealthIndicator {
5555
public ElasticsearchHealthIndicator(Client client, long responseTimeout,
5656
List<String> indices) {
5757
this(client, responseTimeout,
58-
(indices != null ? StringUtils.toStringArray(indices) : null));
58+
(indices != null) ? StringUtils.toStringArray(indices) : null);
5959
}
6060

6161
/**

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/JacksonJmxOperationResponseMapper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class JacksonJmxOperationResponseMapper implements JmxOperationResponseMa
3939
private final JavaType mapType;
4040

4141
public JacksonJmxOperationResponseMapper(ObjectMapper objectMapper) {
42-
this.objectMapper = (objectMapper != null ? objectMapper : new ObjectMapper());
42+
this.objectMapper = (objectMapper != null) ? objectMapper : new ObjectMapper();
4343
this.listType = this.objectMapper.getTypeFactory()
4444
.constructParametricType(List.class, Object.class);
4545
this.mapType = this.objectMapper.getTypeFactory()

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/PathMappedEndpoints.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class PathMappedEndpoints implements Iterable<PathMappedEndpoint> {
4646
*/
4747
public PathMappedEndpoints(String basePath, EndpointsSupplier<?> supplier) {
4848
Assert.notNull(supplier, "Supplier must not be null");
49-
this.basePath = (basePath != null ? basePath : "");
49+
this.basePath = (basePath != null) ? basePath : "";
5050
this.endpoints = getEndpoints(Collections.singleton(supplier));
5151
}
5252

@@ -58,7 +58,7 @@ public PathMappedEndpoints(String basePath, EndpointsSupplier<?> supplier) {
5858
public PathMappedEndpoints(String basePath,
5959
Collection<EndpointsSupplier<?>> suppliers) {
6060
Assert.notNull(suppliers, "Suppliers must not be null");
61-
this.basePath = (basePath != null ? basePath : "");
61+
this.basePath = (basePath != null) ? basePath : "";
6262
this.endpoints = getEndpoints(suppliers);
6363
}
6464

@@ -91,7 +91,7 @@ public String getBasePath() {
9191
*/
9292
public String getRootPath(String endpointId) {
9393
PathMappedEndpoint endpoint = getEndpoint(endpointId);
94-
return (endpoint != null ? endpoint.getRootPath() : null);
94+
return (endpoint != null) ? endpoint.getRootPath() : null;
9595
}
9696

9797
/**
@@ -144,7 +144,7 @@ public Iterator<PathMappedEndpoint> iterator() {
144144
}
145145

146146
private String getPath(PathMappedEndpoint endpoint) {
147-
return (endpoint != null ? this.basePath + "/" + endpoint.getRootPath() : null);
147+
return (endpoint != null) ? this.basePath + "/" + endpoint.getRootPath() : null;
148148
}
149149

150150
private <T> List<T> asList(Stream<T> stream) {

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class ServletEndpointRegistrar implements ServletContextInitializer {
4747
public ServletEndpointRegistrar(String basePath,
4848
Collection<ExposableServletEndpoint> servletEndpoints) {
4949
Assert.notNull(servletEndpoints, "ServletEndpoints must not be null");
50-
this.basePath = (basePath != null ? basePath : "");
50+
this.basePath = (basePath != null) ? basePath : "";
5151
this.servletEndpoints = servletEndpoints;
5252
}
5353

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/jersey/JerseyEndpointResourceFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ private Map<String, Object> extract(
179179
Map<String, Object> result = new HashMap<>();
180180
multivaluedMap.forEach((name, values) -> {
181181
if (!CollectionUtils.isEmpty(values)) {
182-
result.put(name, values.size() != 1 ? values : values.get(0));
182+
result.put(name, (values.size() != 1) ? values : values.get(0));
183183
}
184184
});
185185
return result;

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ private Map<String, Object> getArguments(ServerWebExchange exchange,
310310
arguments.putAll(body);
311311
}
312312
exchange.getRequest().getQueryParams().forEach((name, values) -> arguments
313-
.put(name, values.size() != 1 ? values : values.get(0)));
313+
.put(name, (values.size() != 1) ? values : values.get(0)));
314314
return arguments;
315315
}
316316

@@ -324,7 +324,7 @@ private Mono<ResponseEntity<Object>> handleResult(Publisher<?> result,
324324
.onErrorMap(InvalidEndpointRequestException.class,
325325
(ex) -> new ResponseStatusException(HttpStatus.BAD_REQUEST,
326326
ex.getReason()))
327-
.defaultIfEmpty(new ResponseEntity<>(httpMethod != HttpMethod.GET
327+
.defaultIfEmpty(new ResponseEntity<>((httpMethod != HttpMethod.GET)
328328
? HttpStatus.NO_CONTENT : HttpStatus.NOT_FOUND));
329329
}
330330

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ private Map<String, Object> getArguments(HttpServletRequest request,
257257
arguments.putAll(body);
258258
}
259259
request.getParameterMap().forEach((name, values) -> arguments.put(name,
260-
values.length != 1 ? Arrays.asList(values) : values[0]));
260+
(values.length != 1) ? Arrays.asList(values) : values[0]));
261261
return arguments;
262262
}
263263

@@ -269,7 +269,7 @@ private Map<String, String> getTemplateVariables(HttpServletRequest request) {
269269

270270
private Object handleResult(Object result, HttpMethod httpMethod) {
271271
if (result == null) {
272-
return new ResponseEntity<>(httpMethod != HttpMethod.GET
272+
return new ResponseEntity<>((httpMethod != HttpMethod.GET)
273273
? HttpStatus.NO_CONTENT : HttpStatus.NOT_FOUND);
274274
}
275275
if (!(result instanceof WebEndpointResponse)) {

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/env/EnvironmentEndpoint.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ private PropertyValueDescriptor describeValueOf(String name, PropertySource<?> s
160160

161161
private String getOrigin(OriginLookup<Object> lookup, String name) {
162162
Origin origin = lookup.getOrigin(name);
163-
return (origin != null ? origin.toString() : null);
163+
return (origin != null) ? origin.toString() : null;
164164
}
165165

166166
private PlaceholdersResolver getResolver() {

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/flyway/FlywayEndpoint.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public ApplicationFlywayBeans flywayBeans() {
5959
.put(name, new FlywayDescriptor(flyway.info().all())));
6060
ApplicationContext parent = target.getParent();
6161
contextFlywayBeans.put(target.getId(), new ContextFlywayBeans(flywayBeans,
62-
parent != null ? parent.getId() : null));
62+
(parent != null) ? parent.getId() : null));
6363
target = parent;
6464
}
6565
return new ApplicationFlywayBeans(contextFlywayBeans);
@@ -170,7 +170,7 @@ private FlywayMigration(MigrationInfo info) {
170170
}
171171

172172
private String nullSafeToString(Object obj) {
173-
return (obj != null ? obj.toString() : null);
173+
return (obj != null) ? obj.toString() : null;
174174
}
175175

176176
public MigrationType getType() {

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicator.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ public CompositeReactiveHealthIndicator(HealthAggregator healthAggregator,
5757
Assert.notNull(indicators, "Indicators must not be null");
5858
this.indicators = new LinkedHashMap<>(indicators);
5959
this.healthAggregator = healthAggregator;
60-
this.timeoutCompose = (mono) -> (this.timeout != null ? mono.timeout(
61-
Duration.ofMillis(this.timeout), Mono.just(this.timeoutHealth)) : mono);
60+
this.timeoutCompose = (mono) -> (this.timeout != null) ? mono.timeout(
61+
Duration.ofMillis(this.timeout), Mono.just(this.timeoutHealth)) : mono;
6262
}
6363

6464
/**
@@ -85,8 +85,8 @@ public CompositeReactiveHealthIndicator addHealthIndicator(String name,
8585
public CompositeReactiveHealthIndicator timeoutStrategy(long timeout,
8686
Health timeoutHealth) {
8787
this.timeout = timeout;
88-
this.timeoutHealth = (timeoutHealth != null ? timeoutHealth
89-
: Health.unknown().build());
88+
this.timeoutHealth = (timeoutHealth != null) ? timeoutHealth
89+
: Health.unknown().build();
9090
return this;
9191
}
9292

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/OrderedHealthAggregator.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -98,7 +98,7 @@ private class StatusComparator implements Comparator<Status> {
9898
public int compare(Status s1, Status s2) {
9999
int i1 = this.statusOrder.indexOf(s1.getCode());
100100
int i2 = this.statusOrder.indexOf(s2.getCode());
101-
return (i1 < i2 ? -1 : (i1 != i2 ? 1 : s1.getCode().compareTo(s2.getCode())));
101+
return (i1 < i2) ? -1 : (i1 != i2) ? 1 : s1.getCode().compareTo(s2.getCode());
102102
}
103103

104104
}

0 commit comments

Comments
 (0)