From 68ffbafbae8f5902e64c8bf1d01eca34018db8c2 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Sat, 26 May 2018 00:01:45 -0700 Subject: [PATCH] Fix checkstyle violations --- .../metrics/web/reactive/client/WebClientExchangeTags.java | 4 ++-- .../actuate/health/HealthWebEndpointResponseMapperTests.java | 2 +- .../boot/autoconfigure/ldap/LdapAutoConfigurationTests.java | 2 +- .../java/org/springframework/boot/maven/RepackageMojo.java | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/WebClientExchangeTags.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/WebClientExchangeTags.java index ca852e3d6bf..22394d4e967 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/WebClientExchangeTags.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/WebClientExchangeTags.java @@ -67,7 +67,7 @@ public final class WebClientExchangeTags { private static String extractPath(String url) { String path = url.replaceFirst("^https?://[^/]+/", ""); - return path.startsWith("/") ? path : "/" + path; + return (path.startsWith("/") ? path : "/" + path); } /** @@ -87,7 +87,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); } /** diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthWebEndpointResponseMapperTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthWebEndpointResponseMapperTests.java index 3740db55c9f..97884a9d2c2 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthWebEndpointResponseMapperTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/HealthWebEndpointResponseMapperTests.java @@ -113,7 +113,7 @@ public class HealthWebEndpointResponseMapperTests { SecurityContext securityContext = mock(SecurityContext.class); given(securityContext.getPrincipal()).willReturn(mock(Principal.class)); given(securityContext.isUserInRole(anyString())) - .will((Answer) invocation -> { + .will((Answer) (invocation) -> { String expectedRole = invocation.getArgument(0); return associatedRoles.contains(expectedRole); }); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java index 9e54fd144a0..160d43b06da 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ldap/LdapAutoConfigurationTests.java @@ -108,7 +108,7 @@ public class LdapAutoConfigurationTests { @Test public void templateExists() { this.contextRunner.withPropertyValues("spring.ldap.urls:ldap://localhost:389") - .run(context -> assertThat(context).hasSingleBean(LdapTemplate.class)); + .run((context) -> assertThat(context).hasSingleBean(LdapTemplate.class)); } @Test diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java index 031888f93b1..3d0a699e75d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java @@ -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); }