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