From b0eea26260a8bc1be95aaf560abcb7f59ee0cd49 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Wed, 15 Apr 2020 06:45:49 +0200 Subject: [PATCH] Prevent shaded imports from Datastax See gh-20967 --- .../endpoint/web/servlet/DefaultWebMvcTagsProviderTests.java | 4 ++-- .../web/reactive/server/DefaultWebFluxTagsProviderTests.java | 4 ++-- src/checkstyle/checkstyle.xml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/DefaultWebMvcTagsProviderTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/DefaultWebMvcTagsProviderTests.java index 0eeaad2f80..ca85f4aaec 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/DefaultWebMvcTagsProviderTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/DefaultWebMvcTagsProviderTests.java @@ -19,13 +19,13 @@ package org.springframework.boot.actuate.endpoint.web.servlet; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.StreamSupport; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import com.datastax.oss.driver.shaded.guava.common.base.Functions; import io.micrometer.core.instrument.Tag; import org.junit.jupiter.api.Test; @@ -72,7 +72,7 @@ public class DefaultWebMvcTagsProviderTests { private Map asMap(Iterable tags) { return StreamSupport.stream(tags.spliterator(), false) - .collect(Collectors.toMap(Tag::getKey, Functions.identity())); + .collect(Collectors.toMap(Tag::getKey, Function.identity())); } private static final class TestWebMvcTagsContributor implements WebMvcTagsContributor { diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/server/DefaultWebFluxTagsProviderTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/server/DefaultWebFluxTagsProviderTests.java index 948af61107..ffae9e16cb 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/server/DefaultWebFluxTagsProviderTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/reactive/server/DefaultWebFluxTagsProviderTests.java @@ -19,10 +19,10 @@ package org.springframework.boot.actuate.metrics.web.reactive.server; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.StreamSupport; -import com.datastax.oss.driver.shaded.guava.common.base.Functions; import io.micrometer.core.instrument.Tag; import org.junit.jupiter.api.Test; @@ -58,7 +58,7 @@ public class DefaultWebFluxTagsProviderTests { private Map asMap(Iterable tags) { return StreamSupport.stream(tags.spliterator(), false) - .collect(Collectors.toMap(Tag::getKey, Functions.identity())); + .collect(Collectors.toMap(Tag::getKey, Function.identity())); } private static final class TestWebFluxTagsContributor implements WebFluxTagsContributor { diff --git a/src/checkstyle/checkstyle.xml b/src/checkstyle/checkstyle.xml index e759f663af..220becf080 100644 --- a/src/checkstyle/checkstyle.xml +++ b/src/checkstyle/checkstyle.xml @@ -16,7 +16,7 @@ name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck"> + value="^sun.*, ^org\.apache\.commons\.(?!compress|dbcp2|lang|lang3|logging|pool2).*, ^com\.datastax\.oss\.driver\.shaded.*, ^com\.google\.common.*, ^io\.micrometer\.shaded.*, ^org\.flywaydb\.core\.internal.*, ^org\.testcontainers\.shaded.*" />