Commit a6c9c92f authored by Phillip Webb's avatar Phillip Webb

Merge branch '2.0.x'

parents f2a90307 63b60982
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</property> </property>
</activation> </activation>
<properties> <properties>
<spring-javaformat.version>0.0.3</spring-javaformat.version> <spring-javaformat.version>0.0.6</spring-javaformat.version>
</properties> </properties>
<build> <build>
<plugins> <plugins>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<dependency> <dependency>
<groupId>com.puppycrawl.tools</groupId> <groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId> <artifactId>checkstyle</artifactId>
<version>8.8</version> <version>8.11</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.spring.javaformat</groupId> <groupId>io.spring.javaformat</groupId>
......
...@@ -72,7 +72,7 @@ public class CloudFoundryWebEndpointDiscoverer extends WebEndpointDiscoverer { ...@@ -72,7 +72,7 @@ public class CloudFoundryWebEndpointDiscoverer extends WebEndpointDiscoverer {
AnnotationAttributes attributes = AnnotatedElementUtils AnnotationAttributes attributes = AnnotatedElementUtils
.getMergedAnnotationAttributes(extensionBean.getClass(), .getMergedAnnotationAttributes(extensionBean.getClass(),
EndpointWebExtension.class); EndpointWebExtension.class);
Class<?> endpoint = (attributes != null ? attributes.getClass("endpoint") : null); Class<?> endpoint = (attributes != null) ? attributes.getClass("endpoint") : null;
return (endpoint != null && HealthEndpoint.class.isAssignableFrom(endpoint)); return (endpoint != null && HealthEndpoint.class.isAssignableFrom(endpoint));
} }
......
...@@ -126,8 +126,8 @@ public class ReactiveCloudFoundryActuatorAutoConfiguration { ...@@ -126,8 +126,8 @@ public class ReactiveCloudFoundryActuatorAutoConfiguration {
String cloudControllerUrl = environment.getProperty("vcap.application.cf_api"); String cloudControllerUrl = environment.getProperty("vcap.application.cf_api");
boolean skipSslValidation = environment.getProperty( boolean skipSslValidation = environment.getProperty(
"management.cloudfoundry.skip-ssl-validation", Boolean.class, false); "management.cloudfoundry.skip-ssl-validation", Boolean.class, false);
return (cloudControllerUrl != null ? new ReactiveCloudFoundrySecurityService( return (cloudControllerUrl != null) ? new ReactiveCloudFoundrySecurityService(
webClientBuilder, cloudControllerUrl, skipSslValidation) : null); webClientBuilder, cloudControllerUrl, skipSslValidation) : null;
} }
private CorsConfiguration getCorsConfiguration() { private CorsConfiguration getCorsConfiguration() {
......
...@@ -130,8 +130,8 @@ public class CloudFoundryActuatorAutoConfiguration { ...@@ -130,8 +130,8 @@ public class CloudFoundryActuatorAutoConfiguration {
String cloudControllerUrl = environment.getProperty("vcap.application.cf_api"); String cloudControllerUrl = environment.getProperty("vcap.application.cf_api");
boolean skipSslValidation = environment.getProperty( boolean skipSslValidation = environment.getProperty(
"management.cloudfoundry.skip-ssl-validation", Boolean.class, false); "management.cloudfoundry.skip-ssl-validation", Boolean.class, false);
return (cloudControllerUrl != null ? new CloudFoundrySecurityService( return (cloudControllerUrl != null) ? new CloudFoundrySecurityService(
restTemplateBuilder, cloudControllerUrl, skipSslValidation) : null); restTemplateBuilder, cloudControllerUrl, skipSslValidation) : null;
} }
private CorsConfiguration getCorsConfiguration() { private CorsConfiguration getCorsConfiguration() {
......
...@@ -125,8 +125,8 @@ public class ConditionsReportEndpoint { ...@@ -125,8 +125,8 @@ public class ConditionsReportEndpoint {
this.unconditionalClasses = report.getUnconditionalClasses(); this.unconditionalClasses = report.getUnconditionalClasses();
report.getConditionAndOutcomesBySource().forEach( report.getConditionAndOutcomesBySource().forEach(
(source, conditionAndOutcomes) -> add(source, conditionAndOutcomes)); (source, conditionAndOutcomes) -> add(source, conditionAndOutcomes));
this.parentId = (context.getParent() != null ? context.getParent().getId() this.parentId = (context.getParent() != null) ? context.getParent().getId()
: null); : null;
} }
private void add(String source, ConditionAndOutcomes conditionAndOutcomes) { private void add(String source, ConditionAndOutcomes conditionAndOutcomes) {
......
...@@ -82,7 +82,7 @@ public class ElasticsearchHealthIndicatorAutoConfiguration { ...@@ -82,7 +82,7 @@ public class ElasticsearchHealthIndicatorAutoConfiguration {
protected ElasticsearchHealthIndicator createHealthIndicator(Client client) { protected ElasticsearchHealthIndicator createHealthIndicator(Client client) {
Duration responseTimeout = this.properties.getResponseTimeout(); Duration responseTimeout = this.properties.getResponseTimeout();
return new ElasticsearchHealthIndicator(client, return new ElasticsearchHealthIndicator(client,
responseTimeout != null ? responseTimeout.toMillis() : 100, (responseTimeout != null) ? responseTimeout.toMillis() : 100,
this.properties.getIndices()); this.properties.getIndices());
} }
......
...@@ -36,7 +36,7 @@ import org.springframework.util.Assert; ...@@ -36,7 +36,7 @@ import org.springframework.util.Assert;
* {@link EndpointFilter} that will filter endpoints based on {@code include} and * {@link EndpointFilter} that will filter endpoints based on {@code include} and
* {@code exclude} properties. * {@code exclude} properties.
* *
* @param <E> The endpoint type * @param <E> the endpoint type
* @author Phillip Webb * @author Phillip Webb
* @since 2.0.0 * @since 2.0.0
*/ */
......
...@@ -112,7 +112,7 @@ public class DataSourceHealthIndicatorAutoConfiguration extends ...@@ -112,7 +112,7 @@ public class DataSourceHealthIndicatorAutoConfiguration extends
private String getValidationQuery(DataSource source) { private String getValidationQuery(DataSource source) {
DataSourcePoolMetadata poolMetadata = this.poolMetadataProvider DataSourcePoolMetadata poolMetadata = this.poolMetadataProvider
.getDataSourcePoolMetadata(source); .getDataSourcePoolMetadata(source);
return (poolMetadata != null ? poolMetadata.getValidationQuery() : null); return (poolMetadata != null) ? poolMetadata.getValidationQuery() : null;
} }
} }
...@@ -51,9 +51,9 @@ class MeterRegistryConfigurer { ...@@ -51,9 +51,9 @@ class MeterRegistryConfigurer {
Collection<MeterFilter> filters, Collection<MeterFilter> filters,
Collection<MeterRegistryCustomizer<?>> customizers, Collection<MeterRegistryCustomizer<?>> customizers,
boolean addToGlobalRegistry) { boolean addToGlobalRegistry) {
this.binders = (binders != null ? binders : Collections.emptyList()); this.binders = (binders != null) ? binders : Collections.emptyList();
this.filters = (filters != null ? filters : Collections.emptyList()); this.filters = (filters != null) ? filters : Collections.emptyList();
this.customizers = (customizers != null ? customizers : Collections.emptyList()); this.customizers = (customizers != null) ? customizers : Collections.emptyList();
this.addToGlobalRegistry = addToGlobalRegistry; this.addToGlobalRegistry = addToGlobalRegistry;
} }
......
...@@ -27,7 +27,7 @@ import io.micrometer.core.instrument.MeterRegistry; ...@@ -27,7 +27,7 @@ import io.micrometer.core.instrument.MeterRegistry;
* the registry. * the registry.
* *
* @author Jon Schneider * @author Jon Schneider
* @param <T> The registry type to customize * @param <T> the registry type to customize
* @since 2.0.0 * @since 2.0.0
*/ */
@FunctionalInterface @FunctionalInterface
......
...@@ -90,10 +90,10 @@ public class PropertiesMeterFilter implements MeterFilter { ...@@ -90,10 +90,10 @@ public class PropertiesMeterFilter implements MeterFilter {
} }
private long[] convertSla(Meter.Type meterType, ServiceLevelAgreementBoundary[] sla) { private long[] convertSla(Meter.Type meterType, ServiceLevelAgreementBoundary[] sla) {
long[] converted = Arrays.stream(sla != null ? sla : EMPTY_SLA) long[] converted = Arrays.stream((sla != null) ? sla : EMPTY_SLA)
.map((candidate) -> candidate.getValue(meterType)) .map((candidate) -> candidate.getValue(meterType))
.filter(Objects::nonNull).mapToLong(Long::longValue).toArray(); .filter(Objects::nonNull).mapToLong(Long::longValue).toArray();
return (converted.length != 0 ? converted : null); return (converted.length != 0) ? converted : null;
} }
private <T> T lookup(Map<String, T> values, Id id, T defaultValue) { private <T> T lookup(Map<String, T> values, Id id, T defaultValue) {
...@@ -107,7 +107,7 @@ public class PropertiesMeterFilter implements MeterFilter { ...@@ -107,7 +107,7 @@ public class PropertiesMeterFilter implements MeterFilter {
return result; return result;
} }
int lastDot = name.lastIndexOf('.'); int lastDot = name.lastIndexOf('.');
name = (lastDot != -1 ? name.substring(0, lastDot) : ""); name = (lastDot != -1) ? name.substring(0, lastDot) : "";
} }
return values.getOrDefault("all", defaultValue); return values.getOrDefault("all", defaultValue);
} }
......
...@@ -24,7 +24,7 @@ import org.springframework.util.Assert; ...@@ -24,7 +24,7 @@ import org.springframework.util.Assert;
/** /**
* Base class for properties to config adapters. * Base class for properties to config adapters.
* *
* @param <T> The properties type * @param <T> the properties type
* @author Phillip Webb * @author Phillip Webb
* @author Nikolay Rybak * @author Nikolay Rybak
* @since 2.0.0 * @since 2.0.0
...@@ -51,7 +51,7 @@ public class PropertiesConfigAdapter<T> { ...@@ -51,7 +51,7 @@ public class PropertiesConfigAdapter<T> {
*/ */
protected final <V> V get(Function<T, V> getter, Supplier<V> fallback) { protected final <V> V get(Function<T, V> getter, Supplier<V> fallback) {
V value = getter.apply(this.properties); V value = getter.apply(this.properties);
return (value != null ? value : fallback.get()); return (value != null) ? value : fallback.get();
} }
} }
...@@ -23,7 +23,7 @@ import io.micrometer.core.instrument.step.StepRegistryConfig; ...@@ -23,7 +23,7 @@ import io.micrometer.core.instrument.step.StepRegistryConfig;
/** /**
* Base class for {@link StepRegistryProperties} to {@link StepRegistryConfig} adapters. * Base class for {@link StepRegistryProperties} to {@link StepRegistryConfig} adapters.
* *
* @param <T> The properties type * @param <T> the properties type
* @author Jon Schneider * @author Jon Schneider
* @author Phillip Webb * @author Phillip Webb
* @since 2.0.0 * @since 2.0.0
......
...@@ -60,7 +60,7 @@ public class WavefrontPropertiesConfigAdapter ...@@ -60,7 +60,7 @@ public class WavefrontPropertiesConfigAdapter
} }
private String getUriAsString(WavefrontProperties properties) { private String getUriAsString(WavefrontProperties properties) {
return (properties.getUri() != null ? properties.getUri().toString() : null); return (properties.getUri() != null) ? properties.getUri().toString() : null;
} }
} }
...@@ -47,7 +47,8 @@ public class TomcatMetricsAutoConfiguration { ...@@ -47,7 +47,8 @@ public class TomcatMetricsAutoConfiguration {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
public TomcatMetrics tomcatMetrics() { public TomcatMetrics tomcatMetrics() {
return new TomcatMetrics(this.context != null ? this.context.getManager() : null, return new TomcatMetrics(
(this.context != null) ? this.context.getManager() : null,
Collections.emptyList()); Collections.emptyList());
} }
......
...@@ -125,17 +125,17 @@ class ManagementContextConfigurationImportSelector ...@@ -125,17 +125,17 @@ class ManagementContextConfigurationImportSelector
Map<String, Object> annotationAttributes = annotationMetadata Map<String, Object> annotationAttributes = annotationMetadata
.getAnnotationAttributes( .getAnnotationAttributes(
ManagementContextConfiguration.class.getName()); ManagementContextConfiguration.class.getName());
return (annotationAttributes != null return (annotationAttributes != null)
? (ManagementContextType) annotationAttributes.get("value") ? (ManagementContextType) annotationAttributes.get("value")
: ManagementContextType.ANY); : ManagementContextType.ANY;
} }
private int readOrder(AnnotationMetadata annotationMetadata) { private int readOrder(AnnotationMetadata annotationMetadata) {
Map<String, Object> attributes = annotationMetadata Map<String, Object> attributes = annotationMetadata
.getAnnotationAttributes(Order.class.getName()); .getAnnotationAttributes(Order.class.getName());
Integer order = (attributes != null ? (Integer) attributes.get("value") Integer order = (attributes != null) ? (Integer) attributes.get("value")
: null); : null;
return (order != null ? order : Ordered.LOWEST_PRECEDENCE); return (order != null) ? order : Ordered.LOWEST_PRECEDENCE;
} }
public String getClassName() { public String getClassName() {
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -47,9 +47,9 @@ public enum ManagementPortType { ...@@ -47,9 +47,9 @@ public enum ManagementPortType {
if (managementPort != null && managementPort < 0) { if (managementPort != null && managementPort < 0) {
return DISABLED; return DISABLED;
} }
return ((managementPort == null) return ((managementPort == null
|| (serverPort == null && managementPort.equals(8080)) || (serverPort == null && managementPort.equals(8080))
|| (managementPort != 0 && managementPort.equals(serverPort)) ? SAME || (managementPort != 0 && managementPort.equals(serverPort))) ? SAME
: DIFFERENT); : DIFFERENT);
} }
......
...@@ -52,17 +52,17 @@ public class MockServletWebServerFactory extends AbstractServletWebServerFactory ...@@ -52,17 +52,17 @@ public class MockServletWebServerFactory extends AbstractServletWebServerFactory
} }
public ServletContext getServletContext() { public ServletContext getServletContext() {
return (getWebServer() != null ? getWebServer().getServletContext() : null); return (getWebServer() != null) ? getWebServer().getServletContext() : null;
} }
public RegisteredServlet getRegisteredServlet(int index) { public RegisteredServlet getRegisteredServlet(int index) {
return (getWebServer() != null ? getWebServer().getRegisteredServlet(index) return (getWebServer() != null) ? getWebServer().getRegisteredServlet(index)
: null); : null;
} }
public RegisteredFilter getRegisteredFilter(int index) { public RegisteredFilter getRegisteredFilter(int index) {
return (getWebServer() != null ? getWebServer().getRegisteredFilters(index) return (getWebServer() != null) ? getWebServer().getRegisteredFilters(index)
: null); : null;
} }
public static class MockServletWebServer public static class MockServletWebServer
......
...@@ -55,9 +55,9 @@ public class AuditEvent implements Serializable { ...@@ -55,9 +55,9 @@ public class AuditEvent implements Serializable {
/** /**
* Create a new audit event for the current time. * Create a new audit event for the current time.
* @param principal The user principal responsible * @param principal the user principal responsible
* @param type the event type * @param type the event type
* @param data The event data * @param data the event data
*/ */
public AuditEvent(String principal, String type, Map<String, Object> data) { public AuditEvent(String principal, String type, Map<String, Object> data) {
this(Instant.now(), principal, type, data); this(Instant.now(), principal, type, data);
...@@ -66,9 +66,9 @@ public class AuditEvent implements Serializable { ...@@ -66,9 +66,9 @@ public class AuditEvent implements Serializable {
/** /**
* Create a new audit event for the current time from data provided as name-value * Create a new audit event for the current time from data provided as name-value
* pairs. * pairs.
* @param principal The user principal responsible * @param principal the user principal responsible
* @param type the event type * @param type the event type
* @param data The event data in the form 'key=value' or simply 'key' * @param data the event data in the form 'key=value' or simply 'key'
*/ */
public AuditEvent(String principal, String type, String... data) { public AuditEvent(String principal, String type, String... data) {
this(Instant.now(), principal, type, convert(data)); this(Instant.now(), principal, type, convert(data));
...@@ -76,17 +76,17 @@ public class AuditEvent implements Serializable { ...@@ -76,17 +76,17 @@ public class AuditEvent implements Serializable {
/** /**
* Create a new audit event. * Create a new audit event.
* @param timestamp The date/time of the event * @param timestamp the date/time of the event
* @param principal The user principal responsible * @param principal the user principal responsible
* @param type the event type * @param type the event type
* @param data The event data * @param data the event data
*/ */
public AuditEvent(Instant timestamp, String principal, String type, public AuditEvent(Instant timestamp, String principal, String type,
Map<String, Object> data) { Map<String, Object> data) {
Assert.notNull(timestamp, "Timestamp must not be null"); Assert.notNull(timestamp, "Timestamp must not be null");
Assert.notNull(type, "Type must not be null"); Assert.notNull(type, "Type must not be null");
this.timestamp = timestamp; this.timestamp = timestamp;
this.principal = (principal != null ? principal : ""); this.principal = (principal != null) ? principal : "";
this.type = type; this.type = type;
this.data = Collections.unmodifiableMap(data); this.data = Collections.unmodifiableMap(data);
} }
......
...@@ -50,7 +50,7 @@ public class AuditEventsEndpoint { ...@@ -50,7 +50,7 @@ public class AuditEventsEndpoint {
} }
private Instant getInstant(OffsetDateTime offsetDateTime) { private Instant getInstant(OffsetDateTime offsetDateTime) {
return (offsetDateTime != null ? offsetDateTime.toInstant() : null); return (offsetDateTime != null) ? offsetDateTime.toInstant() : null;
} }
/** /**
......
...@@ -118,7 +118,7 @@ public class BeansEndpoint { ...@@ -118,7 +118,7 @@ public class BeansEndpoint {
} }
ConfigurableApplicationContext parent = getConfigurableParent(context); ConfigurableApplicationContext parent = getConfigurableParent(context);
return new ContextBeans(describeBeans(context.getBeanFactory()), return new ContextBeans(describeBeans(context.getBeanFactory()),
parent != null ? parent.getId() : null); (parent != null) ? parent.getId() : null);
} }
private static Map<String, BeanDescriptor> describeBeans( private static Map<String, BeanDescriptor> describeBeans(
......
...@@ -118,7 +118,7 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext ...@@ -118,7 +118,7 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext
prefix, sanitize(prefix, safeSerialize(mapper, bean, prefix)))); prefix, sanitize(prefix, safeSerialize(mapper, bean, prefix))));
}); });
return new ContextConfigurationProperties(beanDescriptors, return new ContextConfigurationProperties(beanDescriptors,
context.getParent() != null ? context.getParent().getId() : null); (context.getParent() != null) ? context.getParent().getId() : null);
} }
private ConfigurationBeanFactoryMetadata getBeanFactoryMetadata( private ConfigurationBeanFactoryMetadata getBeanFactoryMetadata(
......
...@@ -55,7 +55,7 @@ public class ElasticsearchHealthIndicator extends AbstractHealthIndicator { ...@@ -55,7 +55,7 @@ public class ElasticsearchHealthIndicator extends AbstractHealthIndicator {
public ElasticsearchHealthIndicator(Client client, long responseTimeout, public ElasticsearchHealthIndicator(Client client, long responseTimeout,
List<String> indices) { List<String> indices) {
this(client, responseTimeout, this(client, responseTimeout,
(indices != null ? StringUtils.toStringArray(indices) : null)); (indices != null) ? StringUtils.toStringArray(indices) : null);
} }
/** /**
......
...@@ -26,7 +26,7 @@ import org.springframework.util.Assert; ...@@ -26,7 +26,7 @@ import org.springframework.util.Assert;
/** /**
* Abstract base class for {@link ExposableEndpoint} implementations. * Abstract base class for {@link ExposableEndpoint} implementations.
* *
* @param <O> The operation type. * @param <O> the operation type.
* @author Phillip Webb * @author Phillip Webb
* @since 2.0.0 * @since 2.0.0
*/ */
......
...@@ -28,7 +28,7 @@ import org.springframework.util.Assert; ...@@ -28,7 +28,7 @@ import org.springframework.util.Assert;
* Abstract base class for {@link ExposableEndpoint endpoints} discovered by a * Abstract base class for {@link ExposableEndpoint endpoints} discovered by a
* {@link EndpointDiscoverer}. * {@link EndpointDiscoverer}.
* *
* @param <O> The operation type * @param <O> the operation type
* @author Phillip Webb * @author Phillip Webb
* @since 2.0.0 * @since 2.0.0
*/ */
......
...@@ -22,7 +22,7 @@ import org.springframework.boot.actuate.endpoint.Operation; ...@@ -22,7 +22,7 @@ import org.springframework.boot.actuate.endpoint.Operation;
/** /**
* An {@link ExposableEndpoint endpoint} discovered by an {@link EndpointDiscoverer}. * An {@link ExposableEndpoint endpoint} discovered by an {@link EndpointDiscoverer}.
* *
* @param <O> The operation type * @param <O> the operation type
* @author Phillip Webb * @author Phillip Webb
* @since 2.0.0 * @since 2.0.0
*/ */
......
...@@ -40,7 +40,7 @@ import org.springframework.core.annotation.AnnotationAttributes; ...@@ -40,7 +40,7 @@ import org.springframework.core.annotation.AnnotationAttributes;
* Factory to create an {@link Operation} for annotated methods on an * Factory to create an {@link Operation} for annotated methods on an
* {@link Endpoint @Endpoint} or {@link EndpointExtension @EndpointExtension}. * {@link Endpoint @Endpoint} or {@link EndpointExtension @EndpointExtension}.
* *
* @param <O> The operation type * @param <O> the operation type
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Phillip Webb * @author Phillip Webb
......
...@@ -54,8 +54,8 @@ import org.springframework.util.StringUtils; ...@@ -54,8 +54,8 @@ import org.springframework.util.StringUtils;
* {@link Endpoint @Endpoint} beans and {@link EndpointExtension @EndpointExtension} beans * {@link Endpoint @Endpoint} beans and {@link EndpointExtension @EndpointExtension} beans
* in an application context. * in an application context.
* *
* @param <E> The endpoint type * @param <E> the endpoint type
* @param <O> The operation type * @param <O> the operation type
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Phillip Webb * @author Phillip Webb
...@@ -382,11 +382,6 @@ public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>, O exten ...@@ -382,11 +382,6 @@ public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>, O exten
this.description = description; this.description = description;
} }
@Override
public int hashCode() {
return this.key.hashCode();
}
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == this) { if (obj == this) {
...@@ -398,6 +393,11 @@ public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>, O exten ...@@ -398,6 +393,11 @@ public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>, O exten
return this.key.equals(((OperationKey) obj).key); return this.key.equals(((OperationKey) obj).key);
} }
@Override
public int hashCode() {
return this.key.hashCode();
}
@Override @Override
public String toString() { public String toString() {
return this.description.get(); return this.description.get();
......
...@@ -39,7 +39,7 @@ public class JacksonJmxOperationResponseMapper implements JmxOperationResponseMa ...@@ -39,7 +39,7 @@ public class JacksonJmxOperationResponseMapper implements JmxOperationResponseMa
private final JavaType mapType; private final JavaType mapType;
public JacksonJmxOperationResponseMapper(ObjectMapper objectMapper) { public JacksonJmxOperationResponseMapper(ObjectMapper objectMapper) {
this.objectMapper = (objectMapper != null ? objectMapper : new ObjectMapper()); this.objectMapper = (objectMapper != null) ? objectMapper : new ObjectMapper();
this.listType = this.objectMapper.getTypeFactory() this.listType = this.objectMapper.getTypeFactory()
.constructParametricType(List.class, Object.class); .constructParametricType(List.class, Object.class);
this.mapType = this.objectMapper.getTypeFactory() this.mapType = this.objectMapper.getTypeFactory()
......
...@@ -46,7 +46,7 @@ public class PathMappedEndpoints implements Iterable<PathMappedEndpoint> { ...@@ -46,7 +46,7 @@ public class PathMappedEndpoints implements Iterable<PathMappedEndpoint> {
*/ */
public PathMappedEndpoints(String basePath, EndpointsSupplier<?> supplier) { public PathMappedEndpoints(String basePath, EndpointsSupplier<?> supplier) {
Assert.notNull(supplier, "Supplier must not be null"); Assert.notNull(supplier, "Supplier must not be null");
this.basePath = (basePath != null ? basePath : ""); this.basePath = (basePath != null) ? basePath : "";
this.endpoints = getEndpoints(Collections.singleton(supplier)); this.endpoints = getEndpoints(Collections.singleton(supplier));
} }
...@@ -58,7 +58,7 @@ public class PathMappedEndpoints implements Iterable<PathMappedEndpoint> { ...@@ -58,7 +58,7 @@ public class PathMappedEndpoints implements Iterable<PathMappedEndpoint> {
public PathMappedEndpoints(String basePath, public PathMappedEndpoints(String basePath,
Collection<EndpointsSupplier<?>> suppliers) { Collection<EndpointsSupplier<?>> suppliers) {
Assert.notNull(suppliers, "Suppliers must not be null"); Assert.notNull(suppliers, "Suppliers must not be null");
this.basePath = (basePath != null ? basePath : ""); this.basePath = (basePath != null) ? basePath : "";
this.endpoints = getEndpoints(suppliers); this.endpoints = getEndpoints(suppliers);
} }
...@@ -91,7 +91,7 @@ public class PathMappedEndpoints implements Iterable<PathMappedEndpoint> { ...@@ -91,7 +91,7 @@ public class PathMappedEndpoints implements Iterable<PathMappedEndpoint> {
*/ */
public String getRootPath(String endpointId) { public String getRootPath(String endpointId) {
PathMappedEndpoint endpoint = getEndpoint(endpointId); PathMappedEndpoint endpoint = getEndpoint(endpointId);
return (endpoint != null ? endpoint.getRootPath() : null); return (endpoint != null) ? endpoint.getRootPath() : null;
} }
/** /**
...@@ -144,7 +144,7 @@ public class PathMappedEndpoints implements Iterable<PathMappedEndpoint> { ...@@ -144,7 +144,7 @@ public class PathMappedEndpoints implements Iterable<PathMappedEndpoint> {
} }
private String getPath(PathMappedEndpoint endpoint) { private String getPath(PathMappedEndpoint endpoint) {
return (endpoint != null ? this.basePath + "/" + endpoint.getRootPath() : null); return (endpoint != null) ? this.basePath + "/" + endpoint.getRootPath() : null;
} }
private <T> List<T> asList(Stream<T> stream) { private <T> List<T> asList(Stream<T> stream) {
......
...@@ -47,7 +47,7 @@ public class ServletEndpointRegistrar implements ServletContextInitializer { ...@@ -47,7 +47,7 @@ public class ServletEndpointRegistrar implements ServletContextInitializer {
public ServletEndpointRegistrar(String basePath, public ServletEndpointRegistrar(String basePath,
Collection<ExposableServletEndpoint> servletEndpoints) { Collection<ExposableServletEndpoint> servletEndpoints) {
Assert.notNull(servletEndpoints, "ServletEndpoints must not be null"); Assert.notNull(servletEndpoints, "ServletEndpoints must not be null");
this.basePath = (basePath != null ? basePath : ""); this.basePath = (basePath != null) ? basePath : "";
this.servletEndpoints = servletEndpoints; this.servletEndpoints = servletEndpoints;
} }
......
...@@ -89,18 +89,20 @@ public final class WebOperationRequestPredicate { ...@@ -89,18 +89,20 @@ public final class WebOperationRequestPredicate {
} }
@Override @Override
public String toString() { public boolean equals(Object obj) {
StringBuilder result = new StringBuilder( if (this == obj) {
this.httpMethod + " to path '" + this.path + "'"); return true;
if (!CollectionUtils.isEmpty(this.consumes)) {
result.append(" consumes: "
+ StringUtils.collectionToCommaDelimitedString(this.consumes));
} }
if (!CollectionUtils.isEmpty(this.produces)) { if (obj == null || getClass() != obj.getClass()) {
result.append(" produces: " return false;
+ StringUtils.collectionToCommaDelimitedString(this.produces));
} }
return result.toString(); WebOperationRequestPredicate other = (WebOperationRequestPredicate) obj;
boolean result = true;
result = result && this.consumes.equals(other.consumes);
result = result && this.httpMethod == other.httpMethod;
result = result && this.canonicalPath.equals(other.canonicalPath);
result = result && this.produces.equals(other.produces);
return result;
} }
@Override @Override
...@@ -115,20 +117,18 @@ public final class WebOperationRequestPredicate { ...@@ -115,20 +117,18 @@ public final class WebOperationRequestPredicate {
} }
@Override @Override
public boolean equals(Object obj) { public String toString() {
if (this == obj) { StringBuilder result = new StringBuilder(
return true; this.httpMethod + " to path '" + this.path + "'");
if (!CollectionUtils.isEmpty(this.consumes)) {
result.append(" consumes: "
+ StringUtils.collectionToCommaDelimitedString(this.consumes));
} }
if (obj == null || getClass() != obj.getClass()) { if (!CollectionUtils.isEmpty(this.produces)) {
return false; result.append(" produces: "
+ StringUtils.collectionToCommaDelimitedString(this.produces));
} }
WebOperationRequestPredicate other = (WebOperationRequestPredicate) obj; return result.toString();
boolean result = true;
result = result && this.consumes.equals(other.consumes);
result = result && this.httpMethod == other.httpMethod;
result = result && this.canonicalPath.equals(other.canonicalPath);
result = result && this.produces.equals(other.produces);
return result;
} }
} }
...@@ -179,7 +179,7 @@ public class JerseyEndpointResourceFactory { ...@@ -179,7 +179,7 @@ public class JerseyEndpointResourceFactory {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
multivaluedMap.forEach((name, values) -> { multivaluedMap.forEach((name, values) -> {
if (!CollectionUtils.isEmpty(values)) { if (!CollectionUtils.isEmpty(values)) {
result.put(name, values.size() != 1 ? values : values.get(0)); result.put(name, (values.size() != 1) ? values : values.get(0));
} }
}); });
return result; return result;
......
...@@ -310,7 +310,7 @@ public abstract class AbstractWebFluxEndpointHandlerMapping ...@@ -310,7 +310,7 @@ public abstract class AbstractWebFluxEndpointHandlerMapping
arguments.putAll(body); arguments.putAll(body);
} }
exchange.getRequest().getQueryParams().forEach((name, values) -> arguments exchange.getRequest().getQueryParams().forEach((name, values) -> arguments
.put(name, values.size() != 1 ? values : values.get(0))); .put(name, (values.size() != 1) ? values : values.get(0)));
return arguments; return arguments;
} }
...@@ -324,7 +324,7 @@ public abstract class AbstractWebFluxEndpointHandlerMapping ...@@ -324,7 +324,7 @@ public abstract class AbstractWebFluxEndpointHandlerMapping
.onErrorMap(InvalidEndpointRequestException.class, .onErrorMap(InvalidEndpointRequestException.class,
(ex) -> new ResponseStatusException(HttpStatus.BAD_REQUEST, (ex) -> new ResponseStatusException(HttpStatus.BAD_REQUEST,
ex.getReason())) ex.getReason()))
.defaultIfEmpty(new ResponseEntity<>(httpMethod != HttpMethod.GET .defaultIfEmpty(new ResponseEntity<>((httpMethod != HttpMethod.GET)
? HttpStatus.NO_CONTENT : HttpStatus.NOT_FOUND)); ? HttpStatus.NO_CONTENT : HttpStatus.NOT_FOUND));
} }
......
...@@ -257,7 +257,7 @@ public abstract class AbstractWebMvcEndpointHandlerMapping ...@@ -257,7 +257,7 @@ public abstract class AbstractWebMvcEndpointHandlerMapping
arguments.putAll(body); arguments.putAll(body);
} }
request.getParameterMap().forEach((name, values) -> arguments.put(name, request.getParameterMap().forEach((name, values) -> arguments.put(name,
values.length != 1 ? Arrays.asList(values) : values[0])); (values.length != 1) ? Arrays.asList(values) : values[0]));
return arguments; return arguments;
} }
...@@ -269,7 +269,7 @@ public abstract class AbstractWebMvcEndpointHandlerMapping ...@@ -269,7 +269,7 @@ public abstract class AbstractWebMvcEndpointHandlerMapping
private Object handleResult(Object result, HttpMethod httpMethod) { private Object handleResult(Object result, HttpMethod httpMethod) {
if (result == null) { if (result == null) {
return new ResponseEntity<>(httpMethod != HttpMethod.GET return new ResponseEntity<>((httpMethod != HttpMethod.GET)
? HttpStatus.NO_CONTENT : HttpStatus.NOT_FOUND); ? HttpStatus.NO_CONTENT : HttpStatus.NOT_FOUND);
} }
if (!(result instanceof WebEndpointResponse)) { if (!(result instanceof WebEndpointResponse)) {
......
...@@ -160,7 +160,7 @@ public class EnvironmentEndpoint { ...@@ -160,7 +160,7 @@ public class EnvironmentEndpoint {
private String getOrigin(OriginLookup<Object> lookup, String name) { private String getOrigin(OriginLookup<Object> lookup, String name) {
Origin origin = lookup.getOrigin(name); Origin origin = lookup.getOrigin(name);
return (origin != null ? origin.toString() : null); return (origin != null) ? origin.toString() : null;
} }
private PlaceholdersResolver getResolver() { private PlaceholdersResolver getResolver() {
......
...@@ -59,7 +59,7 @@ public class FlywayEndpoint { ...@@ -59,7 +59,7 @@ public class FlywayEndpoint {
.put(name, new FlywayDescriptor(flyway.info().all()))); .put(name, new FlywayDescriptor(flyway.info().all())));
ApplicationContext parent = target.getParent(); ApplicationContext parent = target.getParent();
contextFlywayBeans.put(target.getId(), new ContextFlywayBeans(flywayBeans, contextFlywayBeans.put(target.getId(), new ContextFlywayBeans(flywayBeans,
parent != null ? parent.getId() : null)); (parent != null) ? parent.getId() : null));
target = parent; target = parent;
} }
return new ApplicationFlywayBeans(contextFlywayBeans); return new ApplicationFlywayBeans(contextFlywayBeans);
...@@ -170,7 +170,7 @@ public class FlywayEndpoint { ...@@ -170,7 +170,7 @@ public class FlywayEndpoint {
} }
private String nullSafeToString(Object obj) { private String nullSafeToString(Object obj) {
return (obj != null ? obj.toString() : null); return (obj != null) ? obj.toString() : null;
} }
public MigrationType getType() { public MigrationType getType() {
......
...@@ -82,8 +82,8 @@ public class CompositeReactiveHealthIndicator implements ReactiveHealthIndicator ...@@ -82,8 +82,8 @@ public class CompositeReactiveHealthIndicator implements ReactiveHealthIndicator
ReactiveHealthIndicatorRegistry registry) { ReactiveHealthIndicatorRegistry registry) {
this.registry = registry; this.registry = registry;
this.healthAggregator = healthAggregator; this.healthAggregator = healthAggregator;
this.timeoutCompose = (mono) -> (this.timeout != null ? mono.timeout( this.timeoutCompose = (mono) -> (this.timeout != null) ? mono.timeout(
Duration.ofMillis(this.timeout), Mono.just(this.timeoutHealth)) : mono); Duration.ofMillis(this.timeout), Mono.just(this.timeoutHealth)) : mono;
} }
/** /**
...@@ -115,8 +115,8 @@ public class CompositeReactiveHealthIndicator implements ReactiveHealthIndicator ...@@ -115,8 +115,8 @@ public class CompositeReactiveHealthIndicator implements ReactiveHealthIndicator
public CompositeReactiveHealthIndicator timeoutStrategy(long timeout, public CompositeReactiveHealthIndicator timeoutStrategy(long timeout,
Health timeoutHealth) { Health timeoutHealth) {
this.timeout = timeout; this.timeout = timeout;
this.timeoutHealth = (timeoutHealth != null ? timeoutHealth this.timeoutHealth = (timeoutHealth != null) ? timeoutHealth
: Health.unknown().build()); : Health.unknown().build();
return this; return this;
} }
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -98,7 +98,7 @@ public class OrderedHealthAggregator extends AbstractHealthAggregator { ...@@ -98,7 +98,7 @@ public class OrderedHealthAggregator extends AbstractHealthAggregator {
public int compare(Status s1, Status s2) { public int compare(Status s1, Status s2) {
int i1 = this.statusOrder.indexOf(s1.getCode()); int i1 = this.statusOrder.indexOf(s1.getCode());
int i2 = this.statusOrder.indexOf(s2.getCode()); int i2 = this.statusOrder.indexOf(s2.getCode());
return (i1 < i2 ? -1 : (i1 != i2 ? 1 : s1.getCode().compareTo(s2.getCode()))); return (i1 < i2) ? -1 : (i1 != i2) ? 1 : s1.getCode().compareTo(s2.getCode());
} }
} }
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -102,16 +102,6 @@ public final class Status { ...@@ -102,16 +102,6 @@ public final class Status {
return this.description; return this.description;
} }
@Override
public String toString() {
return this.code;
}
@Override
public int hashCode() {
return this.code.hashCode();
}
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == this) { if (obj == this) {
...@@ -123,4 +113,14 @@ public final class Status { ...@@ -123,4 +113,14 @@ public final class Status {
return false; return false;
} }
@Override
public int hashCode() {
return this.code.hashCode();
}
@Override
public String toString() {
return this.code;
}
} }
...@@ -86,7 +86,7 @@ public class DataSourceHealthIndicator extends AbstractHealthIndicator ...@@ -86,7 +86,7 @@ public class DataSourceHealthIndicator extends AbstractHealthIndicator
super("DataSource health check failed"); super("DataSource health check failed");
this.dataSource = dataSource; this.dataSource = dataSource;
this.query = query; this.query = query;
this.jdbcTemplate = (dataSource != null ? new JdbcTemplate(dataSource) : null); this.jdbcTemplate = (dataSource != null) ? new JdbcTemplate(dataSource) : null;
} }
@Override @Override
......
...@@ -69,7 +69,7 @@ public class LiquibaseEndpoint { ...@@ -69,7 +69,7 @@ public class LiquibaseEndpoint {
createReport(liquibase, service, factory))); createReport(liquibase, service, factory)));
ApplicationContext parent = target.getParent(); ApplicationContext parent = target.getParent();
contextBeans.put(target.getId(), new ContextLiquibaseBeans(liquibaseBeans, contextBeans.put(target.getId(), new ContextLiquibaseBeans(liquibaseBeans,
parent != null ? parent.getId() : null)); (parent != null) ? parent.getId() : null));
target = parent; target = parent;
} }
return new ApplicationLiquibaseBeans(contextBeans); return new ApplicationLiquibaseBeans(contextBeans);
...@@ -210,7 +210,7 @@ public class LiquibaseEndpoint { ...@@ -210,7 +210,7 @@ public class LiquibaseEndpoint {
this.execType = ranChangeSet.getExecType(); this.execType = ranChangeSet.getExecType();
this.id = ranChangeSet.getId(); this.id = ranChangeSet.getId();
this.labels = ranChangeSet.getLabels().getLabels(); this.labels = ranChangeSet.getLabels().getLabels();
this.checksum = (ranChangeSet.getLastCheckSum() != null this.checksum = ((ranChangeSet.getLastCheckSum() != null)
? ranChangeSet.getLastCheckSum().toString() : null); ? ranChangeSet.getLastCheckSum().toString() : null);
this.orderExecuted = ranChangeSet.getOrderExecuted(); this.orderExecuted = ranChangeSet.getOrderExecuted();
this.tag = ranChangeSet.getTag(); this.tag = ranChangeSet.getTag();
......
...@@ -73,7 +73,7 @@ public class LoggersEndpoint { ...@@ -73,7 +73,7 @@ public class LoggersEndpoint {
Assert.notNull(name, "Name must not be null"); Assert.notNull(name, "Name must not be null");
LoggerConfiguration configuration = this.loggingSystem LoggerConfiguration configuration = this.loggingSystem
.getLoggerConfiguration(name); .getLoggerConfiguration(name);
return (configuration != null ? new LoggerLevels(configuration) : null); return (configuration != null) ? new LoggerLevels(configuration) : null;
} }
@WriteOperation @WriteOperation
...@@ -112,7 +112,7 @@ public class LoggersEndpoint { ...@@ -112,7 +112,7 @@ public class LoggersEndpoint {
} }
private String getName(LogLevel level) { private String getName(LogLevel level) {
return (level != null ? level.name() : null); return (level != null) ? level.name() : null;
} }
public String getConfiguredLevel() { public String getConfiguredLevel() {
......
...@@ -78,7 +78,7 @@ public class HeapDumpWebEndpoint { ...@@ -78,7 +78,7 @@ public class HeapDumpWebEndpoint {
if (this.lock.tryLock(this.timeout, TimeUnit.MILLISECONDS)) { if (this.lock.tryLock(this.timeout, TimeUnit.MILLISECONDS)) {
try { try {
return new WebEndpointResponse<>( return new WebEndpointResponse<>(
dumpHeap(live != null ? live : true)); dumpHeap((live != null) ? live : true));
} }
finally { finally {
this.lock.unlock(); this.lock.unlock();
......
...@@ -47,7 +47,7 @@ public class RabbitMetrics implements MeterBinder { ...@@ -47,7 +47,7 @@ public class RabbitMetrics implements MeterBinder {
public RabbitMetrics(ConnectionFactory connectionFactory, Iterable<Tag> tags) { public RabbitMetrics(ConnectionFactory connectionFactory, Iterable<Tag> tags) {
Assert.notNull(connectionFactory, "ConnectionFactory must not be null"); Assert.notNull(connectionFactory, "ConnectionFactory must not be null");
this.connectionFactory = connectionFactory; this.connectionFactory = connectionFactory;
this.tags = (tags != null ? tags : Collections.emptyList()); this.tags = (tags != null) ? tags : Collections.emptyList();
} }
@Override @Override
......
...@@ -24,7 +24,7 @@ import org.springframework.cache.Cache; ...@@ -24,7 +24,7 @@ import org.springframework.cache.Cache;
/** /**
* Provide a {@link MeterBinder} based on a {@link Cache}. * Provide a {@link MeterBinder} based on a {@link Cache}.
* *
* @param <C> The cache type * @param <C> the cache type
* @author Stephane Nicoll * @author Stephane Nicoll
* @since 2.0.0 * @since 2.0.0
*/ */
......
...@@ -73,7 +73,7 @@ public final class RestTemplateExchangeTags { ...@@ -73,7 +73,7 @@ public final class RestTemplateExchangeTags {
} }
private static String ensureLeadingSlash(String url) { private static String ensureLeadingSlash(String url) {
return (url == null || url.startsWith("/") ? url : "/" + url); return (url == null || url.startsWith("/")) ? url : "/" + url;
} }
/** /**
......
...@@ -60,7 +60,7 @@ public final class WebMvcTags { ...@@ -60,7 +60,7 @@ public final class WebMvcTags {
* @return the method tag whose value is a capitalized method (e.g. GET). * @return the method tag whose value is a capitalized method (e.g. GET).
*/ */
public static Tag method(HttpServletRequest request) { public static Tag method(HttpServletRequest request) {
return (request != null ? Tag.of("method", request.getMethod()) : METHOD_UNKNOWN); return (request != null) ? Tag.of("method", request.getMethod()) : METHOD_UNKNOWN;
} }
/** /**
...@@ -69,9 +69,9 @@ public final class WebMvcTags { ...@@ -69,9 +69,9 @@ public final class WebMvcTags {
* @return the status tag derived from the status of the response * @return the status tag derived from the status of the response
*/ */
public static Tag status(HttpServletResponse response) { public static Tag status(HttpServletResponse response) {
return (response != null return (response != null)
? Tag.of("status", Integer.toString(response.getStatus())) ? Tag.of("status", Integer.toString(response.getStatus()))
: STATUS_UNKNOWN); : STATUS_UNKNOWN;
} }
/** /**
......
...@@ -48,7 +48,7 @@ public class SolrHealthIndicator extends AbstractHealthIndicator { ...@@ -48,7 +48,7 @@ public class SolrHealthIndicator extends AbstractHealthIndicator {
request.setAction(CoreAdminParams.CoreAdminAction.STATUS); request.setAction(CoreAdminParams.CoreAdminAction.STATUS);
CoreAdminResponse response = request.process(this.solrClient); CoreAdminResponse response = request.process(this.solrClient);
int statusCode = response.getStatus(); int statusCode = response.getStatus();
Status status = (statusCode != 0 ? Status.DOWN : Status.UP); Status status = (statusCode != 0) ? Status.DOWN : Status.UP;
builder.status(status).withDetail("status", statusCode); builder.status(status).withDetail("status", statusCode);
} }
......
...@@ -59,7 +59,7 @@ public class MappingsEndpoint { ...@@ -59,7 +59,7 @@ public class MappingsEndpoint {
this.descriptionProviders this.descriptionProviders
.forEach((provider) -> mappings.put(provider.getMappingName(), .forEach((provider) -> mappings.put(provider.getMappingName(),
provider.describeMappings(applicationContext))); provider.describeMappings(applicationContext)));
return new ContextMappings(mappings, applicationContext.getParent() != null return new ContextMappings(mappings, (applicationContext.getParent() != null)
? applicationContext.getId() : null); ? applicationContext.getId() : null);
} }
......
...@@ -64,7 +64,7 @@ final class DispatcherServletHandlerMappings { ...@@ -64,7 +64,7 @@ final class DispatcherServletHandlerMappings {
initializeDispatcherServletIfPossible(); initializeDispatcherServletIfPossible();
handlerMappings = this.dispatcherServlet.getHandlerMappings(); handlerMappings = this.dispatcherServlet.getHandlerMappings();
} }
return (handlerMappings != null ? handlerMappings : Collections.emptyList()); return (handlerMappings != null) ? handlerMappings : Collections.emptyList();
} }
private void initializeDispatcherServletIfPossible() { private void initializeDispatcherServletIfPossible() {
......
...@@ -98,8 +98,8 @@ public class HttpTraceWebFilter implements WebFilter, Ordered { ...@@ -98,8 +98,8 @@ public class HttpTraceWebFilter implements WebFilter, Ordered {
HttpTrace trace = this.tracer.receivedRequest(request); HttpTrace trace = this.tracer.receivedRequest(request);
return chain.filter(exchange).doAfterSuccessOrError((aVoid, ex) -> { return chain.filter(exchange).doAfterSuccessOrError((aVoid, ex) -> {
TraceableServerHttpResponse response = new TraceableServerHttpResponse( TraceableServerHttpResponse response = new TraceableServerHttpResponse(
(ex != null ? new CustomStatusResponseDecorator(ex, (ex != null) ? new CustomStatusResponseDecorator(ex,
exchange.getResponse()) : exchange.getResponse())); exchange.getResponse()) : exchange.getResponse());
this.tracer.sendingResponse(trace, response, () -> principal, this.tracer.sendingResponse(trace, response, () -> principal,
() -> getStartedSessionId(session)); () -> getStartedSessionId(session));
this.repository.add(trace); this.repository.add(trace);
...@@ -107,7 +107,7 @@ public class HttpTraceWebFilter implements WebFilter, Ordered { ...@@ -107,7 +107,7 @@ public class HttpTraceWebFilter implements WebFilter, Ordered {
} }
private String getStartedSessionId(WebSession session) { private String getStartedSessionId(WebSession session) {
return (session != null && session.isStarted() ? session.getId() : null); return (session != null && session.isStarted()) ? session.getId() : null;
} }
private static final class CustomStatusResponseDecorator private static final class CustomStatusResponseDecorator
...@@ -117,9 +117,9 @@ public class HttpTraceWebFilter implements WebFilter, Ordered { ...@@ -117,9 +117,9 @@ public class HttpTraceWebFilter implements WebFilter, Ordered {
private CustomStatusResponseDecorator(Throwable ex, ServerHttpResponse delegate) { private CustomStatusResponseDecorator(Throwable ex, ServerHttpResponse delegate) {
super(delegate); super(delegate);
this.status = (ex instanceof ResponseStatusException this.status = (ex instanceof ResponseStatusException)
? ((ResponseStatusException) ex).getStatus() ? ((ResponseStatusException) ex).getStatus()
: HttpStatus.INTERNAL_SERVER_ERROR); : HttpStatus.INTERNAL_SERVER_ERROR;
} }
@Override @Override
......
...@@ -45,8 +45,8 @@ class ServerWebExchangeTraceableRequest implements TraceableRequest { ...@@ -45,8 +45,8 @@ class ServerWebExchangeTraceableRequest implements TraceableRequest {
this.method = request.getMethodValue(); this.method = request.getMethodValue();
this.headers = request.getHeaders(); this.headers = request.getHeaders();
this.uri = request.getURI(); this.uri = request.getURI();
this.remoteAddress = (request.getRemoteAddress() != null this.remoteAddress = (request.getRemoteAddress() != null)
? request.getRemoteAddress().getAddress().toString() : null); ? request.getRemoteAddress().getAddress().toString() : null;
} }
@Override @Override
......
...@@ -38,8 +38,8 @@ class TraceableServerHttpResponse implements TraceableResponse { ...@@ -38,8 +38,8 @@ class TraceableServerHttpResponse implements TraceableResponse {
@Override @Override
public int getStatus() { public int getStatus() {
return (this.response.getStatusCode() != null return (this.response.getStatusCode() != null)
? this.response.getStatusCode().value() : 200); ? this.response.getStatusCode().value() : 200;
} }
@Override @Override
......
...@@ -92,7 +92,7 @@ public class HttpTraceFilter extends OncePerRequestFilter implements Ordered { ...@@ -92,7 +92,7 @@ public class HttpTraceFilter extends OncePerRequestFilter implements Ordered {
} }
finally { finally {
TraceableHttpServletResponse traceableResponse = new TraceableHttpServletResponse( TraceableHttpServletResponse traceableResponse = new TraceableHttpServletResponse(
status != response.getStatus() (status != response.getStatus())
? new CustomStatusResponseWrapper(response, status) ? new CustomStatusResponseWrapper(response, status)
: response); : response);
this.tracer.sendingResponse(trace, traceableResponse, this.tracer.sendingResponse(trace, traceableResponse,
...@@ -113,7 +113,7 @@ public class HttpTraceFilter extends OncePerRequestFilter implements Ordered { ...@@ -113,7 +113,7 @@ public class HttpTraceFilter extends OncePerRequestFilter implements Ordered {
private String getSessionId(HttpServletRequest request) { private String getSessionId(HttpServletRequest request) {
HttpSession session = request.getSession(false); HttpSession session = request.getSession(false);
return (session != null ? session.getId() : null); return (session != null) ? session.getId() : null;
} }
private static final class CustomStatusResponseWrapper private static final class CustomStatusResponseWrapper
......
...@@ -255,7 +255,7 @@ public class ConfigurationPropertiesReportEndpointTests { ...@@ -255,7 +255,7 @@ public class ConfigurationPropertiesReportEndpointTests {
} }
public boolean isMixedBoolean() { public boolean isMixedBoolean() {
return (this.mixedBoolean != null ? this.mixedBoolean : false); return (this.mixedBoolean != null) ? this.mixedBoolean : false;
} }
public void setMixedBoolean(Boolean mixedBoolean) { public void setMixedBoolean(Boolean mixedBoolean) {
......
...@@ -56,8 +56,8 @@ public class ReflectiveOperationInvokerTests { ...@@ -56,8 +56,8 @@ public class ReflectiveOperationInvokerTests {
this.operationMethod = new OperationMethod( this.operationMethod = new OperationMethod(
ReflectionUtils.findMethod(Example.class, "reverse", String.class), ReflectionUtils.findMethod(Example.class, "reverse", String.class),
OperationType.READ); OperationType.READ);
this.parameterValueMapper = (parameter, this.parameterValueMapper = (parameter, value) -> (value != null)
value) -> (value != null ? value.toString() : null); ? value.toString() : null;
} }
@Test @Test
......
...@@ -190,9 +190,9 @@ public class JmxEndpointExporterTests { ...@@ -190,9 +190,9 @@ public class JmxEndpointExporterTests {
@Override @Override
public ObjectName getObjectName(ExposableJmxEndpoint endpoint) public ObjectName getObjectName(ExposableJmxEndpoint endpoint)
throws MalformedObjectNameException { throws MalformedObjectNameException {
return (endpoint != null return (endpoint != null)
? new ObjectName("boot:type=Endpoint,name=" + endpoint.getId()) ? new ObjectName("boot:type=Endpoint,name=" + endpoint.getId())
: null); : null;
} }
} }
......
...@@ -68,8 +68,8 @@ public class TestJmxOperation implements JmxOperation { ...@@ -68,8 +68,8 @@ public class TestJmxOperation implements JmxOperation {
@Override @Override
public Object invoke(InvocationContext context) { public Object invoke(InvocationContext context) {
return (this.invoke != null ? this.invoke.apply(context.getArguments()) return (this.invoke != null) ? this.invoke.apply(context.getArguments())
: "result"); : "result";
} }
@Override @Override
......
...@@ -835,7 +835,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable ...@@ -835,7 +835,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
@ReadOperation @ReadOperation
public String read(@Nullable Principal principal) { public String read(@Nullable Principal principal) {
return (principal != null ? principal.getName() : "None"); return (principal != null) ? principal.getName() : "None";
} }
} }
...@@ -856,7 +856,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable ...@@ -856,7 +856,7 @@ public abstract class AbstractWebEndpointIntegrationTests<T extends Configurable
@ReadOperation @ReadOperation
public String read(SecurityContext securityContext) { public String read(SecurityContext securityContext) {
Principal principal = securityContext.getPrincipal(); Principal principal = securityContext.getPrincipal();
return (principal != null ? principal.getName() : "None"); return (principal != null) ? principal.getName() : "None";
} }
} }
......
...@@ -326,7 +326,7 @@ public class HttpExchangeTracerTests { ...@@ -326,7 +326,7 @@ public class HttpExchangeTracerTests {
private String mixedCase(String input) { private String mixedCase(String input) {
StringBuilder output = new StringBuilder(); StringBuilder output = new StringBuilder();
for (int i = 0; i < input.length(); i++) { for (int i = 0; i < input.length(); i++) {
output.append(i % 2 != 0 ? Character.toUpperCase(input.charAt(i)) output.append((i % 2 != 0) ? Character.toUpperCase(input.charAt(i))
: Character.toLowerCase(input.charAt(i))); : Character.toLowerCase(input.charAt(i)));
} }
return output.toString(); return output.toString();
......
...@@ -248,7 +248,7 @@ public class AutoConfigurationImportSelector ...@@ -248,7 +248,7 @@ public class AutoConfigurationImportSelector
} }
String[] excludes = getEnvironment() String[] excludes = getEnvironment()
.getProperty(PROPERTY_NAME_AUTOCONFIGURE_EXCLUDE, String[].class); .getProperty(PROPERTY_NAME_AUTOCONFIGURE_EXCLUDE, String[].class);
return (excludes != null ? Arrays.asList(excludes) : Collections.emptyList()); return (excludes != null) ? Arrays.asList(excludes) : Collections.emptyList();
} }
private List<String> filter(List<String> configurations, private List<String> filter(List<String> configurations,
...@@ -296,7 +296,7 @@ public class AutoConfigurationImportSelector ...@@ -296,7 +296,7 @@ public class AutoConfigurationImportSelector
protected final List<String> asList(AnnotationAttributes attributes, String name) { protected final List<String> asList(AnnotationAttributes attributes, String name) {
String[] value = attributes.getStringArray(name); String[] value = attributes.getStringArray(name);
return Arrays.asList(value != null ? value : new String[0]); return Arrays.asList((value != null) ? value : new String[0]);
} }
private void fireAutoConfigurationImportEvents(List<String> configurations, private void fireAutoConfigurationImportEvents(List<String> configurations,
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -45,8 +45,8 @@ final class AutoConfigurationMetadataLoader { ...@@ -45,8 +45,8 @@ final class AutoConfigurationMetadataLoader {
static AutoConfigurationMetadata loadMetadata(ClassLoader classLoader, String path) { static AutoConfigurationMetadata loadMetadata(ClassLoader classLoader, String path) {
try { try {
Enumeration<URL> urls = (classLoader != null ? classLoader.getResources(path) Enumeration<URL> urls = (classLoader != null) ? classLoader.getResources(path)
: ClassLoader.getSystemResources(path)); : ClassLoader.getSystemResources(path);
Properties properties = new Properties(); Properties properties = new Properties();
while (urls.hasMoreElements()) { while (urls.hasMoreElements()) {
properties.putAll(PropertiesLoaderUtils properties.putAll(PropertiesLoaderUtils
...@@ -89,7 +89,7 @@ final class AutoConfigurationMetadataLoader { ...@@ -89,7 +89,7 @@ final class AutoConfigurationMetadataLoader {
@Override @Override
public Integer getInteger(String className, String key, Integer defaultValue) { public Integer getInteger(String className, String key, Integer defaultValue) {
String value = get(className, key); String value = get(className, key);
return (value != null ? Integer.valueOf(value) : defaultValue); return (value != null) ? Integer.valueOf(value) : defaultValue;
} }
@Override @Override
...@@ -101,8 +101,8 @@ final class AutoConfigurationMetadataLoader { ...@@ -101,8 +101,8 @@ final class AutoConfigurationMetadataLoader {
public Set<String> getSet(String className, String key, public Set<String> getSet(String className, String key,
Set<String> defaultValue) { Set<String> defaultValue) {
String value = get(className, key); String value = get(className, key);
return (value != null ? StringUtils.commaDelimitedListToSet(value) return (value != null) ? StringUtils.commaDelimitedListToSet(value)
: defaultValue); : defaultValue;
} }
@Override @Override
...@@ -113,7 +113,7 @@ final class AutoConfigurationMetadataLoader { ...@@ -113,7 +113,7 @@ final class AutoConfigurationMetadataLoader {
@Override @Override
public String get(String className, String key, String defaultValue) { public String get(String className, String key, String defaultValue) {
String value = this.properties.getProperty(className + "." + key); String value = this.properties.getProperty(className + "." + key);
return (value != null ? value : defaultValue); return (value != null) ? value : defaultValue;
} }
} }
......
...@@ -147,9 +147,8 @@ public abstract class AutoConfigurationPackages { ...@@ -147,9 +147,8 @@ public abstract class AutoConfigurationPackages {
this.packageName = ClassUtils.getPackageName(metadata.getClassName()); this.packageName = ClassUtils.getPackageName(metadata.getClassName());
} }
@Override public String getPackageName() {
public int hashCode() { return this.packageName;
return this.packageName.hashCode();
} }
@Override @Override
...@@ -160,8 +159,9 @@ public abstract class AutoConfigurationPackages { ...@@ -160,8 +159,9 @@ public abstract class AutoConfigurationPackages {
return this.packageName.equals(((PackageImport) obj).packageName); return this.packageName.equals(((PackageImport) obj).packageName);
} }
public String getPackageName() { @Override
return this.packageName; public int hashCode() {
return this.packageName.hashCode();
} }
@Override @Override
......
...@@ -213,8 +213,8 @@ class AutoConfigurationSorter { ...@@ -213,8 +213,8 @@ class AutoConfigurationSorter {
} }
Map<String, Object> attributes = getAnnotationMetadata() Map<String, Object> attributes = getAnnotationMetadata()
.getAnnotationAttributes(AutoConfigureOrder.class.getName()); .getAnnotationAttributes(AutoConfigureOrder.class.getName());
return (attributes != null ? (Integer) attributes.get("value") return (attributes != null) ? (Integer) attributes.get("value")
: AutoConfigureOrder.DEFAULT_ORDER); : AutoConfigureOrder.DEFAULT_ORDER;
} }
private boolean wasProcessed() { private boolean wasProcessed() {
......
...@@ -109,8 +109,8 @@ class ImportAutoConfigurationImportSelector extends AutoConfigurationImportSelec ...@@ -109,8 +109,8 @@ class ImportAutoConfigurationImportSelector extends AutoConfigurationImportSelec
for (String annotationName : ANNOTATION_NAMES) { for (String annotationName : ANNOTATION_NAMES) {
AnnotationAttributes merged = AnnotatedElementUtils AnnotationAttributes merged = AnnotatedElementUtils
.getMergedAnnotationAttributes(source, annotationName); .getMergedAnnotationAttributes(source, annotationName);
Class<?>[] exclude = (merged != null ? merged.getClassArray("exclude") Class<?>[] exclude = (merged != null) ? merged.getClassArray("exclude")
: null); : null;
if (exclude != null) { if (exclude != null) {
for (Class<?> excludeClass : exclude) { for (Class<?> excludeClass : exclude) {
exclusions.add(excludeClass.getName()); exclusions.add(excludeClass.getName());
......
...@@ -26,6 +26,7 @@ import org.springframework.amqp.rabbit.retry.MessageRecoverer; ...@@ -26,6 +26,7 @@ import org.springframework.amqp.rabbit.retry.MessageRecoverer;
import org.springframework.amqp.rabbit.retry.RejectAndDontRequeueRecoverer; import org.springframework.amqp.rabbit.retry.RejectAndDontRequeueRecoverer;
import org.springframework.amqp.support.converter.MessageConverter; import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.boot.autoconfigure.amqp.RabbitProperties.ListenerRetry; import org.springframework.boot.autoconfigure.amqp.RabbitProperties.ListenerRetry;
import org.springframework.retry.support.RetryTemplate;
import org.springframework.util.Assert; import org.springframework.util.Assert;
/** /**
...@@ -117,15 +118,15 @@ public abstract class AbstractRabbitListenerContainerFactoryConfigurer<T extends ...@@ -117,15 +118,15 @@ public abstract class AbstractRabbitListenerContainerFactoryConfigurer<T extends
} }
ListenerRetry retryConfig = configuration.getRetry(); ListenerRetry retryConfig = configuration.getRetry();
if (retryConfig.isEnabled()) { if (retryConfig.isEnabled()) {
RetryInterceptorBuilder<?> builder = (retryConfig.isStateless() RetryInterceptorBuilder<?> builder = (retryConfig.isStateless())
? RetryInterceptorBuilder.stateless() ? RetryInterceptorBuilder.stateless()
: RetryInterceptorBuilder.stateful()); : RetryInterceptorBuilder.stateful();
builder.retryOperations( RetryTemplate retryTemplate = new RetryTemplateFactory(
new RetryTemplateFactory(this.retryTemplateCustomizers) this.retryTemplateCustomizers).createRetryTemplate(retryConfig,
.createRetryTemplate(retryConfig, RabbitRetryTemplateCustomizer.Target.LISTENER);
RabbitRetryTemplateCustomizer.Target.LISTENER)); builder.retryOperations(retryTemplate);
MessageRecoverer recoverer = (this.messageRecoverer != null MessageRecoverer recoverer = (this.messageRecoverer != null)
? this.messageRecoverer : new RejectAndDontRequeueRecoverer()); ? this.messageRecoverer : new RejectAndDontRequeueRecoverer();
builder.recoverer(recoverer); builder.recoverer(recoverer);
factory.setAdviceChain(builder.build()); factory.setAdviceChain(builder.build());
} }
......
...@@ -195,7 +195,7 @@ public class RabbitAutoConfiguration { ...@@ -195,7 +195,7 @@ public class RabbitAutoConfiguration {
private boolean determineMandatoryFlag() { private boolean determineMandatoryFlag() {
Boolean mandatory = this.properties.getTemplate().getMandatory(); Boolean mandatory = this.properties.getTemplate().getMandatory();
return (mandatory != null ? mandatory : this.properties.isPublisherReturns()); return (mandatory != null) ? mandatory : this.properties.isPublisherReturns();
} }
@Bean @Bean
......
...@@ -206,7 +206,7 @@ public class RabbitProperties { ...@@ -206,7 +206,7 @@ public class RabbitProperties {
return this.username; return this.username;
} }
Address address = this.parsedAddresses.get(0); Address address = this.parsedAddresses.get(0);
return (address.username != null ? address.username : this.username); return (address.username != null) ? address.username : this.username;
} }
public void setUsername(String username) { public void setUsername(String username) {
...@@ -229,7 +229,7 @@ public class RabbitProperties { ...@@ -229,7 +229,7 @@ public class RabbitProperties {
return getPassword(); return getPassword();
} }
Address address = this.parsedAddresses.get(0); Address address = this.parsedAddresses.get(0);
return (address.password != null ? address.password : getPassword()); return (address.password != null) ? address.password : getPassword();
} }
public void setPassword(String password) { public void setPassword(String password) {
...@@ -256,7 +256,7 @@ public class RabbitProperties { ...@@ -256,7 +256,7 @@ public class RabbitProperties {
return getVirtualHost(); return getVirtualHost();
} }
Address address = this.parsedAddresses.get(0); Address address = this.parsedAddresses.get(0);
return (address.virtualHost != null ? address.virtualHost : getVirtualHost()); return (address.virtualHost != null) ? address.virtualHost : getVirtualHost();
} }
public void setVirtualHost(String virtualHost) { public void setVirtualHost(String virtualHost) {
......
...@@ -36,8 +36,8 @@ public class CacheManagerCustomizers { ...@@ -36,8 +36,8 @@ public class CacheManagerCustomizers {
public CacheManagerCustomizers( public CacheManagerCustomizers(
List<? extends CacheManagerCustomizer<?>> customizers) { List<? extends CacheManagerCustomizer<?>> customizers) {
this.customizers = (customizers != null ? new ArrayList<>(customizers) this.customizers = (customizers != null) ? new ArrayList<>(customizers)
: Collections.emptyList()); : Collections.emptyList();
} }
/** /**
......
...@@ -147,8 +147,8 @@ public abstract class AbstractNestedCondition extends SpringBootCondition ...@@ -147,8 +147,8 @@ public abstract class AbstractNestedCondition extends SpringBootCondition
private List<String[]> getConditionClasses(AnnotatedTypeMetadata metadata) { private List<String[]> getConditionClasses(AnnotatedTypeMetadata metadata) {
MultiValueMap<String, Object> attributes = metadata MultiValueMap<String, Object> attributes = metadata
.getAllAnnotationAttributes(Conditional.class.getName(), true); .getAllAnnotationAttributes(Conditional.class.getName(), true);
Object values = (attributes != null ? attributes.get("value") : null); Object values = (attributes != null) ? attributes.get("value") : null;
return (List<String[]>) (values != null ? values : Collections.emptyList()); return (List<String[]>) ((values != null) ? values : Collections.emptyList());
} }
private Condition getCondition(String conditionClassName) { private Condition getCondition(String conditionClassName) {
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -46,8 +46,8 @@ class ConditionEvaluationReportAutoConfigurationImportListener ...@@ -46,8 +46,8 @@ class ConditionEvaluationReportAutoConfigurationImportListener
@Override @Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException { public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
this.beanFactory = (beanFactory instanceof ConfigurableListableBeanFactory this.beanFactory = (beanFactory instanceof ConfigurableListableBeanFactory)
? (ConfigurableListableBeanFactory) beanFactory : null); ? (ConfigurableListableBeanFactory) beanFactory : null;
} }
} }
...@@ -59,16 +59,6 @@ public final class ConditionMessage { ...@@ -59,16 +59,6 @@ public final class ConditionMessage {
return !StringUtils.hasLength(this.message); return !StringUtils.hasLength(this.message);
} }
@Override
public String toString() {
return (this.message != null ? this.message : "");
}
@Override
public int hashCode() {
return ObjectUtils.nullSafeHashCode(this.message);
}
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == null || !ConditionMessage.class.isInstance(obj)) { if (obj == null || !ConditionMessage.class.isInstance(obj)) {
...@@ -80,6 +70,16 @@ public final class ConditionMessage { ...@@ -80,6 +70,16 @@ public final class ConditionMessage {
return ObjectUtils.nullSafeEquals(((ConditionMessage) obj).message, this.message); return ObjectUtils.nullSafeEquals(((ConditionMessage) obj).message, this.message);
} }
@Override
public int hashCode() {
return ObjectUtils.nullSafeHashCode(this.message);
}
@Override
public String toString() {
return (this.message != null) ? this.message : "";
}
/** /**
* Return a new {@link ConditionMessage} based on the instance and an appended * Return a new {@link ConditionMessage} based on the instance and an appended
* message. * message.
...@@ -358,7 +358,7 @@ public final class ConditionMessage { ...@@ -358,7 +358,7 @@ public final class ConditionMessage {
* @return a built {@link ConditionMessage} * @return a built {@link ConditionMessage}
*/ */
public ConditionMessage items(Style style, Object... items) { public ConditionMessage items(Style style, Object... items) {
return items(style, items != null ? Arrays.asList(items) : null); return items(style, (items != null) ? Arrays.asList(items) : null);
} }
/** /**
...@@ -415,7 +415,7 @@ public final class ConditionMessage { ...@@ -415,7 +415,7 @@ public final class ConditionMessage {
QUOTE { QUOTE {
@Override @Override
protected String applyToItem(Object item) { protected String applyToItem(Object item) {
return (item != null ? "'" + item + "'" : null); return (item != null) ? "'" + item + "'" : null;
} }
}; };
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -122,12 +122,6 @@ public class ConditionOutcome { ...@@ -122,12 +122,6 @@ public class ConditionOutcome {
return this.message; return this.message;
} }
@Override
public int hashCode() {
return Boolean.hashCode(this.match) * 31
+ ObjectUtils.nullSafeHashCode(this.message);
}
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (this == obj) { if (this == obj) {
...@@ -144,9 +138,15 @@ public class ConditionOutcome { ...@@ -144,9 +138,15 @@ public class ConditionOutcome {
return super.equals(obj); return super.equals(obj);
} }
@Override
public int hashCode() {
return Boolean.hashCode(this.match) * 31
+ ObjectUtils.nullSafeHashCode(this.message);
}
@Override @Override
public String toString() { public String toString() {
return (this.message != null ? this.message.toString() : ""); return (this.message != null) ? this.message.toString() : "";
} }
/** /**
......
...@@ -444,7 +444,7 @@ class OnBeanCondition extends SpringBootCondition implements ConfigurationCondit ...@@ -444,7 +444,7 @@ class OnBeanCondition extends SpringBootCondition implements ConfigurationCondit
} }
public SearchStrategy getStrategy() { public SearchStrategy getStrategy() {
return (this.strategy != null ? this.strategy : SearchStrategy.ALL); return (this.strategy != null) ? this.strategy : SearchStrategy.ALL;
} }
public List<String> getNames() { public List<String> getNames() {
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -53,7 +53,7 @@ class OnJavaCondition extends SpringBootCondition { ...@@ -53,7 +53,7 @@ class OnJavaCondition extends SpringBootCondition {
JavaVersion version) { JavaVersion version) {
boolean match = isWithin(runningVersion, range, version); boolean match = isWithin(runningVersion, range, version);
String expected = String.format( String expected = String.format(
range != Range.EQUAL_OR_NEWER ? "(older than %s)" : "(%s or newer)", (range != Range.EQUAL_OR_NEWER) ? "(older than %s)" : "(%s or newer)",
version); version);
ConditionMessage message = ConditionMessage ConditionMessage message = ConditionMessage
.forCondition(ConditionalOnJava.class, expected) .forCondition(ConditionalOnJava.class, expected)
......
...@@ -139,7 +139,7 @@ class OnPropertyCondition extends SpringBootCondition { ...@@ -139,7 +139,7 @@ class OnPropertyCondition extends SpringBootCondition {
"The name or value attribute of @ConditionalOnProperty must be specified"); "The name or value attribute of @ConditionalOnProperty must be specified");
Assert.state(value.length == 0 || name.length == 0, Assert.state(value.length == 0 || name.length == 0,
"The name and value attributes of @ConditionalOnProperty are exclusive"); "The name and value attributes of @ConditionalOnProperty are exclusive");
return (value.length > 0 ? value : name); return (value.length > 0) ? value : name;
} }
private void collectProperties(PropertyResolver resolver, List<String> missing, private void collectProperties(PropertyResolver resolver, List<String> missing,
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -46,8 +46,8 @@ class OnResourceCondition extends SpringBootCondition { ...@@ -46,8 +46,8 @@ class OnResourceCondition extends SpringBootCondition {
AnnotatedTypeMetadata metadata) { AnnotatedTypeMetadata metadata) {
MultiValueMap<String, Object> attributes = metadata MultiValueMap<String, Object> attributes = metadata
.getAllAnnotationAttributes(ConditionalOnResource.class.getName(), true); .getAllAnnotationAttributes(ConditionalOnResource.class.getName(), true);
ResourceLoader loader = (context.getResourceLoader() != null ResourceLoader loader = (context.getResourceLoader() != null)
? context.getResourceLoader() : this.defaultResourceLoader); ? context.getResourceLoader() : this.defaultResourceLoader;
List<String> locations = new ArrayList<>(); List<String> locations = new ArrayList<>();
collectValues(locations, attributes.get("resources")); collectValues(locations, attributes.get("resources"));
Assert.isTrue(!locations.isEmpty(), Assert.isTrue(!locations.isEmpty(),
......
...@@ -194,8 +194,8 @@ public class CouchbaseProperties { ...@@ -194,8 +194,8 @@ public class CouchbaseProperties {
private String keyStorePassword; private String keyStorePassword;
public Boolean getEnabled() { public Boolean getEnabled() {
return (this.enabled != null ? this.enabled return (this.enabled != null) ? this.enabled
: StringUtils.hasText(this.keyStore)); : StringUtils.hasText(this.keyStore);
} }
public void setEnabled(Boolean enabled) { public void setEnabled(Boolean enabled) {
......
...@@ -87,7 +87,7 @@ class NoSuchBeanDefinitionFailureAnalyzer ...@@ -87,7 +87,7 @@ class NoSuchBeanDefinitionFailureAnalyzer
cause); cause);
StringBuilder message = new StringBuilder(); StringBuilder message = new StringBuilder();
message.append(String.format("%s required %s that could not be found.%n", message.append(String.format("%s required %s that could not be found.%n",
(description != null ? description : "A component"), (description != null) ? description : "A component",
getBeanDescription(cause))); getBeanDescription(cause)));
for (AutoConfigurationResult result : autoConfigurationResults) { for (AutoConfigurationResult result : autoConfigurationResults) {
message.append(String.format("\t- %s%n", result)); message.append(String.format("\t- %s%n", result));
...@@ -97,9 +97,8 @@ class NoSuchBeanDefinitionFailureAnalyzer ...@@ -97,9 +97,8 @@ class NoSuchBeanDefinitionFailureAnalyzer
} }
String action = String.format("Consider %s %s in your configuration.", String action = String.format("Consider %s %s in your configuration.",
(!autoConfigurationResults.isEmpty() (!autoConfigurationResults.isEmpty()
|| !userConfigurationResults.isEmpty() || !userConfigurationResults.isEmpty())
? "revisiting the entries above or defining" ? "revisiting the entries above or defining" : "defining",
: "defining"),
getBeanDescription(cause)); getBeanDescription(cause));
return new FailureAnalysis(message.toString(), action, cause); return new FailureAnalysis(message.toString(), action, cause);
} }
...@@ -193,8 +192,8 @@ class NoSuchBeanDefinitionFailureAnalyzer ...@@ -193,8 +192,8 @@ class NoSuchBeanDefinitionFailureAnalyzer
Source(String source) { Source(String source) {
String[] tokens = source.split("#"); String[] tokens = source.split("#");
this.className = (tokens.length > 1 ? tokens[0] : source); this.className = (tokens.length > 1) ? tokens[0] : source;
this.methodName = (tokens.length != 2 ? null : tokens[1]); this.methodName = (tokens.length != 2) ? null : tokens[1];
} }
public String getClassName() { public String getClassName() {
...@@ -254,8 +253,8 @@ class NoSuchBeanDefinitionFailureAnalyzer ...@@ -254,8 +253,8 @@ class NoSuchBeanDefinitionFailureAnalyzer
private boolean hasName(MethodMetadata methodMetadata, String name) { private boolean hasName(MethodMetadata methodMetadata, String name) {
Map<String, Object> attributes = methodMetadata Map<String, Object> attributes = methodMetadata
.getAnnotationAttributes(Bean.class.getName()); .getAnnotationAttributes(Bean.class.getName());
String[] candidates = (attributes != null ? (String[]) attributes.get("name") String[] candidates = (attributes != null) ? (String[]) attributes.get("name")
: null); : null;
if (candidates != null) { if (candidates != null) {
for (String candidate : candidates) { for (String candidate : candidates) {
if (candidate.equals(name)) { if (candidate.equals(name)) {
......
...@@ -179,7 +179,7 @@ public class FlywayAutoConfiguration { ...@@ -179,7 +179,7 @@ public class FlywayAutoConfiguration {
private String getProperty(Supplier<String> property, private String getProperty(Supplier<String> property,
Supplier<String> defaultValue) { Supplier<String> defaultValue) {
String value = property.get(); String value = property.get();
return (value != null ? value : defaultValue.get()); return (value != null) ? value : defaultValue.get();
} }
private void checkLocationExists(String... locations) { private void checkLocationExists(String... locations) {
......
...@@ -109,7 +109,7 @@ public class FlywayProperties { ...@@ -109,7 +109,7 @@ public class FlywayProperties {
} }
public String getPassword() { public String getPassword() {
return (this.password != null ? this.password : ""); return (this.password != null) ? this.password : "";
} }
public void setPassword(String password) { public void setPassword(String password) {
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -104,7 +104,7 @@ public class HttpEncodingProperties { ...@@ -104,7 +104,7 @@ public class HttpEncodingProperties {
} }
public boolean shouldForce(Type type) { public boolean shouldForce(Type type) {
Boolean force = (type != Type.REQUEST ? this.forceResponse : this.forceRequest); Boolean force = (type != Type.REQUEST) ? this.forceResponse : this.forceRequest;
if (force == null) { if (force == null) {
force = this.force; force = this.force;
} }
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -69,7 +69,7 @@ public class HttpMessageConvertersAutoConfiguration { ...@@ -69,7 +69,7 @@ public class HttpMessageConvertersAutoConfiguration {
@ConditionalOnMissingBean @ConditionalOnMissingBean
public HttpMessageConverters messageConverters() { public HttpMessageConverters messageConverters() {
return new HttpMessageConverters( return new HttpMessageConverters(
this.converters != null ? this.converters : Collections.emptyList()); (this.converters != null) ? this.converters : Collections.emptyList());
} }
@Configuration @Configuration
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -91,7 +91,7 @@ public class ProjectInfoAutoConfiguration { ...@@ -91,7 +91,7 @@ public class ProjectInfoAutoConfiguration {
public ConditionOutcome getMatchOutcome(ConditionContext context, public ConditionOutcome getMatchOutcome(ConditionContext context,
AnnotatedTypeMetadata metadata) { AnnotatedTypeMetadata metadata) {
ResourceLoader loader = context.getResourceLoader(); ResourceLoader loader = context.getResourceLoader();
loader = (loader != null ? loader : this.defaultResourceLoader); loader = (loader != null) ? loader : this.defaultResourceLoader;
Environment environment = context.getEnvironment(); Environment environment = context.getEnvironment();
String location = environment.getProperty("spring.info.git.location"); String location = environment.getProperty("spring.info.git.location");
if (location == null) { if (location == null) {
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -121,7 +121,7 @@ public class DataSourceAutoConfiguration { ...@@ -121,7 +121,7 @@ public class DataSourceAutoConfiguration {
private ClassLoader getDataSourceClassLoader(ConditionContext context) { private ClassLoader getDataSourceClassLoader(ConditionContext context) {
Class<?> dataSourceClass = DataSourceBuilder Class<?> dataSourceClass = DataSourceBuilder
.findType(context.getClassLoader()); .findType(context.getClassLoader());
return (dataSourceClass != null ? dataSourceClass.getClassLoader() : null); return (dataSourceClass != null) ? dataSourceClass.getClassLoader() : null;
} }
} }
......
...@@ -68,8 +68,8 @@ class DataSourceInitializer { ...@@ -68,8 +68,8 @@ class DataSourceInitializer {
ResourceLoader resourceLoader) { ResourceLoader resourceLoader) {
this.dataSource = dataSource; this.dataSource = dataSource;
this.properties = properties; this.properties = properties;
this.resourceLoader = (resourceLoader != null ? resourceLoader this.resourceLoader = (resourceLoader != null) ? resourceLoader
: new DefaultResourceLoader()); : new DefaultResourceLoader();
} }
/** /**
......
...@@ -277,8 +277,8 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB ...@@ -277,8 +277,8 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB
return this.url; return this.url;
} }
String databaseName = determineDatabaseName(); String databaseName = determineDatabaseName();
String url = (databaseName != null String url = (databaseName != null)
? this.embeddedDatabaseConnection.getUrl(databaseName) : null); ? this.embeddedDatabaseConnection.getUrl(databaseName) : null;
if (!StringUtils.hasText(url)) { if (!StringUtils.hasText(url)) {
throw new DataSourceBeanCreationException( throw new DataSourceBeanCreationException(
"Failed to determine suitable jdbc url", this, "Failed to determine suitable jdbc url", this,
......
...@@ -188,9 +188,9 @@ public class JmsProperties { ...@@ -188,9 +188,9 @@ public class JmsProperties {
public String formatConcurrency() { public String formatConcurrency() {
if (this.concurrency == null) { if (this.concurrency == null) {
return (this.maxConcurrency != null ? "1-" + this.maxConcurrency : null); return (this.maxConcurrency != null) ? "1-" + this.maxConcurrency : null;
} }
return (this.maxConcurrency != null return ((this.maxConcurrency != null)
? this.concurrency + "-" + this.maxConcurrency ? this.concurrency + "-" + this.maxConcurrency
: String.valueOf(this.concurrency)); : String.valueOf(this.concurrency));
} }
......
...@@ -48,8 +48,8 @@ class ActiveMQConnectionFactoryFactory { ...@@ -48,8 +48,8 @@ class ActiveMQConnectionFactoryFactory {
List<ActiveMQConnectionFactoryCustomizer> factoryCustomizers) { List<ActiveMQConnectionFactoryCustomizer> factoryCustomizers) {
Assert.notNull(properties, "Properties must not be null"); Assert.notNull(properties, "Properties must not be null");
this.properties = properties; this.properties = properties;
this.factoryCustomizers = (factoryCustomizers != null ? factoryCustomizers this.factoryCustomizers = (factoryCustomizers != null) ? factoryCustomizers
: Collections.emptyList()); : Collections.emptyList();
} }
public <T extends ActiveMQConnectionFactory> T createConnectionFactory( public <T extends ActiveMQConnectionFactory> T createConnectionFactory(
......
...@@ -177,7 +177,7 @@ public class LiquibaseAutoConfiguration { ...@@ -177,7 +177,7 @@ public class LiquibaseAutoConfiguration {
private String getProperty(Supplier<String> property, private String getProperty(Supplier<String> property,
Supplier<String> defaultValue) { Supplier<String> defaultValue) {
String value = property.get(); String value = property.get();
return (value != null ? value : defaultValue.get()); return (value != null) ? value : defaultValue.get();
} }
} }
......
...@@ -81,8 +81,8 @@ public class MongoClientFactory { ...@@ -81,8 +81,8 @@ public class MongoClientFactory {
if (options == null) { if (options == null) {
options = MongoClientOptions.builder().build(); options = MongoClientOptions.builder().build();
} }
String host = (this.properties.getHost() != null ? this.properties.getHost() String host = (this.properties.getHost() != null) ? this.properties.getHost()
: "localhost"); : "localhost";
return new MongoClient(Collections.singletonList(new ServerAddress(host, port)), return new MongoClient(Collections.singletonList(new ServerAddress(host, port)),
options); options);
} }
...@@ -101,8 +101,8 @@ public class MongoClientFactory { ...@@ -101,8 +101,8 @@ public class MongoClientFactory {
int port = getValue(properties.getPort(), MongoProperties.DEFAULT_PORT); int port = getValue(properties.getPort(), MongoProperties.DEFAULT_PORT);
List<ServerAddress> seeds = Collections List<ServerAddress> seeds = Collections
.singletonList(new ServerAddress(host, port)); .singletonList(new ServerAddress(host, port));
return (credentials != null ? new MongoClient(seeds, credentials, options) return (credentials != null) ? new MongoClient(seeds, credentials, options)
: new MongoClient(seeds, options)); : new MongoClient(seeds, options);
} }
return createMongoClient(MongoProperties.DEFAULT_URI, options); return createMongoClient(MongoProperties.DEFAULT_URI, options);
} }
...@@ -112,7 +112,7 @@ public class MongoClientFactory { ...@@ -112,7 +112,7 @@ public class MongoClientFactory {
} }
private <T> T getValue(T value, T fallback) { private <T> T getValue(T value, T fallback) {
return (value != null ? value : fallback); return (value != null) ? value : fallback;
} }
private boolean hasCustomAddress() { private boolean hasCustomAddress() {
......
/* /*
* Copyright 2012-2017 the original author or authors. * Copyright 2012-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -143,7 +143,7 @@ public class MongoProperties { ...@@ -143,7 +143,7 @@ public class MongoProperties {
} }
public String determineUri() { public String determineUri() {
return (this.uri != null ? this.uri : DEFAULT_URI); return (this.uri != null) ? this.uri : DEFAULT_URI;
} }
public void setUri(String uri) { public void setUri(String uri) {
......
...@@ -54,8 +54,8 @@ public class ReactiveMongoClientFactory { ...@@ -54,8 +54,8 @@ public class ReactiveMongoClientFactory {
List<MongoClientSettingsBuilderCustomizer> builderCustomizers) { List<MongoClientSettingsBuilderCustomizer> builderCustomizers) {
this.properties = properties; this.properties = properties;
this.environment = environment; this.environment = environment;
this.builderCustomizers = (builderCustomizers != null ? builderCustomizers this.builderCustomizers = (builderCustomizers != null) ? builderCustomizers
: Collections.emptyList()); : Collections.emptyList();
} }
/** /**
...@@ -86,8 +86,8 @@ public class ReactiveMongoClientFactory { ...@@ -86,8 +86,8 @@ public class ReactiveMongoClientFactory {
private MongoClient createEmbeddedMongoClient(MongoClientSettings settings, private MongoClient createEmbeddedMongoClient(MongoClientSettings settings,
int port) { int port) {
Builder builder = builder(settings); Builder builder = builder(settings);
String host = (this.properties.getHost() != null ? this.properties.getHost() String host = (this.properties.getHost() != null) ? this.properties.getHost()
: "localhost"); : "localhost";
ClusterSettings clusterSettings = ClusterSettings.builder() ClusterSettings clusterSettings = ClusterSettings.builder()
.hosts(Collections.singletonList(new ServerAddress(host, port))).build(); .hosts(Collections.singletonList(new ServerAddress(host, port))).build();
builder.clusterSettings(clusterSettings); builder.clusterSettings(clusterSettings);
...@@ -119,16 +119,16 @@ public class ReactiveMongoClientFactory { ...@@ -119,16 +119,16 @@ public class ReactiveMongoClientFactory {
} }
private void applyCredentials(Builder builder) { private void applyCredentials(Builder builder) {
String database = (this.properties.getAuthenticationDatabase() != null String database = (this.properties.getAuthenticationDatabase() != null)
? this.properties.getAuthenticationDatabase() ? this.properties.getAuthenticationDatabase()
: this.properties.getMongoClientDatabase()); : this.properties.getMongoClientDatabase();
builder.credential((MongoCredential.createCredential( builder.credential((MongoCredential.createCredential(
this.properties.getUsername(), database, this.properties.getPassword()))); this.properties.getUsername(), database, this.properties.getPassword())));
} }
private <T> T getOrDefault(T value, T defaultValue) { private <T> T getOrDefault(T value, T defaultValue) {
return (value != null ? value : defaultValue); return (value != null) ? value : defaultValue;
} }
private MongoClient createMongoClient(Builder builder) { private MongoClient createMongoClient(Builder builder) {
......
...@@ -130,13 +130,12 @@ public class EmbeddedMongoAutoConfiguration { ...@@ -130,13 +130,12 @@ public class EmbeddedMongoAutoConfiguration {
this.embeddedProperties.getFeatures().toArray(new Feature[0])); this.embeddedProperties.getFeatures().toArray(new Feature[0]));
MongodConfigBuilder builder = new MongodConfigBuilder() MongodConfigBuilder builder = new MongodConfigBuilder()
.version(featureAwareVersion); .version(featureAwareVersion);
if (this.embeddedProperties.getStorage() != null) { EmbeddedMongoProperties.Storage storage = this.embeddedProperties.getStorage();
builder.replication( if (storage != null) {
new Storage(this.embeddedProperties.getStorage().getDatabaseDir(), String databaseDir = storage.getDatabaseDir();
this.embeddedProperties.getStorage().getReplSetName(), String replSetName = storage.getReplSetName();
this.embeddedProperties.getStorage().getOplogSize() != null int oplogSize = (storage.getOplogSize() != null) ? storage.getOplogSize() : 0;
? this.embeddedProperties.getStorage().getOplogSize() builder.replication(new Storage(databaseDir, replSetName, oplogSize));
: 0));
} }
Integer configuredPort = this.properties.getPort(); Integer configuredPort = this.properties.getPort();
if (configuredPort != null && configuredPort > 0) { if (configuredPort != null && configuredPort > 0) {
......
...@@ -88,8 +88,8 @@ class DataSourceInitializedPublisher implements BeanPostProcessor { ...@@ -88,8 +88,8 @@ class DataSourceInitializedPublisher implements BeanPostProcessor {
private DataSource findDataSource(EntityManagerFactory entityManagerFactory) { private DataSource findDataSource(EntityManagerFactory entityManagerFactory) {
Object dataSource = entityManagerFactory.getProperties() Object dataSource = entityManagerFactory.getProperties()
.get("javax.persistence.nonJtaDataSource"); .get("javax.persistence.nonJtaDataSource");
return (dataSource != null && dataSource instanceof DataSource return (dataSource != null && dataSource instanceof DataSource)
? (DataSource) dataSource : this.dataSource); ? (DataSource) dataSource : this.dataSource;
} }
private boolean isInitializingDatabase(DataSource dataSource) { private boolean isInitializingDatabase(DataSource dataSource) {
......
...@@ -38,7 +38,7 @@ public class HibernateSettings { ...@@ -38,7 +38,7 @@ public class HibernateSettings {
} }
public String getDdlAuto() { public String getDdlAuto() {
return (this.ddlAuto != null ? this.ddlAuto.get() : null); return (this.ddlAuto != null) ? this.ddlAuto.get() : null;
} }
public HibernateSettings hibernatePropertiesCustomizers( public HibernateSettings hibernatePropertiesCustomizers(
......
...@@ -155,7 +155,7 @@ public class QuartzAutoConfiguration { ...@@ -155,7 +155,7 @@ public class QuartzAutoConfiguration {
private DataSource getDataSource(DataSource dataSource, private DataSource getDataSource(DataSource dataSource,
ObjectProvider<DataSource> quartzDataSource) { ObjectProvider<DataSource> quartzDataSource) {
DataSource dataSourceIfAvailable = quartzDataSource.getIfAvailable(); DataSource dataSourceIfAvailable = quartzDataSource.getIfAvailable();
return (dataSourceIfAvailable != null ? dataSourceIfAvailable : dataSource); return (dataSourceIfAvailable != null) ? dataSourceIfAvailable : dataSource;
} }
@Bean @Bean
......
...@@ -102,15 +102,15 @@ public final class OAuth2ClientPropertiesRegistrationAdapter { ...@@ -102,15 +102,15 @@ public final class OAuth2ClientPropertiesRegistrationAdapter {
private static Builder getBuilder(String registrationId, String configuredProviderId, private static Builder getBuilder(String registrationId, String configuredProviderId,
Map<String, Provider> providers) { Map<String, Provider> providers) {
String providerId = (configuredProviderId != null ? configuredProviderId String providerId = (configuredProviderId != null) ? configuredProviderId
: registrationId); : registrationId;
CommonOAuth2Provider provider = getCommonProvider(providerId); CommonOAuth2Provider provider = getCommonProvider(providerId);
if (provider == null && !providers.containsKey(providerId)) { if (provider == null && !providers.containsKey(providerId)) {
throw new IllegalStateException( throw new IllegalStateException(
getErrorMessage(configuredProviderId, registrationId)); getErrorMessage(configuredProviderId, registrationId));
} }
Builder builder = (provider != null ? provider.getBuilder(registrationId) Builder builder = (provider != null) ? provider.getBuilder(registrationId)
: ClientRegistration.withRegistrationId(registrationId)); : ClientRegistration.withRegistrationId(registrationId);
if (providers.containsKey(providerId)) { if (providers.containsKey(providerId)) {
return getBuilder(builder, providers.get(providerId)); return getBuilder(builder, providers.get(providerId));
} }
...@@ -119,7 +119,7 @@ public final class OAuth2ClientPropertiesRegistrationAdapter { ...@@ -119,7 +119,7 @@ public final class OAuth2ClientPropertiesRegistrationAdapter {
private static String getErrorMessage(String configuredProviderId, private static String getErrorMessage(String configuredProviderId,
String registrationId) { String registrationId) {
return (configuredProviderId != null return ((configuredProviderId != null)
? "Unknown provider ID '" + configuredProviderId + "'" ? "Unknown provider ID '" + configuredProviderId + "'"
: "Provider ID must be specified for client registration '" : "Provider ID must be specified for client registration '"
+ registrationId + "'"); + registrationId + "'");
......
...@@ -93,7 +93,7 @@ final class SessionStoreMappings { ...@@ -93,7 +93,7 @@ final class SessionStoreMappings {
} }
private String getName(Class<?> configuration) { private String getName(Class<?> configuration) {
return (configuration != null ? configuration.getName() : null); return (configuration != null) ? configuration.getName() : null;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment