diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlMetricsInstrumentation.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlMetricsInstrumentation.java index 77df82a8927..af49865d54d 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlMetricsInstrumentation.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlMetricsInstrumentation.java @@ -33,7 +33,6 @@ import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.Timer; import org.springframework.boot.actuate.metrics.AutoTimer; -import org.springframework.lang.Nullable; /** * Micrometer-based {@link SimpleInstrumentation}. @@ -117,7 +116,7 @@ public class GraphQlMetricsInstrumentation extends SimpleInstrumentation { } private void recordDataFetcherMetric(Timer.Sample sample, DataFetcher dataFetcher, - InstrumentationFieldFetchParameters parameters, @Nullable Throwable throwable) { + InstrumentationFieldFetchParameters parameters, Throwable throwable) { Timer.Builder timer = this.autoTimer.builder("graphql.datafetcher"); timer.tags(this.tagsProvider.getDataFetchingTags(dataFetcher, parameters, throwable)); sample.stop(timer.register(this.registry)); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlTags.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlTags.java index 0d915ebcfea..a4547831925 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlTags.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlTags.java @@ -27,7 +27,6 @@ import graphql.execution.instrumentation.parameters.InstrumentationFieldFetchPar import graphql.schema.GraphQLObjectType; import io.micrometer.core.instrument.Tag; -import org.springframework.lang.Nullable; import org.springframework.util.CollectionUtils; /** @@ -48,7 +47,7 @@ public final class GraphQlTags { } - public static Tag executionOutcome(ExecutionResult result, @Nullable Throwable exception) { + public static Tag executionOutcome(ExecutionResult result, Throwable exception) { if (exception == null && result.getErrors().isEmpty()) { return OUTCOME_SUCCESS; } @@ -84,7 +83,7 @@ public final class GraphQlTags { return Tag.of("errorPath", builder.toString()); } - public static Tag dataFetchingOutcome(@Nullable Throwable exception) { + public static Tag dataFetchingOutcome(Throwable exception) { return (exception != null) ? OUTCOME_ERROR : OUTCOME_SUCCESS; } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlTagsContributor.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlTagsContributor.java index 99806736d8f..55b97055abb 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlTagsContributor.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlTagsContributor.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2021 the original author or authors. + * Copyright 2020-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +23,6 @@ import graphql.execution.instrumentation.parameters.InstrumentationFieldFetchPar import graphql.schema.DataFetcher; import io.micrometer.core.instrument.Tag; -import org.springframework.lang.Nullable; - /** * A contributor of {@link Tag Tags} for Spring GraphQL-based request handling. Typically, * used by a {@link GraphQlTagsProvider} to provide tags in addition to its defaults. @@ -35,11 +33,11 @@ import org.springframework.lang.Nullable; public interface GraphQlTagsContributor { Iterable getExecutionTags(InstrumentationExecutionParameters parameters, ExecutionResult result, - @Nullable Throwable exception); + Throwable exception); Iterable getErrorTags(InstrumentationExecutionParameters parameters, GraphQLError error); Iterable getDataFetchingTags(DataFetcher dataFetcher, InstrumentationFieldFetchParameters parameters, - @Nullable Throwable exception); + Throwable exception); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlTagsProvider.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlTagsProvider.java index 13ba9555b6e..a60ee6df07a 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlTagsProvider.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlTagsProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2021 the original author or authors. + * Copyright 2020-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +23,6 @@ import graphql.execution.instrumentation.parameters.InstrumentationFieldFetchPar import graphql.schema.DataFetcher; import io.micrometer.core.instrument.Tag; -import org.springframework.lang.Nullable; - /** * Provides {@link Tag Tags} for Spring GraphQL-based request handling. * @@ -34,11 +32,11 @@ import org.springframework.lang.Nullable; public interface GraphQlTagsProvider { Iterable getExecutionTags(InstrumentationExecutionParameters parameters, ExecutionResult result, - @Nullable Throwable exception); + Throwable exception); Iterable getErrorTags(InstrumentationExecutionParameters parameters, GraphQLError error); Iterable getDataFetchingTags(DataFetcher dataFetcher, InstrumentationFieldFetchParameters parameters, - @Nullable Throwable exception); + Throwable exception); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation/ImportCandidates.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation/ImportCandidates.java index efecb9bfc2a..3db5cc44a78 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation/ImportCandidates.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation/ImportCandidates.java @@ -27,8 +27,6 @@ import java.util.Enumeration; import java.util.Iterator; import java.util.List; -import org.jetbrains.annotations.NotNull; - import org.springframework.core.io.UrlResource; import org.springframework.util.Assert; @@ -54,7 +52,6 @@ public final class ImportCandidates implements Iterable { this.candidates = Collections.unmodifiableList(candidates); } - @NotNull @Override public Iterator iterator() { return this.candidates.iterator(); diff --git a/src/checkstyle/checkstyle.xml b/src/checkstyle/checkstyle.xml index f0f1aa09ee9..e55f14aec63 100644 --- a/src/checkstyle/checkstyle.xml +++ b/src/checkstyle/checkstyle.xml @@ -13,7 +13,8 @@ name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck"> + value="^sun.*, ^org\.apache\.commons\.(?!compress|dbcp2|logging|pool2).*, ^com\.datastax\.oss\.driver\.shaded.*, ^com\.google\.common.*, ^io\.micrometer\.shaded.*, + ^org\.jetbrains\.annotations.*, ^org\.testcontainers\.shaded.*" /> diff --git a/src/checkstyle/import-control.xml b/src/checkstyle/import-control.xml index af145b76d5c..445d18591cb 100644 --- a/src/checkstyle/import-control.xml +++ b/src/checkstyle/import-control.xml @@ -2,6 +2,7 @@ + @@ -45,6 +46,13 @@ + + + + + + + @@ -56,6 +64,9 @@ + + +