Commit ce9c053c authored by Phillip Webb's avatar Phillip Webb

Fix checkstyle issues on master

Fix checkstyle issues following 2.0.x merge and
spring-javaformat upgrade.

See gh-13932
parent a6c9c92f
...@@ -147,7 +147,7 @@ public class CachesEndpoint { ...@@ -147,7 +147,7 @@ public class CachesEndpoint {
} }
private Predicate<String> isNameMatch(String name) { private Predicate<String> isNameMatch(String name) {
return (name != null ? ((requested) -> requested.equals(name)) : matchAll()); return (name != null) ? ((requested) -> requested.equals(name)) : matchAll();
} }
private Predicate<String> matchAll() { private Predicate<String> matchAll() {
......
...@@ -44,8 +44,8 @@ public class CachesEndpointWebExtension { ...@@ -44,8 +44,8 @@ public class CachesEndpointWebExtension {
@Nullable String cacheManager) { @Nullable String cacheManager) {
try { try {
CacheEntry entry = this.delegate.cache(cache, cacheManager); CacheEntry entry = this.delegate.cache(cache, cacheManager);
int status = (entry != null ? WebEndpointResponse.STATUS_OK int status = (entry != null) ? WebEndpointResponse.STATUS_OK
: WebEndpointResponse.STATUS_NOT_FOUND); : WebEndpointResponse.STATUS_NOT_FOUND;
return new WebEndpointResponse<>(entry, status); return new WebEndpointResponse<>(entry, status);
} }
catch (NonUniqueCacheException ex) { catch (NonUniqueCacheException ex) {
......
...@@ -60,7 +60,7 @@ public class HealthEndpoint { ...@@ -60,7 +60,7 @@ public class HealthEndpoint {
public Health healthForComponent(@Selector String component) { public Health healthForComponent(@Selector String component) {
HealthIndicator indicator = getNestedHealthIndicator(this.healthIndicator, HealthIndicator indicator = getNestedHealthIndicator(this.healthIndicator,
component); component);
return (indicator != null ? indicator.health() : null); return (indicator != null) ? indicator.health() : null;
} }
/** /**
...@@ -77,7 +77,7 @@ public class HealthEndpoint { ...@@ -77,7 +77,7 @@ public class HealthEndpoint {
HealthIndicator indicator = getNestedHealthIndicator(this.healthIndicator, HealthIndicator indicator = getNestedHealthIndicator(this.healthIndicator,
component); component);
HealthIndicator nestedIndicator = getNestedHealthIndicator(indicator, instance); HealthIndicator nestedIndicator = getNestedHealthIndicator(indicator, instance);
return (nestedIndicator != null ? nestedIndicator.health() : null); return (nestedIndicator != null) ? nestedIndicator.health() : null;
} }
private HealthIndicator getNestedHealthIndicator(HealthIndicator healthIndicator, private HealthIndicator getNestedHealthIndicator(HealthIndicator healthIndicator,
......
...@@ -93,7 +93,7 @@ public final class WebClientExchangeTags { ...@@ -93,7 +93,7 @@ public final class WebClientExchangeTags {
* @return the status tag * @return the status tag
*/ */
public static Tag status(Throwable throwable) { public static Tag status(Throwable throwable) {
return (throwable instanceof IOException ? IO_ERROR : CLIENT_ERROR); return (throwable instanceof IOException) ? IO_ERROR : CLIENT_ERROR;
} }
/** /**
......
...@@ -127,7 +127,7 @@ public class HibernateProperties { ...@@ -127,7 +127,7 @@ public class HibernateProperties {
if (ddlAuto != null) { if (ddlAuto != null) {
return ddlAuto; return ddlAuto;
} }
return (this.ddlAuto != null ? this.ddlAuto : defaultDdlAuto.get()); return (this.ddlAuto != null) ? this.ddlAuto : defaultDdlAuto.get();
} }
public static class Naming { public static class Naming {
......
...@@ -78,8 +78,8 @@ public final class OAuth2ClientPropertiesRegistrationAdapter { ...@@ -78,8 +78,8 @@ public final class OAuth2ClientPropertiesRegistrationAdapter {
private static Builder getBuilderFromIssuerIfPossible(String registrationId, private static Builder getBuilderFromIssuerIfPossible(String registrationId,
String configuredProviderId, Map<String, Provider> providers) { String configuredProviderId, Map<String, Provider> providers) {
String providerId = (configuredProviderId != null ? configuredProviderId String providerId = (configuredProviderId != null) ? configuredProviderId
: registrationId); : registrationId;
if (providers.containsKey(providerId)) { if (providers.containsKey(providerId)) {
Provider provider = providers.get(providerId); Provider provider = providers.get(providerId);
String issuer = provider.getIssuerUri(); String issuer = provider.getIssuerUri();
......
...@@ -49,7 +49,7 @@ class EnvVariables { ...@@ -49,7 +49,7 @@ class EnvVariables {
} }
private static String getValue(String value) { private static String getValue(String value) {
return (value != null ? value : ""); return (value != null) ? value : "";
} }
public Map<String, String> asMap() { public Map<String, String> asMap() {
......
...@@ -236,7 +236,7 @@ public class RepackageMojo extends AbstractDependencyFilterMojo { ...@@ -236,7 +236,7 @@ public class RepackageMojo extends AbstractDependencyFilterMojo {
*/ */
private Artifact getSourceArtifact() { private Artifact getSourceArtifact() {
Artifact sourceArtifact = getArtifact(this.classifier); Artifact sourceArtifact = getArtifact(this.classifier);
return (sourceArtifact != null ? sourceArtifact : this.project.getArtifact()); return (sourceArtifact != null) ? sourceArtifact : this.project.getArtifact();
} }
private Artifact getArtifact(String classifier) { private Artifact getArtifact(String classifier) {
...@@ -345,8 +345,8 @@ public class RepackageMojo extends AbstractDependencyFilterMojo { ...@@ -345,8 +345,8 @@ public class RepackageMojo extends AbstractDependencyFilterMojo {
this.classifier, target); this.classifier, target);
} }
else { else {
String artifactId = (this.classifier != null String artifactId = (this.classifier != null)
? "artifact with classifier " + this.classifier : "main artifact"); ? "artifact with classifier " + this.classifier : "main artifact";
getLog().info(String.format("Replacing %s %s", artifactId, source.getFile())); getLog().info(String.format("Replacing %s %s", artifactId, source.getFile()));
source.setFile(target); source.setFile(target);
} }
......
...@@ -81,9 +81,9 @@ public class ServletContextInitializerBeans ...@@ -81,9 +81,9 @@ public class ServletContextInitializerBeans
public ServletContextInitializerBeans(ListableBeanFactory beanFactory, public ServletContextInitializerBeans(ListableBeanFactory beanFactory,
Class<? extends ServletContextInitializer>... initializerTypes) { Class<? extends ServletContextInitializer>... initializerTypes) {
this.initializers = new LinkedMultiValueMap<>(); this.initializers = new LinkedMultiValueMap<>();
this.initializerTypes = (initializerTypes.length != 0 this.initializerTypes = (initializerTypes.length != 0)
? Arrays.asList(initializerTypes) ? Arrays.asList(initializerTypes)
: Collections.singletonList(ServletContextInitializer.class)); : Collections.singletonList(ServletContextInitializer.class);
addServletContextInitializerBeans(beanFactory); addServletContextInitializerBeans(beanFactory);
addAdaptableBeans(beanFactory); addAdaptableBeans(beanFactory);
List<ServletContextInitializer> sortedInitializers = this.initializers.values() List<ServletContextInitializer> sortedInitializers = this.initializers.values()
......
...@@ -77,9 +77,9 @@ public class HttpWebServiceMessageSenderBuilder { ...@@ -77,9 +77,9 @@ public class HttpWebServiceMessageSenderBuilder {
} }
public WebServiceMessageSender build() { public WebServiceMessageSender build() {
ClientHttpRequestFactory requestFactory = (this.requestFactorySupplier != null ClientHttpRequestFactory requestFactory = (this.requestFactorySupplier != null)
? this.requestFactorySupplier.get() ? this.requestFactorySupplier.get()
: new ClientHttpRequestFactorySupplier().get()); : new ClientHttpRequestFactorySupplier().get();
if (this.connectTimeout != null) { if (this.connectTimeout != null) {
new TimeoutRequestFactoryCustomizer(this.connectTimeout, "setConnectTimeout") new TimeoutRequestFactoryCustomizer(this.connectTimeout, "setConnectTimeout")
.customize(requestFactory); .customize(requestFactory);
......
...@@ -549,8 +549,8 @@ public class WebServiceTemplateBuilder { ...@@ -549,8 +549,8 @@ public class WebServiceTemplateBuilder {
} }
private static <T> Set<T> append(Set<T> set, Collection<? extends T> additions) { private static <T> Set<T> append(Set<T> set, Collection<? extends T> additions) {
Set<T> result = new LinkedHashSet<>(set != null ? set : Collections.emptySet()); Set<T> result = new LinkedHashSet<>((set != null) ? set : Collections.emptySet());
result.addAll(additions != null ? additions : Collections.emptyList()); result.addAll((additions != null) ? additions : Collections.emptyList());
return Collections.unmodifiableSet(result); return Collections.unmodifiableSet(result);
} }
......
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