Merge pull request #20967 from dreis2211

* pr/20967:
  Prevent shaded imports from Datastax

Closes gh-20967
pull/20973/head
Stephane Nicoll 5 years ago
commit 0a189e9cc1

@ -19,13 +19,13 @@ package org.springframework.boot.actuate.endpoint.web.servlet;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.StreamSupport; import java.util.stream.StreamSupport;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.datastax.oss.driver.shaded.guava.common.base.Functions;
import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -72,7 +72,7 @@ public class DefaultWebMvcTagsProviderTests {
private Map<String, Tag> asMap(Iterable<Tag> tags) { private Map<String, Tag> asMap(Iterable<Tag> tags) {
return StreamSupport.stream(tags.spliterator(), false) 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 { private static final class TestWebMvcTagsContributor implements WebMvcTagsContributor {

@ -19,10 +19,10 @@ package org.springframework.boot.actuate.metrics.web.reactive.server;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.StreamSupport; import java.util.stream.StreamSupport;
import com.datastax.oss.driver.shaded.guava.common.base.Functions;
import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.Tag;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -58,7 +58,7 @@ public class DefaultWebFluxTagsProviderTests {
private Map<String, Tag> asMap(Iterable<Tag> tags) { private Map<String, Tag> asMap(Iterable<Tag> tags) {
return StreamSupport.stream(tags.spliterator(), false) 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 { private static final class TestWebFluxTagsContributor implements WebFluxTagsContributor {

@ -16,7 +16,7 @@
name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck"> name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck">
<property name="regexp" value="true" /> <property name="regexp" value="true" />
<property name="illegalPkgs" <property name="illegalPkgs"
value="^sun.*, ^org\.apache\.commons\.(?!compress|dbcp2|lang|lang3|logging|pool2).*, ^com\.google\.common.*, ^io\.micrometer\.shaded.*, ^org\.flywaydb\.core\.internal.*, ^org\.testcontainers\.shaded.*" /> 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.*" />
<property name="illegalClasses" <property name="illegalClasses"
value="^com\.hazelcast\.util\.Base64, ^org\.junit\.rules\.ExpectedException, ^org\.mockito\.InjectMocks, ^org\.slf4j\.LoggerFactory, ^org.springframework.context.annotation.ScannedGenericBeanDefinition, ^reactor\.core\.support\.Assert" /> value="^com\.hazelcast\.util\.Base64, ^org\.junit\.rules\.ExpectedException, ^org\.mockito\.InjectMocks, ^org\.slf4j\.LoggerFactory, ^org.springframework.context.annotation.ScannedGenericBeanDefinition, ^reactor\.core\.support\.Assert" />
</module> </module>

Loading…
Cancel
Save