Skip to content

Commit 64888b0

Browse files
committed
Merge branch '2.6.x' into 2.7.x
Closes gh-30433
2 parents aad59ef + 35d8f1d commit 64888b0

File tree

7 files changed

+22
-19
lines changed

7 files changed

+22
-19
lines changed

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlMetricsInstrumentation.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import io.micrometer.core.instrument.Timer;
3434

3535
import org.springframework.boot.actuate.metrics.AutoTimer;
36-
import org.springframework.lang.Nullable;
3736

3837
/**
3938
* Micrometer-based {@link SimpleInstrumentation}.
@@ -117,7 +116,7 @@ public DataFetcher<?> instrumentDataFetcher(DataFetcher<?> dataFetcher,
117116
}
118117

119118
private void recordDataFetcherMetric(Timer.Sample sample, DataFetcher<?> dataFetcher,
120-
InstrumentationFieldFetchParameters parameters, @Nullable Throwable throwable) {
119+
InstrumentationFieldFetchParameters parameters, Throwable throwable) {
121120
Timer.Builder timer = this.autoTimer.builder("graphql.datafetcher");
122121
timer.tags(this.tagsProvider.getDataFetchingTags(dataFetcher, parameters, throwable));
123122
sample.stop(timer.register(this.registry));

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlTags.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import graphql.schema.GraphQLObjectType;
2828
import io.micrometer.core.instrument.Tag;
2929

30-
import org.springframework.lang.Nullable;
3130
import org.springframework.util.CollectionUtils;
3231

3332
/**
@@ -48,7 +47,7 @@ private GraphQlTags() {
4847

4948
}
5049

51-
public static Tag executionOutcome(ExecutionResult result, @Nullable Throwable exception) {
50+
public static Tag executionOutcome(ExecutionResult result, Throwable exception) {
5251
if (exception == null && result.getErrors().isEmpty()) {
5352
return OUTCOME_SUCCESS;
5453
}
@@ -84,7 +83,7 @@ public static Tag errorPath(GraphQLError error) {
8483
return Tag.of("errorPath", builder.toString());
8584
}
8685

87-
public static Tag dataFetchingOutcome(@Nullable Throwable exception) {
86+
public static Tag dataFetchingOutcome(Throwable exception) {
8887
return (exception != null) ? OUTCOME_ERROR : OUTCOME_SUCCESS;
8988
}
9089

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlTagsContributor.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2021 the original author or authors.
2+
* Copyright 2020-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,8 +23,6 @@
2323
import graphql.schema.DataFetcher;
2424
import io.micrometer.core.instrument.Tag;
2525

26-
import org.springframework.lang.Nullable;
27-
2826
/**
2927
* A contributor of {@link Tag Tags} for Spring GraphQL-based request handling. Typically,
3028
* used by a {@link GraphQlTagsProvider} to provide tags in addition to its defaults.
@@ -35,11 +33,11 @@
3533
public interface GraphQlTagsContributor {
3634

3735
Iterable<Tag> getExecutionTags(InstrumentationExecutionParameters parameters, ExecutionResult result,
38-
@Nullable Throwable exception);
36+
Throwable exception);
3937

4038
Iterable<Tag> getErrorTags(InstrumentationExecutionParameters parameters, GraphQLError error);
4139

4240
Iterable<Tag> getDataFetchingTags(DataFetcher<?> dataFetcher, InstrumentationFieldFetchParameters parameters,
43-
@Nullable Throwable exception);
41+
Throwable exception);
4442

4543
}

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/graphql/GraphQlTagsProvider.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2021 the original author or authors.
2+
* Copyright 2020-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -23,8 +23,6 @@
2323
import graphql.schema.DataFetcher;
2424
import io.micrometer.core.instrument.Tag;
2525

26-
import org.springframework.lang.Nullable;
27-
2826
/**
2927
* Provides {@link Tag Tags} for Spring GraphQL-based request handling.
3028
*
@@ -34,11 +32,11 @@
3432
public interface GraphQlTagsProvider {
3533

3634
Iterable<Tag> getExecutionTags(InstrumentationExecutionParameters parameters, ExecutionResult result,
37-
@Nullable Throwable exception);
35+
Throwable exception);
3836

3937
Iterable<Tag> getErrorTags(InstrumentationExecutionParameters parameters, GraphQLError error);
4038

4139
Iterable<Tag> getDataFetchingTags(DataFetcher<?> dataFetcher, InstrumentationFieldFetchParameters parameters,
42-
@Nullable Throwable exception);
40+
Throwable exception);
4341

4442
}

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation/ImportCandidates.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
import java.util.Iterator;
2828
import java.util.List;
2929

30-
import org.jetbrains.annotations.NotNull;
31-
3230
import org.springframework.core.io.UrlResource;
3331
import org.springframework.util.Assert;
3432

@@ -54,7 +52,6 @@ private ImportCandidates(List<String> candidates) {
5452
this.candidates = Collections.unmodifiableList(candidates);
5553
}
5654

57-
@NotNull
5855
@Override
5956
public Iterator<String> iterator() {
6057
return this.candidates.iterator();

src/checkstyle/checkstyle.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck">
1414
<property name="regexp" value="true" />
1515
<property name="illegalPkgs"
16-
value="^sun.*, ^org\.apache\.commons\.(?!compress|dbcp2|logging|pool2).*, ^com\.datastax\.oss\.driver\.shaded.*, ^com\.google\.common.*, ^io\.micrometer\.shaded.*, ^org\.testcontainers\.shaded.*" />
16+
value="^sun.*, ^org\.apache\.commons\.(?!compress|dbcp2|logging|pool2).*, ^com\.datastax\.oss\.driver\.shaded.*, ^com\.google\.common.*, ^io\.micrometer\.shaded.*,
17+
^org\.jetbrains\.annotations.*, ^org\.testcontainers\.shaded.*" />
1718
<property name="illegalClasses"
1819
value="^com\.hazelcast\.util\.Base64, ^org\.junit\.rules\.ExpectedException, ^org\.mockito\.InjectMocks, ^org\.slf4j\.LoggerFactory, ^org.springframework.context.annotation.ScannedGenericBeanDefinition, ^reactor\.core\.support\.Assert"/>
1920
</module>

src/checkstyle/import-control.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<!DOCTYPE import-control PUBLIC "-//Checkstyle//DTD ImportControl Configuration 1.4//EN" "https://checkstyle.org/dtds/import_control_1_4.dtd">
33
<import-control pkg="org.springframework.boot">
44
<disallow pkg="io.micrometer" />
5+
<disallow pkg="org.springframework.lang" />
56
<allow pkg=".*" regex="true" />
67
<subpackage name="autoconfigure">
78
<disallow class="org.springframework.boot.autoconfigure.jdbc.DataSourceProperties"/>
@@ -45,6 +46,13 @@
4546
<subpackage name="endpoint">
4647
<disallow pkg="org.springframework.http" />
4748
<disallow pkg="org.springframework.web" />
49+
<subpackage name="invoke">
50+
<subpackage name="reflect">
51+
<file name="OperationMethodParameter">
52+
<allow pkg="org.springframework.lang"/>
53+
</file>
54+
</subpackage>
55+
</subpackage>
4856
<subpackage name="web">
4957
<allow pkg="org.springframework.http" />
5058
<allow pkg="org.springframework.web" />
@@ -56,6 +64,9 @@
5664
</subpackage>
5765
</subpackage>
5866
</subpackage>
67+
<file name=".*Endpoint(WebExtension)?" regex="true">
68+
<allow pkg="org.springframework.lang"/>
69+
</file>
5970
</subpackage>
6071

6172
<subpackage name="docs">

0 commit comments

Comments
 (0)