mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Prohibit usage of Micrometer nullability annotations
Closes gh-30881
This commit is contained in:
parent
8fe47aaebd
commit
0e7c3547dd
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2022 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -47,7 +47,6 @@ import io.micrometer.core.instrument.config.MeterFilter;
|
|||||||
import io.micrometer.core.instrument.config.MeterFilterReply;
|
import io.micrometer.core.instrument.config.MeterFilterReply;
|
||||||
import io.micrometer.core.instrument.simple.SimpleConfig;
|
import io.micrometer.core.instrument.simple.SimpleConfig;
|
||||||
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
|
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
|
||||||
import io.micrometer.core.lang.NonNull;
|
|
||||||
import io.micrometer.prometheus.PrometheusConfig;
|
import io.micrometer.prometheus.PrometheusConfig;
|
||||||
import io.micrometer.prometheus.PrometheusMeterRegistry;
|
import io.micrometer.prometheus.PrometheusMeterRegistry;
|
||||||
import io.prometheus.client.CollectorRegistry;
|
import io.prometheus.client.CollectorRegistry;
|
||||||
@ -357,8 +356,7 @@ class WebMvcMetricsFilterTests {
|
|||||||
clock);
|
clock);
|
||||||
r.config().meterFilter(new MeterFilter() {
|
r.config().meterFilter(new MeterFilter() {
|
||||||
@Override
|
@Override
|
||||||
@NonNull
|
public MeterFilterReply accept(Meter.Id id) {
|
||||||
public MeterFilterReply accept(@NonNull Meter.Id id) {
|
|
||||||
for (Tag tag : id.getTags()) {
|
for (Tag tag : id.getTags()) {
|
||||||
if (tag.getKey().equals("uri")
|
if (tag.getKey().equals("uri")
|
||||||
&& (tag.getValue().contains("histogram") || tag.getValue().contains("percentiles"))) {
|
&& (tag.getValue().contains("histogram") || tag.getValue().contains("percentiles"))) {
|
||||||
|
@ -13,7 +13,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|logging|pool2).*, ^com\.datastax\.oss\.driver\.shaded.*, ^com\.google\.common.*, ^io\.micrometer\.shaded.*, ^org\.flywaydb\.core\.internal.*, ^org\.jetbrains\.annotations.*, ^org\.testcontainers\.shaded.*" />
|
value="^sun.*, ^org\.apache\.commons\.(?!compress|dbcp2|logging|pool2).*, ^com\.datastax\.oss\.driver\.shaded.*, ^com\.google\.common.*, ^io\.micrometer\.core\.lang.*, ^io\.micrometer\.shaded.*, ^org\.flywaydb\.core\.internal.*, ^org\.jetbrains\.annotations.*, ^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…
Reference in New Issue
Block a user