From 25a3f8feb92380650b41fc6bb6c2814295b24967 Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Wed, 2 Sep 2026 17:37:01 -0700 Subject: [PATCH] Remove unnecessary NullAway suppressions Signed-off-by: Manu Sridharan See gh-51591 --- .../boot/gradle/plugin/SpringBootPluginTests.java | 1 - .../boot/gradle/tasks/buildinfo/BuildInfoTests.java | 1 - .../gradle/tasks/bundling/AbstractBootArchiveTests.java | 1 - .../java/org/springframework/boot/maven/RunArguments.java | 1 - .../boot/maven/ArtifactsLibrariesTests.java | 4 ---- .../boot/maven/DependencyFilterMojoTests.java | 1 - .../org/springframework/boot/maven/JarTypeFilterTests.java | 1 - .../boot/buildpack/platform/build/BuildRequestTests.java | 1 - .../buildpack/platform/build/DirectoryBuildpackTests.java | 1 - .../buildpack/platform/build/EphemeralBuilderTests.java | 1 - .../boot/buildpack/platform/docker/DockerApiTests.java | 7 ------- .../docker/transport/HttpClientTransportTests.java | 4 ---- .../boot/buildpack/platform/io/FilePermissionsTests.java | 1 - .../boot/buildpack/platform/io/TarArchiveTests.java | 1 - .../boot/buildpack/platform/io/ZipFileTarArchiveTests.java | 1 - .../boot/cli/command/CommandRunnerTests.java | 2 -- .../condition/ConditionEvaluationReportTests.java | 3 --- .../context/PropertyPlaceholderAutoConfigurationTests.java | 1 - .../template/TemplateAvailabilityProvidersTests.java | 2 -- .../docker/compose/core/DockerCliIntegrationTests.java | 1 - .../docker/compose/core/DefaultRunningServiceTests.java | 1 - .../boot/docker/compose/core/DockerComposeFileTests.java | 1 - .../boot/docker/compose/core/DockerComposeOriginTests.java | 1 - .../lifecycle/DockerComposeLifecycleManagerTests.java | 1 - .../boot/test/json/JsonContentAssertTests.java | 1 - .../boot/DefaultApplicationContextFactory.java | 3 --- .../boot/context/properties/bind/Binder.java | 1 - .../properties/source/ConfigurationPropertyName.java | 2 -- .../org/springframework/boot/json/JsonValueWriter.java | 2 +- .../boot/logging/log4j2/StructuredLogLayout.java | 1 - .../boot/logging/structured/ContextPairs.java | 1 - .../logging/structured/ElasticCommonSchemaProperties.java | 1 - .../structured/GraylogExtendedLogFormatProperties.java | 2 -- .../test/java/org/springframework/boot/BannerTests.java | 1 - .../boot/context/ApplicationPidFileWriterTests.java | 1 - ...rImportCombinedWithProfileSpecificIntegrationTests.java | 1 - ...ConfigDataEnvironmentPostProcessorIntegrationTests.java | 1 - .../boot/context/config/ConfigDataImporterTests.java | 7 ------- .../context/config/ConfigDataLocationResolversTests.java | 4 ---- .../config/ConfigDataResourceNotFoundExceptionTests.java | 1 - .../context/config/ConfigTreeConfigDataLoaderTests.java | 1 - .../config/ConfigTreeConfigDataLocationResolverTests.java | 1 - .../boot/context/config/LocationResourceLoaderTests.java | 1 - .../context/logging/LoggingApplicationListenerTests.java | 1 - .../boot/context/properties/bind/BindConverterTests.java | 1 - .../boot/context/properties/bind/BindResultTests.java | 3 --- .../bind/BoundPropertiesTrackingBindHandlerTests.java | 1 - .../properties/source/ConfigurationPropertyNameTests.java | 1 - .../boot/convert/StringToFileConverterTests.java | 1 - .../boot/env/ConfigTreePropertySourceTests.java | 1 - .../boot/env/DefaultPropertiesPropertySourceTests.java | 1 - .../org/springframework/boot/json/WritableJsonTests.java | 1 - .../logging/log4j2/AbstractStructuredLoggingTests.java | 1 - .../boot/logging/log4j2/Log4j2FileXmlTests.java | 1 - .../logging/logback/AbstractStructuredLoggingTests.java | 1 - ...redLoggingJsonPropertiesJsonMembersCustomizerTests.java | 2 +- .../springframework/boot/system/ApplicationHomeTests.java | 1 - .../springframework/boot/system/ApplicationPidTests.java | 1 - .../web/servlet/AbstractFilterRegistrationBeanTests.java | 2 -- .../DelegatingFilterProxyRegistrationBeanTests.java | 1 - .../web/servlet/ServletListenerRegistrationBeanTests.java | 2 -- .../boot/web/servlet/ServletRegistrationBeanTests.java | 2 -- .../boot/jarmode/tools/AbstractJarModeTests.java | 1 - .../springframework/boot/jarmode/tools/ContextTests.java | 1 - .../boot/jarmode/tools/ExtractLayersCommandTests.java | 2 -- .../boot/jarmode/tools/HelpCommandTests.java | 1 - .../boot/jarmode/tools/IndexedLayersTests.java | 1 - .../boot/jarmode/tools/ListCommandTests.java | 2 -- .../boot/loader/tools/AbstractPackagerTests.java | 1 - .../springframework/boot/loader/tools/FileUtilsTests.java | 1 - .../actuate/endpoint/annotation/EndpointDiscoverer.java | 6 ++---- .../boot/actuate/endpoint/EndpointIdTests.java | 1 - .../invoker/cache/CachingOperationInvokerAdvisorTests.java | 2 -- .../actuate/endpoint/jmx/JmxEndpointExporterTests.java | 2 -- .../endpoint/web/ServletEndpointRegistrarTests.java | 3 --- .../boot/amqp/health/RabbitHealthIndicatorTests.java | 2 -- .../boot/cache/metrics/CacheMetricsRegistrar.java | 3 +-- .../cache/metrics/JCacheCacheMeterBinderProviderTests.java | 1 - .../endpoint/reactive/SecurityInterceptorTests.java | 2 -- .../actuate/endpoint/reactive/TokenValidatorTests.java | 1 - .../actuate/endpoint/servlet/SecurityInterceptorTests.java | 2 -- .../actuate/endpoint/servlet/TokenValidatorTests.java | 1 - .../data/jpa/autoconfigure/domain/country/Country.java | 2 -- .../devtools/tests/AbstractDevToolsIntegrationTests.java | 1 - .../devtools/autoconfigure/TriggerFileFilterTests.java | 1 - .../classpath/ClassPathFileChangeListenerTests.java | 3 --- .../boot/devtools/filewatch/ChangedFileTests.java | 1 - .../boot/devtools/filewatch/DirectorySnapshotTests.java | 1 - .../boot/devtools/filewatch/FileSnapshotTests.java | 1 - .../boot/devtools/filewatch/FileSystemWatcherTests.java | 1 - .../remote/client/DelayedLiveReloadTriggerTests.java | 6 ------ .../devtools/remote/client/HttpHeaderInterceptorTests.java | 2 -- .../boot/devtools/remote/server/DispatcherFilterTests.java | 2 -- .../boot/devtools/remote/server/DispatcherTests.java | 1 - .../boot/devtools/restart/ChangeableUrlsTests.java | 1 - .../devtools/restart/classloader/ClassLoaderFileTests.java | 3 --- .../devtools/restart/server/HttpRestartServerTests.java | 1 - .../application/AvailabilityStateHealthIndicatorTests.java | 1 - .../health/application/DiskSpaceHealthIndicatorTests.java | 1 - .../endpoint/AutoConfiguredHealthEndpointGroupTests.java | 4 ---- .../hibernate/autoconfigure/HibernatePropertiesTests.java | 1 - .../boot/hibernate/autoconfigure/test/country/Country.java | 2 -- .../boot/jdbc/metrics/DataSourcePoolMetrics.java | 1 - .../CompositeDataSourcePoolMetadataProviderTests.java | 7 ------- .../jpa/test/autoconfigure/TestEntityManagerTests.java | 3 --- .../boot/kafka/autoconfigure/KafkaProperties.java | 1 - .../autoconfigure/MeterRegistryPostProcessorTests.java | 5 ----- .../prometheus/PrometheusPushGatewayManagerTests.java | 4 ---- .../boot/reactor/netty/SslServerCustomizerTests.java | 1 - .../NettyReactiveWebServerFactoryCustomizerTests.java | 1 - .../test/RootUriRequestExpectationManagerTests.java | 1 - .../boot/restclient/RestTemplateBuilderTests.java | 2 -- .../boot/restclient/RootUriTemplateHandlerTests.java | 1 - .../autoconfigure/AutoConfiguredRestClientSslTests.java | 3 --- .../boot/rsocket/netty/NettyRSocketServerFactoryTests.java | 1 - .../DatabaseInitializationDependencyConfigurerTests.java | 1 - .../boot/tomcat/TomcatEmbeddedWebappClassLoaderTests.java | 1 - .../WebServerFactoryCustomizerBeanPostProcessorTests.java | 1 - .../web/server/context/WebServerPortFileWriterTests.java | 1 - .../boot/web/server/servlet/DocumentRootTests.java | 1 - .../boot/web/server/servlet/StaticResourceJarsTests.java | 1 - ...WebEnvironmentServletComponentScanIntegrationTests.java | 1 - .../context/ServletComponentScanIntegrationTests.java | 1 - .../context/ServletWebServerApplicationContextTests.java | 1 - ...anagementChildContextConfigurationIntegrationTests.java | 1 - ...cEndpointChildContextConfigurationIntegrationTests.java | 1 - .../autoconfigure/error/DefaultErrorViewResolverTests.java | 1 - .../webservices/client/WebServiceTemplateBuilderTests.java | 2 -- .../java/smoketest/aspectj/service/HelloWorldService.java | 1 - .../src/main/java/smoketest/data/rest/domain/City.java | 4 ---- .../src/main/java/smoketest/data/rest/domain/Hotel.java | 4 ---- .../src/main/java/smoketest/flyway/Person.java | 2 -- .../src/main/java/smoketest/jersey/Service.java | 1 - .../java/smoketest/jetty/service/HelloWorldService.java | 1 - .../java/smoketest/profile/service/GenericService.java | 2 -- .../smoketest/profile/service/GoodbyeWorldService.java | 1 - .../java/smoketest/profile/service/HelloWorldService.java | 1 - .../src/main/java/smoketest/secure/jersey/Service.java | 1 - .../java/smoketest/simple/service/HelloWorldService.java | 2 -- .../src/main/java/smoketest/test/domain/User.java | 2 -- .../java/smoketest/test/web/UserVehicleServiceTests.java | 2 -- .../java/smoketest/testng/service/HelloWorldService.java | 1 - .../java/smoketest/tomcat/service/HelloWorldService.java | 1 - .../websocket/jetty/SampleWebSocketsApplicationTests.java | 1 - .../echo/CustomContainerWebSocketsApplicationTests.java | 1 - .../websocket/tomcat/SampleWebSocketsApplicationTests.java | 1 - .../echo/CustomContainerWebSocketsApplicationTests.java | 1 - .../main/java/smoketest/xml/service/HelloWorldService.java | 1 - 148 files changed, 5 insertions(+), 241 deletions(-) diff --git a/build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/SpringBootPluginTests.java b/build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/SpringBootPluginTests.java index 77871c39a24..956c8edab86 100644 --- a/build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/SpringBootPluginTests.java +++ b/build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/SpringBootPluginTests.java @@ -38,7 +38,6 @@ import static org.assertj.core.api.Assertions.assertThat; class SpringBootPluginTests { @TempDir - @SuppressWarnings("NullAway.Init") File temp; @Test diff --git a/build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/buildinfo/BuildInfoTests.java b/build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/buildinfo/BuildInfoTests.java index 16cfa6140ae..cd60f0f0303 100644 --- a/build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/buildinfo/BuildInfoTests.java +++ b/build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/buildinfo/BuildInfoTests.java @@ -43,7 +43,6 @@ import static org.assertj.core.api.Assertions.assertThatException; class BuildInfoTests { @TempDir - @SuppressWarnings("NullAway.Init") File temp; @Test diff --git a/build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java b/build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java index 5ab4e610a86..45546e8c784 100644 --- a/build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java +++ b/build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveTests.java @@ -80,7 +80,6 @@ import static org.mockito.Mockito.mock; abstract class AbstractBootArchiveTests { @TempDir - @SuppressWarnings("NullAway.Init") File temp; private final Class taskClass; diff --git a/build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunArguments.java b/build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunArguments.java index 63712f5a130..23a5d56cf06 100644 --- a/build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunArguments.java +++ b/build-plugin/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunArguments.java @@ -38,7 +38,6 @@ class RunArguments { this(parseArgs(arguments)); } - @SuppressWarnings("NullAway") // Maven can't handle nullable arrays RunArguments(@Nullable String[] args) { this((args != null) ? Arrays.asList(args) : null); } diff --git a/build-plugin/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/ArtifactsLibrariesTests.java b/build-plugin/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/ArtifactsLibrariesTests.java index 41c7980ac54..553595f25b7 100644 --- a/build-plugin/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/ArtifactsLibrariesTests.java +++ b/build-plugin/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/ArtifactsLibrariesTests.java @@ -57,11 +57,9 @@ import static org.mockito.Mockito.times; class ArtifactsLibrariesTests { @Mock - @SuppressWarnings("NullAway.Init") private Artifact artifact; @Mock - @SuppressWarnings("NullAway.Init") private ArtifactHandler artifactHandler; private Set artifacts; @@ -71,11 +69,9 @@ class ArtifactsLibrariesTests { private ArtifactsLibraries libs; @Mock - @SuppressWarnings("NullAway.Init") private LibraryCallback callback; @Captor - @SuppressWarnings("NullAway.Init") private ArgumentCaptor libraryCaptor; @BeforeEach diff --git a/build-plugin/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/DependencyFilterMojoTests.java b/build-plugin/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/DependencyFilterMojoTests.java index 51b772d6558..34ea5321ce3 100644 --- a/build-plugin/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/DependencyFilterMojoTests.java +++ b/build-plugin/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/DependencyFilterMojoTests.java @@ -49,7 +49,6 @@ import static org.mockito.Mockito.mock; class DependencyFilterMojoTests { @TempDir - @SuppressWarnings("NullAway.Init") static Path temp; @Test diff --git a/build-plugin/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/JarTypeFilterTests.java b/build-plugin/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/JarTypeFilterTests.java index 7a0984e6575..4e1aa730f26 100644 --- a/build-plugin/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/JarTypeFilterTests.java +++ b/build-plugin/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/JarTypeFilterTests.java @@ -39,7 +39,6 @@ import static org.mockito.Mockito.mock; class JarTypeFilterTests { @TempDir - @SuppressWarnings("NullAway.Init") Path temp; @Test diff --git a/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildRequestTests.java b/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildRequestTests.java index 7bbb13d3e72..89f9f843f2d 100644 --- a/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildRequestTests.java +++ b/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildRequestTests.java @@ -61,7 +61,6 @@ class BuildRequestTests { private static final ZoneId UTC = ZoneId.of("UTC"); @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; @Test diff --git a/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/DirectoryBuildpackTests.java b/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/DirectoryBuildpackTests.java index b25d292cbdb..6526827781a 100644 --- a/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/DirectoryBuildpackTests.java +++ b/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/DirectoryBuildpackTests.java @@ -50,7 +50,6 @@ import static org.mockito.Mockito.mock; class DirectoryBuildpackTests { @TempDir - @SuppressWarnings("NullAway.Init") File temp; private File buildpackDir; diff --git a/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/EphemeralBuilderTests.java b/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/EphemeralBuilderTests.java index 4fc81396e1e..b1d3746e781 100644 --- a/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/EphemeralBuilderTests.java +++ b/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/EphemeralBuilderTests.java @@ -62,7 +62,6 @@ class EphemeralBuilderTests extends AbstractJsonTests { private static final int EXISTING_IMAGE_LAYER_COUNT = 43; @TempDir - @SuppressWarnings("NullAway.Init") File temp; private final BuildOwner owner = BuildOwner.of(123, 456); diff --git a/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/DockerApiTests.java b/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/DockerApiTests.java index a52843889bf..5010c04e0cb 100644 --- a/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/DockerApiTests.java +++ b/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/DockerApiTests.java @@ -105,7 +105,6 @@ class DockerApiTests { StandardCharsets.UTF_8); @Mock - @SuppressWarnings("NullAway.Init") private HttpTransport http; private DockerApi dockerApi; @@ -222,19 +221,15 @@ class DockerApiTests { private ImageApi api; @Mock - @SuppressWarnings("NullAway.Init") private UpdateListener pullListener; @Mock - @SuppressWarnings("NullAway.Init") private UpdateListener pushListener; @Mock - @SuppressWarnings("NullAway.Init") private UpdateListener loadListener; @Captor - @SuppressWarnings("NullAway.Init") private ArgumentCaptor> writer; @BeforeEach @@ -632,11 +627,9 @@ class DockerApiTests { private ContainerApi api; @Captor - @SuppressWarnings("NullAway.Init") private ArgumentCaptor> writer; @Mock - @SuppressWarnings("NullAway.Init") private UpdateListener logListener; @BeforeEach diff --git a/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/HttpClientTransportTests.java b/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/HttpClientTransportTests.java index c14c5941b24..62596487401 100644 --- a/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/HttpClientTransportTests.java +++ b/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/HttpClientTransportTests.java @@ -68,19 +68,15 @@ class HttpClientTransportTests { private static final String APPLICATION_X_TAR = "application/x-tar"; @Mock - @SuppressWarnings("NullAway.Init") private HttpClient client; @Mock - @SuppressWarnings("NullAway.Init") private ClassicHttpResponse response; @Mock - @SuppressWarnings("NullAway.Init") private HttpEntity entity; @Mock - @SuppressWarnings("NullAway.Init") private InputStream content; private HttpClientTransport http; diff --git a/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/FilePermissionsTests.java b/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/FilePermissionsTests.java index 3c75e9c7211..fed3588b8d1 100644 --- a/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/FilePermissionsTests.java +++ b/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/FilePermissionsTests.java @@ -45,7 +45,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; class FilePermissionsTests { @TempDir - @SuppressWarnings("NullAway.Init") Path tempDir; @Test diff --git a/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/TarArchiveTests.java b/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/TarArchiveTests.java index ff6d6984a8e..8739ee3fcd9 100644 --- a/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/TarArchiveTests.java +++ b/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/TarArchiveTests.java @@ -40,7 +40,6 @@ import static org.assertj.core.api.Assertions.assertThat; class TarArchiveTests { @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; @Test diff --git a/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchiveTests.java b/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchiveTests.java index 421a58b0295..09f2ceb1ff4 100644 --- a/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchiveTests.java +++ b/buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchiveTests.java @@ -42,7 +42,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; class ZipFileTarArchiveTests { @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; @Test diff --git a/cli/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java b/cli/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java index 3d8f92839e6..a32ad568259 100644 --- a/cli/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java +++ b/cli/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/CommandRunnerTests.java @@ -48,11 +48,9 @@ class CommandRunnerTests { private CommandRunner commandRunner; @Mock - @SuppressWarnings("NullAway.Init") private Command regularCommand; @Mock - @SuppressWarnings("NullAway.Init") private Command anotherCommand; private final Set calls = EnumSet.noneOf(Call.class); diff --git a/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReportTests.java b/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReportTests.java index da354c6f4f7..2a96bac139b 100644 --- a/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReportTests.java +++ b/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReportTests.java @@ -63,15 +63,12 @@ class ConditionEvaluationReportTests { private ConditionEvaluationReport report; @Mock - @SuppressWarnings("NullAway.Init") private Condition condition1; @Mock - @SuppressWarnings("NullAway.Init") private Condition condition2; @Mock - @SuppressWarnings("NullAway.Init") private Condition condition3; private @Nullable ConditionOutcome outcome1; diff --git a/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/context/PropertyPlaceholderAutoConfigurationTests.java b/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/context/PropertyPlaceholderAutoConfigurationTests.java index 12116750a92..d4aa092356e 100644 --- a/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/context/PropertyPlaceholderAutoConfigurationTests.java +++ b/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/context/PropertyPlaceholderAutoConfigurationTests.java @@ -101,7 +101,6 @@ class PropertyPlaceholderAutoConfigurationTests { static class PlaceholderConfig { @Value("${fruit:apple}") - @SuppressWarnings("NullAway.Init") private String fruit; } diff --git a/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProvidersTests.java b/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProvidersTests.java index 3cda48e7dad..00de88fe344 100644 --- a/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProvidersTests.java +++ b/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/template/TemplateAvailabilityProvidersTests.java @@ -53,7 +53,6 @@ class TemplateAvailabilityProvidersTests { private TemplateAvailabilityProviders providers; @Mock - @SuppressWarnings("NullAway.Init") private TemplateAvailabilityProvider provider; private final String view = "view"; @@ -63,7 +62,6 @@ class TemplateAvailabilityProvidersTests { private final MockEnvironment environment = new MockEnvironment(); @Mock - @SuppressWarnings("NullAway.Init") private ResourceLoader resourceLoader; @BeforeEach diff --git a/core/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/core/DockerCliIntegrationTests.java b/core/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/core/DockerCliIntegrationTests.java index 625c88f6544..3e1e4a5552f 100644 --- a/core/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/core/DockerCliIntegrationTests.java +++ b/core/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/core/DockerCliIntegrationTests.java @@ -59,7 +59,6 @@ import static org.assertj.core.api.Assertions.assertThat; class DockerCliIntegrationTests { @TempDir - @SuppressWarnings("NullAway.Init") private static Path tempDir; @Test diff --git a/core/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DefaultRunningServiceTests.java b/core/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DefaultRunningServiceTests.java index 60e78e30915..17f89393441 100644 --- a/core/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DefaultRunningServiceTests.java +++ b/core/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DefaultRunningServiceTests.java @@ -47,7 +47,6 @@ import static org.assertj.core.api.Assertions.entry; class DefaultRunningServiceTests { @TempDir - @SuppressWarnings("NullAway.Init") File temp; private DefaultRunningService runningService; diff --git a/core/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DockerComposeFileTests.java b/core/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DockerComposeFileTests.java index adbb1061fc8..eda63f06416 100644 --- a/core/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DockerComposeFileTests.java +++ b/core/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DockerComposeFileTests.java @@ -39,7 +39,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; class DockerComposeFileTests { @TempDir - @SuppressWarnings("NullAway.Init") File temp; @Test diff --git a/core/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DockerComposeOriginTests.java b/core/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DockerComposeOriginTests.java index ee921086d9f..b3e4c6dab7e 100644 --- a/core/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DockerComposeOriginTests.java +++ b/core/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/core/DockerComposeOriginTests.java @@ -37,7 +37,6 @@ import static org.assertj.core.api.Assertions.assertThat; class DockerComposeOriginTests { @TempDir - @SuppressWarnings("NullAway.Init") File temp; @Test diff --git a/core/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/lifecycle/DockerComposeLifecycleManagerTests.java b/core/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/lifecycle/DockerComposeLifecycleManagerTests.java index b6a978e1de7..bcd92b8ee86 100644 --- a/core/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/lifecycle/DockerComposeLifecycleManagerTests.java +++ b/core/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/lifecycle/DockerComposeLifecycleManagerTests.java @@ -69,7 +69,6 @@ import static org.mockito.Mockito.never; class DockerComposeLifecycleManagerTests { @TempDir - @SuppressWarnings("NullAway.Init") File temp; private DockerComposeFile dockerComposeFile; diff --git a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentAssertTests.java b/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentAssertTests.java index d1610fad9cc..6eb09b31aa7 100644 --- a/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentAssertTests.java +++ b/core/spring-boot-test/src/test/java/org/springframework/boot/test/json/JsonContentAssertTests.java @@ -64,7 +64,6 @@ class JsonContentAssertTests { private static final JSONComparator COMPARATOR = new DefaultComparator(JSONCompareMode.LENIENT); @TempDir - @SuppressWarnings("NullAway.Init") public Path tempDir; private File temp; diff --git a/core/spring-boot/src/main/java/org/springframework/boot/DefaultApplicationContextFactory.java b/core/spring-boot/src/main/java/org/springframework/boot/DefaultApplicationContextFactory.java index 4e9f24f5ab4..2e68029e1f4 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/DefaultApplicationContextFactory.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/DefaultApplicationContextFactory.java @@ -38,7 +38,6 @@ import org.springframework.lang.Contract; class DefaultApplicationContextFactory implements ApplicationContextFactory { // Method reference is not detected with correct nullability - @SuppressWarnings("NullAway") @Override public @Nullable Class getEnvironmentType( @Nullable WebApplicationType webApplicationType) { @@ -46,14 +45,12 @@ class DefaultApplicationContextFactory implements ApplicationContextFactory { } // Method reference is not detected with correct nullability - @SuppressWarnings("NullAway") @Override public @Nullable ConfigurableEnvironment createEnvironment(@Nullable WebApplicationType webApplicationType) { return getFromSpringFactories(webApplicationType, ApplicationContextFactory::createEnvironment, null); } // Method reference is not detected with correct nullability - @SuppressWarnings("NullAway") @Override public ConfigurableApplicationContext create(@Nullable WebApplicationType webApplicationType) { try { diff --git a/core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java b/core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java index ac0298e1c9a..39c3e37543b 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java @@ -345,7 +345,6 @@ public class Binder { * @return the bound or created object * @since 2.2.0 */ - @SuppressWarnings("NullAway") // https://github.com/uber/NullAway/issues/1232 public T bindOrCreate(ConfigurationPropertyName name, Bindable target, @Nullable BindHandler handler) { return bind(name, target, handler, true); } diff --git a/core/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java b/core/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java index b2d54716d9c..8d47d3e3986 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java @@ -635,7 +635,6 @@ public final class ConfigurationPropertyName implements Comparable @Nullable V processValue(@Nullable V value, ValueProcessor valueProcessor) { return (V) LambdaSafe .callback(ValueProcessor.class, valueProcessor, this.path, new @Nullable Object[] { value }) diff --git a/core/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/StructuredLogLayout.java b/core/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/StructuredLogLayout.java index 7e3fc0a2eda..0ea63dea7fa 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/StructuredLogLayout.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/StructuredLogLayout.java @@ -84,7 +84,6 @@ final class StructuredLogLayout extends AbstractStringLayout { private String format; @PluginBuilderAttribute - @SuppressWarnings("NullAway.Init") private String charset = StandardCharsets.UTF_8.name(); public Builder setFormat(String format) { diff --git a/core/spring-boot/src/main/java/org/springframework/boot/logging/structured/ContextPairs.java b/core/spring-boot/src/main/java/org/springframework/boot/logging/structured/ContextPairs.java index f45465fa05c..9d9b1e5ee27 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/logging/structured/ContextPairs.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/logging/structured/ContextPairs.java @@ -136,7 +136,6 @@ public class ContextPairs { * @param the map value type * @param extractor the extractor used to provide the map */ - @SuppressWarnings("NullAway") // Doesn't detect lambda with correct nullability public void addMapEntries(Function> extractor) { Function>> elementsExtractor = extractor.andThen(Map::entrySet); add(elementsExtractor, Map.Entry::getKey, Map.Entry::getValue); diff --git a/core/spring-boot/src/main/java/org/springframework/boot/logging/structured/ElasticCommonSchemaProperties.java b/core/spring-boot/src/main/java/org/springframework/boot/logging/structured/ElasticCommonSchemaProperties.java index 44bd93efe2f..c645857e3c9 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/logging/structured/ElasticCommonSchemaProperties.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/logging/structured/ElasticCommonSchemaProperties.java @@ -82,7 +82,6 @@ public record ElasticCommonSchemaProperties(Service service) { static final Service NONE = new Service(null, null, null, null); - @SuppressWarnings("NullAway") // Doesn't detect lambda with correct nullability void jsonMembers(Members members) { members.add("service").usingMembers((service) -> { service.add("name", this::name).whenHasLength(); diff --git a/core/spring-boot/src/main/java/org/springframework/boot/logging/structured/GraylogExtendedLogFormatProperties.java b/core/spring-boot/src/main/java/org/springframework/boot/logging/structured/GraylogExtendedLogFormatProperties.java index 5a5433382b4..265e64982d3 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/logging/structured/GraylogExtendedLogFormatProperties.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/logging/structured/GraylogExtendedLogFormatProperties.java @@ -58,7 +58,6 @@ public record GraylogExtendedLogFormatProperties(@Nullable String host, Service * Add {@link JsonWriter} members for the service. * @param members the members to add to */ - @SuppressWarnings("NullAway") // Doesn't detect lambda with correct nullability public void jsonMembers(JsonWriter.Members members) { members.add("host", this::host).whenHasLength(); this.service.jsonMembers(members); @@ -91,7 +90,6 @@ public record GraylogExtendedLogFormatProperties(@Nullable String host, Service return new Service(version); } - @SuppressWarnings("NullAway") // Doesn't detect lambda with correct nullability void jsonMembers(JsonWriter.Members members) { members.add("_service_version", this::version).whenHasLength(); } diff --git a/core/spring-boot/src/test/java/org/springframework/boot/BannerTests.java b/core/spring-boot/src/test/java/org/springframework/boot/BannerTests.java index d9e458435ad..5f494901fd4 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/BannerTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/BannerTests.java @@ -60,7 +60,6 @@ class BannerTests { } @Captor - @SuppressWarnings("NullAway.Init") private ArgumentCaptor> sourceClassCaptor; @Test diff --git a/core/spring-boot/src/test/java/org/springframework/boot/context/ApplicationPidFileWriterTests.java b/core/spring-boot/src/test/java/org/springframework/boot/context/ApplicationPidFileWriterTests.java index 0f740b6f778..e55b5ed7006 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/context/ApplicationPidFileWriterTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/context/ApplicationPidFileWriterTests.java @@ -57,7 +57,6 @@ class ApplicationPidFileWriterTests { new String[] {}, mock(ConfigurableApplicationContext.class)); @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; @BeforeEach diff --git a/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorImportCombinedWithProfileSpecificIntegrationTests.java b/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorImportCombinedWithProfileSpecificIntegrationTests.java index 17201575fdd..e26351de420 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorImportCombinedWithProfileSpecificIntegrationTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorImportCombinedWithProfileSpecificIntegrationTests.java @@ -63,7 +63,6 @@ class ConfigDataEnvironmentPostProcessorImportCombinedWithProfileSpecificIntegra private SpringApplication application; @TempDir - @SuppressWarnings("NullAway.Init") public File temp; @BeforeEach diff --git a/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorIntegrationTests.java b/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorIntegrationTests.java index 1b7d1f30a00..67b1eb8fa11 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorIntegrationTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentPostProcessorIntegrationTests.java @@ -86,7 +86,6 @@ class ConfigDataEnvironmentPostProcessorIntegrationTests { private SpringApplication application; @TempDir - @SuppressWarnings("NullAway.Init") public File temp; @BeforeEach diff --git a/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataImporterTests.java b/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataImporterTests.java index 49ff2cbc61e..97f4b487ac2 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataImporterTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataImporterTests.java @@ -47,31 +47,24 @@ class ConfigDataImporterTests { private final DeferredLogFactory logFactory = Supplier::get; @Mock - @SuppressWarnings("NullAway.Init") private ConfigDataLocationResolvers resolvers; @Mock - @SuppressWarnings("NullAway.Init") private ConfigDataLoaders loaders; @Mock - @SuppressWarnings("NullAway.Init") private Binder binder; @Mock - @SuppressWarnings("NullAway.Init") private ConfigDataLocationResolverContext locationResolverContext; @Mock - @SuppressWarnings("NullAway.Init") private ConfigDataLoaderContext loaderContext; @Mock - @SuppressWarnings("NullAway.Init") private ConfigDataActivationContext activationContext; @Mock - @SuppressWarnings("NullAway.Init") private Profiles profiles; @BeforeEach diff --git a/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataLocationResolversTests.java b/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataLocationResolversTests.java index 47aab9e4eea..bd70e554ef0 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataLocationResolversTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataLocationResolversTests.java @@ -56,19 +56,15 @@ class ConfigDataLocationResolversTests { private final DefaultBootstrapContext bootstrapContext = new DefaultBootstrapContext(); @Mock - @SuppressWarnings("NullAway.Init") private Binder binder; @Mock - @SuppressWarnings("NullAway.Init") private ConfigDataLocationResolverContext context; @Mock - @SuppressWarnings("NullAway.Init") private Profiles profiles; @TempDir - @SuppressWarnings("NullAway.Init") private File tempDir; @Test diff --git a/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataResourceNotFoundExceptionTests.java b/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataResourceNotFoundExceptionTests.java index 0c5d8892540..38cec27e507 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataResourceNotFoundExceptionTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataResourceNotFoundExceptionTests.java @@ -49,7 +49,6 @@ class ConfigDataResourceNotFoundExceptionTests { private File missing; @TempDir - @SuppressWarnings("NullAway.Init") File temp; @BeforeEach diff --git a/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigTreeConfigDataLoaderTests.java b/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigTreeConfigDataLoaderTests.java index 197e38e762c..476219bed4b 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigTreeConfigDataLoaderTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigTreeConfigDataLoaderTests.java @@ -44,7 +44,6 @@ class ConfigTreeConfigDataLoaderTests { private final ConfigDataLoaderContext loaderContext = mock(ConfigDataLoaderContext.class); @TempDir - @SuppressWarnings("NullAway.Init") Path directory; @Test diff --git a/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigTreeConfigDataLocationResolverTests.java b/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigTreeConfigDataLocationResolverTests.java index 0dd2fc040fe..5d7e0e379c0 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigTreeConfigDataLocationResolverTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigTreeConfigDataLocationResolverTests.java @@ -42,7 +42,6 @@ class ConfigTreeConfigDataLocationResolverTests { private final ConfigDataLocationResolverContext context = mock(ConfigDataLocationResolverContext.class); @TempDir - @SuppressWarnings("NullAway.Init") File temp; @Test diff --git a/core/spring-boot/src/test/java/org/springframework/boot/context/config/LocationResourceLoaderTests.java b/core/spring-boot/src/test/java/org/springframework/boot/context/config/LocationResourceLoaderTests.java index 3d44ff259e3..1d4e3e91438 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/context/config/LocationResourceLoaderTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/context/config/LocationResourceLoaderTests.java @@ -40,7 +40,6 @@ class LocationResourceLoaderTests { private final LocationResourceLoader loader = new LocationResourceLoader(new DefaultResourceLoader()); @TempDir - @SuppressWarnings("NullAway.Init") File temp; @Test diff --git a/core/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerTests.java b/core/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerTests.java index b213a57f9c1..2456896ac7e 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/context/logging/LoggingApplicationListenerTests.java @@ -120,7 +120,6 @@ class LoggingApplicationListenerTests { private final GenericApplicationContext context = new GenericApplicationContext(); @TempDir - @SuppressWarnings("NullAway.Init") public Path tempDir; private File logFile; diff --git a/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindConverterTests.java b/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindConverterTests.java index c6ea1c227c8..b28a312112e 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindConverterTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindConverterTests.java @@ -54,7 +54,6 @@ import static org.mockito.BDDMockito.then; class BindConverterTests { @Mock - @SuppressWarnings("NullAway.Init") private Consumer propertyEditorInitializer; @Test diff --git a/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindResultTests.java b/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindResultTests.java index c992695801d..c7cf5cc0398 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindResultTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindResultTests.java @@ -44,15 +44,12 @@ import static org.mockito.BDDMockito.then; class BindResultTests { @Mock - @SuppressWarnings("NullAway.Init") private Consumer consumer; @Mock - @SuppressWarnings("NullAway.Init") private Function mapper; @Mock - @SuppressWarnings("NullAway.Init") private Supplier supplier; @Test diff --git a/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BoundPropertiesTrackingBindHandlerTests.java b/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BoundPropertiesTrackingBindHandlerTests.java index 6a41e94550e..5d3fe12dcc1 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BoundPropertiesTrackingBindHandlerTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BoundPropertiesTrackingBindHandlerTests.java @@ -49,7 +49,6 @@ class BoundPropertiesTrackingBindHandlerTests { private Binder binder; @Mock - @SuppressWarnings("NullAway.Init") private Consumer consumer; @BeforeEach diff --git a/core/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertyNameTests.java b/core/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertyNameTests.java index 4797e335025..761e1a784e0 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertyNameTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/context/properties/source/ConfigurationPropertyNameTests.java @@ -40,7 +40,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException class ConfigurationPropertyNameTests { @Test - @SuppressWarnings("NullAway") // Test null check void ofNameShouldNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> ConfigurationPropertyName.of(null)) .withMessageContaining("'name' must not be null"); diff --git a/core/spring-boot/src/test/java/org/springframework/boot/convert/StringToFileConverterTests.java b/core/spring-boot/src/test/java/org/springframework/boot/convert/StringToFileConverterTests.java index 29197258cc3..9d6c5c96ce7 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/convert/StringToFileConverterTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/convert/StringToFileConverterTests.java @@ -39,7 +39,6 @@ import static org.assertj.core.api.Assertions.assertThat; class StringToFileConverterTests { @TempDir - @SuppressWarnings("NullAway.Init") File temp; @ConversionServiceTest diff --git a/core/spring-boot/src/test/java/org/springframework/boot/env/ConfigTreePropertySourceTests.java b/core/spring-boot/src/test/java/org/springframework/boot/env/ConfigTreePropertySourceTests.java index d79faf6b501..3ff448d836f 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/env/ConfigTreePropertySourceTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/env/ConfigTreePropertySourceTests.java @@ -49,7 +49,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; class ConfigTreePropertySourceTests { @TempDir - @SuppressWarnings("NullAway.Init") Path directory; @Test diff --git a/core/spring-boot/src/test/java/org/springframework/boot/env/DefaultPropertiesPropertySourceTests.java b/core/spring-boot/src/test/java/org/springframework/boot/env/DefaultPropertiesPropertySourceTests.java index f905dee6d83..9c4190a34cd 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/env/DefaultPropertiesPropertySourceTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/env/DefaultPropertiesPropertySourceTests.java @@ -44,7 +44,6 @@ import static org.mockito.BDDMockito.then; class DefaultPropertiesPropertySourceTests { @Mock - @SuppressWarnings("NullAway.Init") private Consumer action; @Test diff --git a/core/spring-boot/src/test/java/org/springframework/boot/json/WritableJsonTests.java b/core/spring-boot/src/test/java/org/springframework/boot/json/WritableJsonTests.java index aa3ea133f04..4cf37842fcb 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/json/WritableJsonTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/json/WritableJsonTests.java @@ -41,7 +41,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException class WritableJsonTests { @TempDir - @SuppressWarnings("NullAway.Init") File temp; @Test diff --git a/core/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/AbstractStructuredLoggingTests.java b/core/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/AbstractStructuredLoggingTests.java index 1e9212faca1..6e0512f87ad 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/AbstractStructuredLoggingTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/AbstractStructuredLoggingTests.java @@ -48,7 +48,6 @@ abstract class AbstractStructuredLoggingTests { private static final JsonMapper JSON_MAPPER = new JsonMapper(); @Mock - @SuppressWarnings("NullAway.Init") StructuredLoggingJsonMembersCustomizer customizer; MockStructuredLoggingJsonMembersCustomizerBuilder customizerBuilder = new MockStructuredLoggingJsonMembersCustomizerBuilder<>( diff --git a/core/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4j2FileXmlTests.java b/core/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4j2FileXmlTests.java index 1484360904f..88393a9eb31 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4j2FileXmlTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4j2FileXmlTests.java @@ -36,7 +36,6 @@ import static org.assertj.core.api.Assertions.assertThat; class Log4j2FileXmlTests extends Log4j2XmlTests { @TempDir - @SuppressWarnings("NullAway.Init") File temp; @Override diff --git a/core/spring-boot/src/test/java/org/springframework/boot/logging/logback/AbstractStructuredLoggingTests.java b/core/spring-boot/src/test/java/org/springframework/boot/logging/logback/AbstractStructuredLoggingTests.java index d6f4ae79b1a..365840170d5 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/logging/logback/AbstractStructuredLoggingTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/logging/logback/AbstractStructuredLoggingTests.java @@ -60,7 +60,6 @@ abstract class AbstractStructuredLoggingTests { private BasicMarkerFactory markerFactory; @Mock - @SuppressWarnings("NullAway.Init") StructuredLoggingJsonMembersCustomizer customizer; MockStructuredLoggingJsonMembersCustomizerBuilder customizerBuilder = new MockStructuredLoggingJsonMembersCustomizerBuilder<>( diff --git a/core/spring-boot/src/test/java/org/springframework/boot/logging/structured/StructuredLoggingJsonPropertiesJsonMembersCustomizerTests.java b/core/spring-boot/src/test/java/org/springframework/boot/logging/structured/StructuredLoggingJsonPropertiesJsonMembersCustomizerTests.java index 4411bac2ee9..1441025aef7 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/logging/structured/StructuredLoggingJsonPropertiesJsonMembersCustomizerTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/logging/structured/StructuredLoggingJsonPropertiesJsonMembersCustomizerTests.java @@ -43,7 +43,7 @@ import static org.mockito.BDDMockito.given; class StructuredLoggingJsonPropertiesJsonMembersCustomizerTests { @Mock - @SuppressWarnings({ "rawtypes", "NullAway.Init" }) + @SuppressWarnings("rawtypes") private Instantiator instantiator; @Test diff --git a/core/spring-boot/src/test/java/org/springframework/boot/system/ApplicationHomeTests.java b/core/spring-boot/src/test/java/org/springframework/boot/system/ApplicationHomeTests.java index 75b5d10cff0..22b034aa492 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/system/ApplicationHomeTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/system/ApplicationHomeTests.java @@ -40,7 +40,6 @@ import static org.assertj.core.api.Assertions.assertThat; class ApplicationHomeTests { @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; @Test diff --git a/core/spring-boot/src/test/java/org/springframework/boot/system/ApplicationPidTests.java b/core/spring-boot/src/test/java/org/springframework/boot/system/ApplicationPidTests.java index 9da1d3e90f9..96b5d5b767d 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/system/ApplicationPidTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/system/ApplicationPidTests.java @@ -40,7 +40,6 @@ import static org.assertj.core.api.Assertions.contentOf; class ApplicationPidTests { @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; @Test diff --git a/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBeanTests.java b/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBeanTests.java index 88287de72d1..6b2de8c9fa8 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBeanTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBeanTests.java @@ -61,11 +61,9 @@ import static org.mockito.Mockito.never; abstract class AbstractFilterRegistrationBeanTests { @Mock - @SuppressWarnings("NullAway.Init") ServletContext servletContext; @Mock - @SuppressWarnings("NullAway.Init") FilterRegistration.Dynamic registration; @Test diff --git a/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBeanTests.java b/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBeanTests.java index de34891703b..0ce0c64225f 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBeanTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/DelegatingFilterProxyRegistrationBeanTests.java @@ -56,7 +56,6 @@ class DelegatingFilterProxyRegistrationBeanTests extends AbstractFilterRegistrat } @Test - @SuppressWarnings("NullAway") // Test null check void targetBeanNameMustNotBeEmpty() { assertThatIllegalArgumentException().isThrownBy(() -> new DelegatingFilterProxyRegistrationBean("")) .withMessageContaining("'targetBeanName' must not be empty"); diff --git a/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBeanTests.java b/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBeanTests.java index f964ec180f6..e36141400fd 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBeanTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletListenerRegistrationBeanTests.java @@ -39,11 +39,9 @@ import static org.mockito.Mockito.never; class ServletListenerRegistrationBeanTests { @Mock - @SuppressWarnings("NullAway.Init") private ServletContextListener listener; @Mock - @SuppressWarnings("NullAway.Init") private ServletContext servletContext; @Test diff --git a/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletRegistrationBeanTests.java b/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletRegistrationBeanTests.java index 25c84d181e6..4084ab2d8fb 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletRegistrationBeanTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/web/servlet/ServletRegistrationBeanTests.java @@ -52,11 +52,9 @@ class ServletRegistrationBeanTests { private final MockServlet servlet = new MockServlet(); @Mock - @SuppressWarnings("NullAway.Init") private ServletContext servletContext; @Mock - @SuppressWarnings("NullAway.Init") private ServletRegistration.Dynamic registration; @Test diff --git a/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/AbstractJarModeTests.java b/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/AbstractJarModeTests.java index c27e8e92eee..abb15769a4e 100644 --- a/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/AbstractJarModeTests.java +++ b/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/AbstractJarModeTests.java @@ -54,7 +54,6 @@ import static org.assertj.core.api.Assertions.assertThat; abstract class AbstractJarModeTests { @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; Manifest createManifest(String... entries) { diff --git a/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/ContextTests.java b/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/ContextTests.java index 1e12f7dbdb2..2f3dec645d4 100644 --- a/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/ContextTests.java +++ b/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/ContextTests.java @@ -34,7 +34,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; class ContextTests { @TempDir - @SuppressWarnings("NullAway.Init") File temp; @Test diff --git a/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/ExtractLayersCommandTests.java b/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/ExtractLayersCommandTests.java index 4939a8a800a..e77cc02e391 100644 --- a/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/ExtractLayersCommandTests.java +++ b/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/ExtractLayersCommandTests.java @@ -69,11 +69,9 @@ class ExtractLayersCommandTests { private static final FileTime LAST_ACCESS_TIME = FileTime.from(NOW.minus(1, ChronoUnit.DAYS)); @TempDir - @SuppressWarnings("NullAway.Init") File temp; @Mock - @SuppressWarnings("NullAway.Init") private Context context; private File jarFile; diff --git a/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/HelpCommandTests.java b/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/HelpCommandTests.java index 77e6991e06f..0d99200b3da 100644 --- a/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/HelpCommandTests.java +++ b/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/HelpCommandTests.java @@ -40,7 +40,6 @@ class HelpCommandTests { private TestPrintStream out; @TempDir - @SuppressWarnings("NullAway.Init") Path temp; @BeforeEach diff --git a/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/IndexedLayersTests.java b/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/IndexedLayersTests.java index 82a49a5e905..50053fb1a7b 100644 --- a/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/IndexedLayersTests.java +++ b/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/IndexedLayersTests.java @@ -42,7 +42,6 @@ import static org.mockito.Mockito.mock; class IndexedLayersTests { @TempDir - @SuppressWarnings("NullAway.Init") File temp; @Test diff --git a/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/ListCommandTests.java b/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/ListCommandTests.java index f890a772691..bd7e3997aba 100644 --- a/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/ListCommandTests.java +++ b/loader/spring-boot-jarmode-tools/src/test/java/org/springframework/boot/jarmode/tools/ListCommandTests.java @@ -48,11 +48,9 @@ import static org.mockito.BDDMockito.given; class ListCommandTests { @TempDir - @SuppressWarnings("NullAway.Init") File temp; @Mock - @SuppressWarnings("NullAway.Init") private Context context; private ListCommand command; diff --git a/loader/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/AbstractPackagerTests.java b/loader/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/AbstractPackagerTests.java index b817ecb5578..02a02d1befa 100644 --- a/loader/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/AbstractPackagerTests.java +++ b/loader/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/AbstractPackagerTests.java @@ -89,7 +89,6 @@ abstract class AbstractPackagerTests

{ } @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; protected TestJarFile testJarFile; diff --git a/loader/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/FileUtilsTests.java b/loader/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/FileUtilsTests.java index 52105c93ee7..be354b00c78 100644 --- a/loader/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/FileUtilsTests.java +++ b/loader/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/FileUtilsTests.java @@ -39,7 +39,6 @@ import static org.assertj.core.api.Assertions.assertThat; class FileUtilsTests { @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; private File outputDirectory; diff --git a/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java b/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java index 2be51f27daf..796c7d5cdb5 100644 --- a/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java +++ b/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscoverer.java @@ -342,8 +342,7 @@ public abstract class EndpointDiscoverer, O exten return isFilterMatch(filter, getFilterEndpoint(endpointBean)); } - // Doesn't detect lambda with correct nullability - @SuppressWarnings({ "unchecked", "NullAway" }) + @SuppressWarnings("unchecked") private boolean isFilterMatch(EndpointFilter filter, E endpoint) { Boolean result = LambdaSafe.callback(EndpointFilter.class, filter, endpoint) .withLogger(EndpointDiscoverer.class) @@ -362,8 +361,7 @@ public abstract class EndpointDiscoverer, O exten return false; } - // Doesn't detect lambda with correct nullability - @SuppressWarnings({ "unchecked", "NullAway" }) + @SuppressWarnings("unchecked") private boolean isFilterMatch(OperationFilter filter, Operation operation, EndpointId endpointId, Access defaultAccess) { Boolean result = LambdaSafe.callback(OperationFilter.class, filter, operation) diff --git a/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EndpointIdTests.java b/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EndpointIdTests.java index 0e834b8c926..e6f4ff84fcb 100644 --- a/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EndpointIdTests.java +++ b/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/EndpointIdTests.java @@ -42,7 +42,6 @@ class EndpointIdTests { } @Test - @SuppressWarnings("NullAway") // Test null check void ofWhenEmptyThrowsException() { assertThatIllegalArgumentException().isThrownBy(() -> EndpointId.of("")) .withMessage("'value' must not be empty"); diff --git a/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoker/cache/CachingOperationInvokerAdvisorTests.java b/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoker/cache/CachingOperationInvokerAdvisorTests.java index d6c694266fd..312d4f88fef 100644 --- a/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoker/cache/CachingOperationInvokerAdvisorTests.java +++ b/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoker/cache/CachingOperationInvokerAdvisorTests.java @@ -51,11 +51,9 @@ import static org.mockito.BDDMockito.then; class CachingOperationInvokerAdvisorTests { @Mock - @SuppressWarnings("NullAway.Init") private OperationInvoker invoker; @Mock - @SuppressWarnings("NullAway.Init") private Function timeToLive; private CachingOperationInvokerAdvisor advisor; diff --git a/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JmxEndpointExporterTests.java b/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JmxEndpointExporterTests.java index 22d6745165e..59742fa8deb 100644 --- a/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JmxEndpointExporterTests.java +++ b/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/jmx/JmxEndpointExporterTests.java @@ -59,11 +59,9 @@ class JmxEndpointExporterTests { private final List endpoints = new ArrayList<>(); @Mock - @SuppressWarnings("NullAway.Init") private MBeanServer mBeanServer; @Spy - @SuppressWarnings("NullAway.Init") private EndpointObjectNameFactory objectNameFactory = new TestEndpointObjectNameFactory(); private JmxEndpointExporter exporter; diff --git a/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrarTests.java b/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrarTests.java index 66d3cb5f506..e429c239b9b 100644 --- a/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrarTests.java +++ b/module/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrarTests.java @@ -58,15 +58,12 @@ import static org.mockito.Mockito.mock; class ServletEndpointRegistrarTests { @Mock - @SuppressWarnings("NullAway.Init") private ServletContext servletContext; @Mock - @SuppressWarnings("NullAway.Init") private ServletRegistration.Dynamic servletDynamic; @Mock - @SuppressWarnings("NullAway.Init") private FilterRegistration.Dynamic filterDynamic; @Test diff --git a/module/spring-boot-amqp/src/test/java/org/springframework/boot/amqp/health/RabbitHealthIndicatorTests.java b/module/spring-boot-amqp/src/test/java/org/springframework/boot/amqp/health/RabbitHealthIndicatorTests.java index 5ce2f8e64a2..c4eed7b94d1 100644 --- a/module/spring-boot-amqp/src/test/java/org/springframework/boot/amqp/health/RabbitHealthIndicatorTests.java +++ b/module/spring-boot-amqp/src/test/java/org/springframework/boot/amqp/health/RabbitHealthIndicatorTests.java @@ -45,11 +45,9 @@ import static org.mockito.Mockito.mock; class RabbitHealthIndicatorTests { @Mock - @SuppressWarnings("NullAway.Init") private RabbitTemplate rabbitTemplate; @Mock - @SuppressWarnings("NullAway.Init") private Channel channel; @Test diff --git a/module/spring-boot-cache/src/main/java/org/springframework/boot/cache/metrics/CacheMetricsRegistrar.java b/module/spring-boot-cache/src/main/java/org/springframework/boot/cache/metrics/CacheMetricsRegistrar.java index 10512ed2e81..78832f9c45e 100644 --- a/module/spring-boot-cache/src/main/java/org/springframework/boot/cache/metrics/CacheMetricsRegistrar.java +++ b/module/spring-boot-cache/src/main/java/org/springframework/boot/cache/metrics/CacheMetricsRegistrar.java @@ -69,8 +69,7 @@ public class CacheMetricsRegistrar { return false; } - // Lambda isn't detected with the correct nullability - @SuppressWarnings({ "unchecked", "NullAway" }) + @SuppressWarnings("unchecked") private @Nullable MeterBinder getMeterBinder(Cache cache, Tags tags) { Tags cacheTags = tags.and(getAdditionalTags(cache)); return LambdaSafe.callbacks(CacheMeterBinderProvider.class, this.binderProviders, cache) diff --git a/module/spring-boot-cache/src/test/java/org/springframework/boot/cache/metrics/JCacheCacheMeterBinderProviderTests.java b/module/spring-boot-cache/src/test/java/org/springframework/boot/cache/metrics/JCacheCacheMeterBinderProviderTests.java index ead43d2c1fa..b0620f19be1 100644 --- a/module/spring-boot-cache/src/test/java/org/springframework/boot/cache/metrics/JCacheCacheMeterBinderProviderTests.java +++ b/module/spring-boot-cache/src/test/java/org/springframework/boot/cache/metrics/JCacheCacheMeterBinderProviderTests.java @@ -42,7 +42,6 @@ import static org.mockito.Mockito.mock; class JCacheCacheMeterBinderProviderTests { @Mock - @SuppressWarnings("NullAway.Init") private javax.cache.Cache nativeCache; @Test diff --git a/module/spring-boot-cloudfoundry/src/test/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/reactive/SecurityInterceptorTests.java b/module/spring-boot-cloudfoundry/src/test/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/reactive/SecurityInterceptorTests.java index 5584a03315a..ac9c05c760f 100644 --- a/module/spring-boot-cloudfoundry/src/test/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/reactive/SecurityInterceptorTests.java +++ b/module/spring-boot-cloudfoundry/src/test/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/reactive/SecurityInterceptorTests.java @@ -48,11 +48,9 @@ import static org.mockito.BDDMockito.given; class SecurityInterceptorTests { @Mock - @SuppressWarnings("NullAway.Init") private TokenValidator tokenValidator; @Mock - @SuppressWarnings("NullAway.Init") private SecurityService securityService; private SecurityInterceptor interceptor; diff --git a/module/spring-boot-cloudfoundry/src/test/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/reactive/TokenValidatorTests.java b/module/spring-boot-cloudfoundry/src/test/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/reactive/TokenValidatorTests.java index 1ada7c9c8be..e82478edff7 100644 --- a/module/spring-boot-cloudfoundry/src/test/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/reactive/TokenValidatorTests.java +++ b/module/spring-boot-cloudfoundry/src/test/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/reactive/TokenValidatorTests.java @@ -60,7 +60,6 @@ class TokenValidatorTests { private static final byte[] DOT = ".".getBytes(); @Mock - @SuppressWarnings("NullAway.Init") private SecurityService securityService; private TokenValidator tokenValidator; diff --git a/module/spring-boot-cloudfoundry/src/test/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/servlet/SecurityInterceptorTests.java b/module/spring-boot-cloudfoundry/src/test/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/servlet/SecurityInterceptorTests.java index 5a8c41ef59a..b369f1340ca 100644 --- a/module/spring-boot-cloudfoundry/src/test/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/servlet/SecurityInterceptorTests.java +++ b/module/spring-boot-cloudfoundry/src/test/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/servlet/SecurityInterceptorTests.java @@ -46,11 +46,9 @@ import static org.mockito.BDDMockito.then; class SecurityInterceptorTests { @Mock - @SuppressWarnings("NullAway.Init") private TokenValidator tokenValidator; @Mock - @SuppressWarnings("NullAway.Init") private SecurityService securityService; private SecurityInterceptor interceptor; diff --git a/module/spring-boot-cloudfoundry/src/test/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/servlet/TokenValidatorTests.java b/module/spring-boot-cloudfoundry/src/test/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/servlet/TokenValidatorTests.java index 3eeb731dfff..596fb65daeb 100644 --- a/module/spring-boot-cloudfoundry/src/test/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/servlet/TokenValidatorTests.java +++ b/module/spring-boot-cloudfoundry/src/test/java/org/springframework/boot/cloudfoundry/autoconfigure/actuate/endpoint/servlet/TokenValidatorTests.java @@ -59,7 +59,6 @@ class TokenValidatorTests { private static final byte[] DOT = ".".getBytes(); @Mock - @SuppressWarnings("NullAway.Init") private SecurityService securityService; private TokenValidator tokenValidator; diff --git a/module/spring-boot-data-jpa/src/test/java/org/springframework/boot/data/jpa/autoconfigure/domain/country/Country.java b/module/spring-boot-data-jpa/src/test/java/org/springframework/boot/data/jpa/autoconfigure/domain/country/Country.java index b3e45d3da39..8b241745130 100644 --- a/module/spring-boot-data-jpa/src/test/java/org/springframework/boot/data/jpa/autoconfigure/domain/country/Country.java +++ b/module/spring-boot-data-jpa/src/test/java/org/springframework/boot/data/jpa/autoconfigure/domain/country/Country.java @@ -31,12 +31,10 @@ public class Country implements Serializable { @Id @GeneratedValue - @SuppressWarnings("NullAway.Init") private Long id; @Audited @Column - @SuppressWarnings("NullAway.Init") private String name; public Long getId() { diff --git a/module/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java b/module/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java index d564a4816ab..43c8cef1b6f 100644 --- a/module/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java +++ b/module/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java @@ -52,7 +52,6 @@ abstract class AbstractDevToolsIntegrationTests { protected final JvmLauncher javaLauncher = new JvmLauncher(); @TempDir - @SuppressWarnings("NullAway.Init") protected static File temp; private @Nullable LaunchedApplication launchedApplication; diff --git a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/TriggerFileFilterTests.java b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/TriggerFileFilterTests.java index 902dd12fb1b..f56a5751c42 100644 --- a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/TriggerFileFilterTests.java +++ b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/TriggerFileFilterTests.java @@ -32,7 +32,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException class TriggerFileFilterTests { @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; @Test diff --git a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileChangeListenerTests.java b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileChangeListenerTests.java index 0627ccc0f22..e6fd448f85c 100644 --- a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileChangeListenerTests.java +++ b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileChangeListenerTests.java @@ -47,15 +47,12 @@ import static org.mockito.Mockito.never; class ClassPathFileChangeListenerTests { @Mock - @SuppressWarnings("NullAway.Init") private ApplicationEventPublisher eventPublisher; @Mock - @SuppressWarnings("NullAway.Init") private ClassPathRestartStrategy restartStrategy; @Mock - @SuppressWarnings("NullAway.Init") private FileSystemWatcher fileSystemWatcher; @Test diff --git a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/ChangedFileTests.java b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/ChangedFileTests.java index a4ae95de806..932f56e779a 100644 --- a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/ChangedFileTests.java +++ b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/ChangedFileTests.java @@ -34,7 +34,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException class ChangedFileTests { @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; @Test diff --git a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/DirectorySnapshotTests.java b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/DirectorySnapshotTests.java index e91c218ceb2..d6f7d036d20 100644 --- a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/DirectorySnapshotTests.java +++ b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/DirectorySnapshotTests.java @@ -38,7 +38,6 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException class DirectorySnapshotTests { @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; private File directory; diff --git a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSnapshotTests.java b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSnapshotTests.java index 157c9c4cfb9..6574bf40889 100644 --- a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSnapshotTests.java +++ b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSnapshotTests.java @@ -42,7 +42,6 @@ class FileSnapshotTests { private static final long MODIFIED = new Date().getTime() - TimeUnit.DAYS.toMillis(10); @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; @Test diff --git a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java index 04668fdb3cf..46f6e2bbcee 100644 --- a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java +++ b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java @@ -54,7 +54,6 @@ class FileSystemWatcherTests { private final List> changes = Collections.synchronizedList(new ArrayList<>()); @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; @BeforeEach diff --git a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/DelayedLiveReloadTriggerTests.java b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/DelayedLiveReloadTriggerTests.java index 013c6c73cf7..449cc128c26 100644 --- a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/DelayedLiveReloadTriggerTests.java +++ b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/DelayedLiveReloadTriggerTests.java @@ -49,27 +49,21 @@ class DelayedLiveReloadTriggerTests { private static final String URL = "http://localhost:8080"; @Mock - @SuppressWarnings("NullAway.Init") private OptionalLiveReloadServer liveReloadServer; @Mock - @SuppressWarnings("NullAway.Init") private ClientHttpRequestFactory requestFactory; @Mock - @SuppressWarnings("NullAway.Init") private ClientHttpRequest errorRequest; @Mock - @SuppressWarnings("NullAway.Init") private ClientHttpRequest okRequest; @Mock - @SuppressWarnings("NullAway.Init") private ClientHttpResponse errorResponse; @Mock - @SuppressWarnings("NullAway.Init") private ClientHttpResponse okResponse; private DelayedLiveReloadTrigger trigger; diff --git a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/HttpHeaderInterceptorTests.java b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/HttpHeaderInterceptorTests.java index d9d74abf001..9e97ab92288 100644 --- a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/HttpHeaderInterceptorTests.java +++ b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/HttpHeaderInterceptorTests.java @@ -54,11 +54,9 @@ class HttpHeaderInterceptorTests { private byte[] body; @Mock - @SuppressWarnings("NullAway.Init") private ClientHttpRequestExecution execution; @Mock - @SuppressWarnings("NullAway.Init") private ClientHttpResponse response; private MockHttpServletRequest httpRequest; diff --git a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherFilterTests.java b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherFilterTests.java index cdcd593fac7..6e7b11a566c 100644 --- a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherFilterTests.java +++ b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherFilterTests.java @@ -51,11 +51,9 @@ import static org.mockito.Mockito.mock; class DispatcherFilterTests { @Mock - @SuppressWarnings("NullAway.Init") private Dispatcher dispatcher; @Mock - @SuppressWarnings("NullAway.Init") private FilterChain chain; private DispatcherFilter filter; diff --git a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java index 0dbb5adc2fd..e8dccae2691 100644 --- a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java +++ b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/server/DispatcherTests.java @@ -52,7 +52,6 @@ import static org.mockito.Mockito.withSettings; class DispatcherTests { @Mock - @SuppressWarnings("NullAway.Init") private AccessManager accessManager; private final MockHttpServletResponse response = new MockHttpServletResponse(); diff --git a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/ChangeableUrlsTests.java b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/ChangeableUrlsTests.java index 1f3f269c198..e52ab7513fd 100644 --- a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/ChangeableUrlsTests.java +++ b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/ChangeableUrlsTests.java @@ -43,7 +43,6 @@ import static org.assertj.core.api.Assertions.assertThat; class ChangeableUrlsTests { @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; @Test diff --git a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFileTests.java b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFileTests.java index e1a4de611c3..dedf3abecd0 100644 --- a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFileTests.java +++ b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/classloader/ClassLoaderFileTests.java @@ -40,21 +40,18 @@ class ClassLoaderFileTests { } @Test - @SuppressWarnings("NullAway") // Test null check void addedContentsMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new ClassLoaderFile(Kind.ADDED, null)) .withMessageContaining("'contents' must not be null"); } @Test - @SuppressWarnings("NullAway") // Test null check void modifiedContentsMustNotBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new ClassLoaderFile(Kind.MODIFIED, null)) .withMessageContaining("'contents' must not be null"); } @Test - @SuppressWarnings("NullAway") // Test null check void deletedContentsMustBeNull() { assertThatIllegalArgumentException().isThrownBy(() -> new ClassLoaderFile(Kind.DELETED, new byte[10])) .withMessageContaining("'contents' must be null"); diff --git a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/server/HttpRestartServerTests.java b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/server/HttpRestartServerTests.java index 2ce47ec0013..d3149153912 100644 --- a/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/server/HttpRestartServerTests.java +++ b/module/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/server/HttpRestartServerTests.java @@ -52,7 +52,6 @@ import static org.mockito.BDDMockito.then; class HttpRestartServerTests { @Mock - @SuppressWarnings("NullAway.Init") private RestartServer delegate; private HttpRestartServer server; diff --git a/module/spring-boot-health/src/test/java/org/springframework/boot/health/application/AvailabilityStateHealthIndicatorTests.java b/module/spring-boot-health/src/test/java/org/springframework/boot/health/application/AvailabilityStateHealthIndicatorTests.java index 1eef1b53ab8..94d6691804b 100644 --- a/module/spring-boot-health/src/test/java/org/springframework/boot/health/application/AvailabilityStateHealthIndicatorTests.java +++ b/module/spring-boot-health/src/test/java/org/springframework/boot/health/application/AvailabilityStateHealthIndicatorTests.java @@ -41,7 +41,6 @@ import static org.mockito.BDDMockito.given; class AvailabilityStateHealthIndicatorTests { @Mock - @SuppressWarnings("NullAway.Init") private ApplicationAvailability applicationAvailability; @Test diff --git a/module/spring-boot-health/src/test/java/org/springframework/boot/health/application/DiskSpaceHealthIndicatorTests.java b/module/spring-boot-health/src/test/java/org/springframework/boot/health/application/DiskSpaceHealthIndicatorTests.java index 13f99c44bfe..ce710d14730 100644 --- a/module/spring-boot-health/src/test/java/org/springframework/boot/health/application/DiskSpaceHealthIndicatorTests.java +++ b/module/spring-boot-health/src/test/java/org/springframework/boot/health/application/DiskSpaceHealthIndicatorTests.java @@ -46,7 +46,6 @@ class DiskSpaceHealthIndicatorTests { private static final DataSize TOTAL_SPACE = DataSize.ofKilobytes(10); @Mock - @SuppressWarnings("NullAway.Init") private File fileMock; private HealthIndicator healthIndicator; diff --git a/module/spring-boot-health/src/test/java/org/springframework/boot/health/autoconfigure/actuate/endpoint/AutoConfiguredHealthEndpointGroupTests.java b/module/spring-boot-health/src/test/java/org/springframework/boot/health/autoconfigure/actuate/endpoint/AutoConfiguredHealthEndpointGroupTests.java index e981cf9efd0..ec44262893a 100644 --- a/module/spring-boot-health/src/test/java/org/springframework/boot/health/autoconfigure/actuate/endpoint/AutoConfiguredHealthEndpointGroupTests.java +++ b/module/spring-boot-health/src/test/java/org/springframework/boot/health/autoconfigure/actuate/endpoint/AutoConfiguredHealthEndpointGroupTests.java @@ -45,19 +45,15 @@ import static org.mockito.Mockito.mock; class AutoConfiguredHealthEndpointGroupTests { @Mock - @SuppressWarnings("NullAway.Init") private StatusAggregator statusAggregator; @Mock - @SuppressWarnings("NullAway.Init") private HttpCodeStatusMapper httpCodeStatusMapper; @Mock - @SuppressWarnings("NullAway.Init") private SecurityContext securityContext; @Mock - @SuppressWarnings("NullAway.Init") private Principal principal; @Test diff --git a/module/spring-boot-hibernate/src/test/java/org/springframework/boot/hibernate/autoconfigure/HibernatePropertiesTests.java b/module/spring-boot-hibernate/src/test/java/org/springframework/boot/hibernate/autoconfigure/HibernatePropertiesTests.java index f606b034980..578faf5aaa3 100644 --- a/module/spring-boot-hibernate/src/test/java/org/springframework/boot/hibernate/autoconfigure/HibernatePropertiesTests.java +++ b/module/spring-boot-hibernate/src/test/java/org/springframework/boot/hibernate/autoconfigure/HibernatePropertiesTests.java @@ -56,7 +56,6 @@ class HibernatePropertiesTests { .withUserConfiguration(TestConfiguration.class); @Mock - @SuppressWarnings("NullAway.Init") private Supplier ddlAutoSupplier; @Test diff --git a/module/spring-boot-hibernate/src/test/java/org/springframework/boot/hibernate/autoconfigure/test/country/Country.java b/module/spring-boot-hibernate/src/test/java/org/springframework/boot/hibernate/autoconfigure/test/country/Country.java index 497c580b2b6..6c78085f642 100644 --- a/module/spring-boot-hibernate/src/test/java/org/springframework/boot/hibernate/autoconfigure/test/country/Country.java +++ b/module/spring-boot-hibernate/src/test/java/org/springframework/boot/hibernate/autoconfigure/test/country/Country.java @@ -31,12 +31,10 @@ public class Country implements Serializable { @Id @GeneratedValue - @SuppressWarnings("NullAway.Init") private Long id; @Audited @Column - @SuppressWarnings("NullAway.Init") private String name; public Long getId() { diff --git a/module/spring-boot-jdbc/src/main/java/org/springframework/boot/jdbc/metrics/DataSourcePoolMetrics.java b/module/spring-boot-jdbc/src/main/java/org/springframework/boot/jdbc/metrics/DataSourcePoolMetrics.java index e9ee62d9176..9ee57d9ae1a 100644 --- a/module/spring-boot-jdbc/src/main/java/org/springframework/boot/jdbc/metrics/DataSourcePoolMetrics.java +++ b/module/spring-boot-jdbc/src/main/java/org/springframework/boot/jdbc/metrics/DataSourcePoolMetrics.java @@ -65,7 +65,6 @@ public class DataSourcePoolMetrics implements MeterBinder { } @Override - @SuppressWarnings("NullAway") // Lambda isn't detected with the correct nullability public void bindTo(MeterRegistry registry) { if (this.metadataProvider.getDataSourcePoolMetadata(this.dataSource) != null) { bindPoolMetadata(registry, "active", diff --git a/module/spring-boot-jdbc/src/test/java/org/springframework/boot/jdbc/metadata/CompositeDataSourcePoolMetadataProviderTests.java b/module/spring-boot-jdbc/src/test/java/org/springframework/boot/jdbc/metadata/CompositeDataSourcePoolMetadataProviderTests.java index 029ecbe0576..5da66ef0b5d 100644 --- a/module/spring-boot-jdbc/src/test/java/org/springframework/boot/jdbc/metadata/CompositeDataSourcePoolMetadataProviderTests.java +++ b/module/spring-boot-jdbc/src/test/java/org/springframework/boot/jdbc/metadata/CompositeDataSourcePoolMetadataProviderTests.java @@ -38,31 +38,24 @@ import static org.mockito.BDDMockito.given; class CompositeDataSourcePoolMetadataProviderTests { @Mock - @SuppressWarnings("NullAway.Init") private DataSourcePoolMetadataProvider firstProvider; @Mock - @SuppressWarnings("NullAway.Init") private DataSourcePoolMetadata first; @Mock - @SuppressWarnings("NullAway.Init") private DataSource firstDataSource; @Mock - @SuppressWarnings("NullAway.Init") private DataSourcePoolMetadataProvider secondProvider; @Mock - @SuppressWarnings("NullAway.Init") private DataSourcePoolMetadata second; @Mock - @SuppressWarnings("NullAway.Init") private DataSource secondDataSource; @Mock - @SuppressWarnings("NullAway.Init") private DataSource unknownDataSource; @BeforeEach diff --git a/module/spring-boot-jpa-test/src/test/java/org/springframework/boot/jpa/test/autoconfigure/TestEntityManagerTests.java b/module/spring-boot-jpa-test/src/test/java/org/springframework/boot/jpa/test/autoconfigure/TestEntityManagerTests.java index dccd36982de..840ad168bc3 100644 --- a/module/spring-boot-jpa-test/src/test/java/org/springframework/boot/jpa/test/autoconfigure/TestEntityManagerTests.java +++ b/module/spring-boot-jpa-test/src/test/java/org/springframework/boot/jpa/test/autoconfigure/TestEntityManagerTests.java @@ -43,15 +43,12 @@ import static org.mockito.BDDMockito.then; class TestEntityManagerTests { @Mock - @SuppressWarnings("NullAway.Init") private EntityManagerFactory entityManagerFactory; @Mock - @SuppressWarnings("NullAway.Init") private EntityManager entityManager; @Mock - @SuppressWarnings("NullAway.Init") private PersistenceUnitUtil persistenceUnitUtil; private TestEntityManager testEntityManager; diff --git a/module/spring-boot-kafka/src/main/java/org/springframework/boot/kafka/autoconfigure/KafkaProperties.java b/module/spring-boot-kafka/src/main/java/org/springframework/boot/kafka/autoconfigure/KafkaProperties.java index 5ee8472140e..7755dd01272 100644 --- a/module/spring-boot-kafka/src/main/java/org/springframework/boot/kafka/autoconfigure/KafkaProperties.java +++ b/module/spring-boot-kafka/src/main/java/org/springframework/boot/kafka/autoconfigure/KafkaProperties.java @@ -1421,7 +1421,6 @@ public class KafkaProperties { return properties; } - @SuppressWarnings("NullAway") // Doesn't detect lambda with correct nullability private void validate() { MutuallyExclusiveConfigurationPropertiesException.throwIfMultipleMatchingValuesIn((entries) -> { entries.put("spring.kafka.ssl.key-store-key", getKeyStoreKey()); diff --git a/module/spring-boot-micrometer-metrics/src/test/java/org/springframework/boot/micrometer/metrics/autoconfigure/MeterRegistryPostProcessorTests.java b/module/spring-boot-micrometer-metrics/src/test/java/org/springframework/boot/micrometer/metrics/autoconfigure/MeterRegistryPostProcessorTests.java index d0a5f1178f8..569b8136e29 100644 --- a/module/spring-boot-micrometer-metrics/src/test/java/org/springframework/boot/micrometer/metrics/autoconfigure/MeterRegistryPostProcessorTests.java +++ b/module/spring-boot-micrometer-metrics/src/test/java/org/springframework/boot/micrometer/metrics/autoconfigure/MeterRegistryPostProcessorTests.java @@ -67,23 +67,18 @@ class MeterRegistryPostProcessorTests { private final List binders = new ArrayList<>(); @Mock - @SuppressWarnings("NullAway.Init") private MeterRegistryCustomizer mockCustomizer; @Mock - @SuppressWarnings("NullAway.Init") private MeterFilter mockFilter; @Mock - @SuppressWarnings("NullAway.Init") private MeterBinder mockBinder; @Mock - @SuppressWarnings("NullAway.Init") private MeterRegistry mockRegistry; @Mock - @SuppressWarnings("NullAway.Init") private Config mockConfig; private final ApplicationContext meterRegistryCloserContext = mock(ApplicationContext.class); diff --git a/module/spring-boot-micrometer-metrics/src/test/java/org/springframework/boot/micrometer/metrics/export/prometheus/PrometheusPushGatewayManagerTests.java b/module/spring-boot-micrometer-metrics/src/test/java/org/springframework/boot/micrometer/metrics/export/prometheus/PrometheusPushGatewayManagerTests.java index 71595846064..e835c528e95 100644 --- a/module/spring-boot-micrometer-metrics/src/test/java/org/springframework/boot/micrometer/metrics/export/prometheus/PrometheusPushGatewayManagerTests.java +++ b/module/spring-boot-micrometer-metrics/src/test/java/org/springframework/boot/micrometer/metrics/export/prometheus/PrometheusPushGatewayManagerTests.java @@ -50,21 +50,17 @@ import static org.mockito.Mockito.never; class PrometheusPushGatewayManagerTests { @Mock - @SuppressWarnings("NullAway.Init") private PushGateway pushGateway; @Mock - @SuppressWarnings("NullAway.Init") private TaskScheduler scheduler; private final Duration pushRate = Duration.ofSeconds(1); @Captor - @SuppressWarnings("NullAway.Init") private ArgumentCaptor task; @Mock - @SuppressWarnings("NullAway.Init") private ScheduledFuture future; @Test diff --git a/module/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/SslServerCustomizerTests.java b/module/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/SslServerCustomizerTests.java index 08137c53d51..7d2a3e566fd 100644 --- a/module/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/SslServerCustomizerTests.java +++ b/module/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/SslServerCustomizerTests.java @@ -60,7 +60,6 @@ class SslServerCustomizerTests { @Test @WithPackageResources({ "1.key", "1.crt" }) - @SuppressWarnings("NullAway") // Test null check void getSslProviderReturnsDefaultWhenServerNameIsNull() { SslBundle defaultBundle = createBundle("1.key", "1.crt"); SslServerCustomizer customizer = new SslServerCustomizer(null, Ssl.ClientAuth.NONE, defaultBundle, diff --git a/module/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizerTests.java b/module/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizerTests.java index c3ee9666fc5..ce74bd3c395 100644 --- a/module/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizerTests.java +++ b/module/spring-boot-reactor-netty/src/test/java/org/springframework/boot/reactor/netty/autoconfigure/NettyReactiveWebServerFactoryCustomizerTests.java @@ -63,7 +63,6 @@ class NettyReactiveWebServerFactoryCustomizerTests { private NettyReactiveWebServerFactoryCustomizer customizer; @Captor - @SuppressWarnings("NullAway.Init") private ArgumentCaptor customizerCaptor; @BeforeEach diff --git a/module/spring-boot-restclient-test/src/test/java/org/springframework/boot/restclient/test/RootUriRequestExpectationManagerTests.java b/module/spring-boot-restclient-test/src/test/java/org/springframework/boot/restclient/test/RootUriRequestExpectationManagerTests.java index acdb2d9fd44..ed79bf71889 100644 --- a/module/spring-boot-restclient-test/src/test/java/org/springframework/boot/restclient/test/RootUriRequestExpectationManagerTests.java +++ b/module/spring-boot-restclient-test/src/test/java/org/springframework/boot/restclient/test/RootUriRequestExpectationManagerTests.java @@ -55,7 +55,6 @@ class RootUriRequestExpectationManagerTests { private final String uri = "https://example.com"; @Mock - @SuppressWarnings("NullAway.Init") private RequestExpectationManager delegate; private RootUriRequestExpectationManager manager; diff --git a/module/spring-boot-restclient/src/test/java/org/springframework/boot/restclient/RestTemplateBuilderTests.java b/module/spring-boot-restclient/src/test/java/org/springframework/boot/restclient/RestTemplateBuilderTests.java index 84dc48e7ffa..8007dbf1aa1 100644 --- a/module/spring-boot-restclient/src/test/java/org/springframework/boot/restclient/RestTemplateBuilderTests.java +++ b/module/spring-boot-restclient/src/test/java/org/springframework/boot/restclient/RestTemplateBuilderTests.java @@ -86,11 +86,9 @@ class RestTemplateBuilderTests { private final RestTemplateBuilder builder = new RestTemplateBuilder(); @Mock - @SuppressWarnings("NullAway.Init") private HttpMessageConverter messageConverter; @Mock - @SuppressWarnings("NullAway.Init") private ClientHttpRequestInterceptor interceptor; @Test diff --git a/module/spring-boot-restclient/src/test/java/org/springframework/boot/restclient/RootUriTemplateHandlerTests.java b/module/spring-boot-restclient/src/test/java/org/springframework/boot/restclient/RootUriTemplateHandlerTests.java index 9140f2e8c82..f11660101cb 100644 --- a/module/spring-boot-restclient/src/test/java/org/springframework/boot/restclient/RootUriTemplateHandlerTests.java +++ b/module/spring-boot-restclient/src/test/java/org/springframework/boot/restclient/RootUriTemplateHandlerTests.java @@ -48,7 +48,6 @@ class RootUriTemplateHandlerTests { private URI uri; @Mock - @SuppressWarnings("NullAway.Init") public UriTemplateHandler delegate; public UriTemplateHandler handler; diff --git a/module/spring-boot-restclient/src/test/java/org/springframework/boot/restclient/autoconfigure/AutoConfiguredRestClientSslTests.java b/module/spring-boot-restclient/src/test/java/org/springframework/boot/restclient/autoconfigure/AutoConfiguredRestClientSslTests.java index 98c1ede6136..79be8b78633 100644 --- a/module/spring-boot-restclient/src/test/java/org/springframework/boot/restclient/autoconfigure/AutoConfiguredRestClientSslTests.java +++ b/module/spring-boot-restclient/src/test/java/org/springframework/boot/restclient/autoconfigure/AutoConfiguredRestClientSslTests.java @@ -52,15 +52,12 @@ class AutoConfiguredRestClientSslTests { .withConnectTimeout(Duration.ofSeconds(30)); @Mock - @SuppressWarnings("NullAway.Init") private SslBundles sslBundles; @Mock - @SuppressWarnings("NullAway.Init") private ClientHttpRequestFactoryBuilder factoryBuilder; @Mock - @SuppressWarnings("NullAway.Init") private ClientHttpRequestFactory factory; private AutoConfiguredRestClientSsl restClientSsl; diff --git a/module/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactoryTests.java b/module/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactoryTests.java index 7f102a59241..b4fc91b1c06 100644 --- a/module/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactoryTests.java +++ b/module/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/netty/NettyRSocketServerFactoryTests.java @@ -281,7 +281,6 @@ class NettyRSocketServerFactoryTests { @Test @WithPackageResources({ "test-cert.pem", "test-key.pem" }) - @SuppressWarnings("NullAway") // Test null check void websocketTransportSslProviderReturnsDefaultWhenServerNameIsNull() { SslBundle defaultBundle = createBundle("test-cert.pem", "test-key.pem"); NettyRSocketServerFactory.HttpServerSslCustomizer customizer = new NettyRSocketServerFactory.HttpServerSslCustomizer( diff --git a/module/spring-boot-sql/src/test/java/org/springframework/boot/sql/init/dependency/DatabaseInitializationDependencyConfigurerTests.java b/module/spring-boot-sql/src/test/java/org/springframework/boot/sql/init/dependency/DatabaseInitializationDependencyConfigurerTests.java index 418f11f6bd6..66e3410adbf 100644 --- a/module/spring-boot-sql/src/test/java/org/springframework/boot/sql/init/dependency/DatabaseInitializationDependencyConfigurerTests.java +++ b/module/spring-boot-sql/src/test/java/org/springframework/boot/sql/init/dependency/DatabaseInitializationDependencyConfigurerTests.java @@ -68,7 +68,6 @@ class DatabaseInitializationDependencyConfigurerTests { private final ConfigurableEnvironment environment = new MockEnvironment(); @TempDir - @SuppressWarnings("NullAway.Init") File temp; @BeforeEach diff --git a/module/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/TomcatEmbeddedWebappClassLoaderTests.java b/module/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/TomcatEmbeddedWebappClassLoaderTests.java index f7b55c33c8d..36285bdf3a9 100644 --- a/module/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/TomcatEmbeddedWebappClassLoaderTests.java +++ b/module/spring-boot-tomcat/src/test/java/org/springframework/boot/tomcat/TomcatEmbeddedWebappClassLoaderTests.java @@ -45,7 +45,6 @@ import static org.assertj.core.api.Assertions.assertThat; class TomcatEmbeddedWebappClassLoaderTests { @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; @Test diff --git a/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java b/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java index 60cde67f91a..2b9e38f53ee 100644 --- a/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java +++ b/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java @@ -46,7 +46,6 @@ class WebServerFactoryCustomizerBeanPostProcessorTests { private final WebServerFactoryCustomizerBeanPostProcessor processor = new WebServerFactoryCustomizerBeanPostProcessor(); @Mock - @SuppressWarnings("NullAway.Init") private ListableBeanFactory beanFactory; @BeforeEach diff --git a/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/context/WebServerPortFileWriterTests.java b/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/context/WebServerPortFileWriterTests.java index 55230b39c51..323625e1a68 100644 --- a/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/context/WebServerPortFileWriterTests.java +++ b/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/context/WebServerPortFileWriterTests.java @@ -44,7 +44,6 @@ import static org.mockito.Mockito.mock; class WebServerPortFileWriterTests { @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; @BeforeEach diff --git a/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/DocumentRootTests.java b/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/DocumentRootTests.java index 86a61ec515c..d9f364fe72b 100644 --- a/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/DocumentRootTests.java +++ b/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/DocumentRootTests.java @@ -35,7 +35,6 @@ import static org.assertj.core.api.Assertions.assertThat; class DocumentRootTests { @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; private final DocumentRoot documentRoot = new DocumentRoot(LogFactory.getLog(getClass())); diff --git a/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/StaticResourceJarsTests.java b/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/StaticResourceJarsTests.java index 350c005a5f0..f9d287fae51 100644 --- a/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/StaticResourceJarsTests.java +++ b/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/StaticResourceJarsTests.java @@ -47,7 +47,6 @@ import static org.assertj.core.api.Assertions.assertThatNoException; class StaticResourceJarsTests { @TempDir - @SuppressWarnings("NullAway.Init") File tempDir; @Test diff --git a/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/MockWebEnvironmentServletComponentScanIntegrationTests.java b/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/MockWebEnvironmentServletComponentScanIntegrationTests.java index 1e3e464a870..4d561482a76 100644 --- a/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/MockWebEnvironmentServletComponentScanIntegrationTests.java +++ b/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/MockWebEnvironmentServletComponentScanIntegrationTests.java @@ -60,7 +60,6 @@ class MockWebEnvironmentServletComponentScanIntegrationTests { private @Nullable AnnotationConfigServletWebApplicationContext context; @TempDir - @SuppressWarnings("NullAway.Init") File temp; @AfterEach diff --git a/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanIntegrationTests.java b/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanIntegrationTests.java index 7d39ed59ce9..9b8f20d758c 100644 --- a/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanIntegrationTests.java +++ b/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/ServletComponentScanIntegrationTests.java @@ -58,7 +58,6 @@ class ServletComponentScanIntegrationTests { private @Nullable AnnotationConfigServletWebServerApplicationContext context; @TempDir - @SuppressWarnings("NullAway.Init") File temp; @AfterEach diff --git a/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextTests.java b/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextTests.java index 7ee65cf9936..b7861877423 100644 --- a/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextTests.java +++ b/module/spring-boot-web-server/src/test/java/org/springframework/boot/web/server/servlet/context/ServletWebServerApplicationContextTests.java @@ -102,7 +102,6 @@ class ServletWebServerApplicationContextTests { private final ServletWebServerApplicationContext context = new ServletWebServerApplicationContext(); @Captor - @SuppressWarnings("NullAway.Init") private ArgumentCaptor filterCaptor; @AfterEach diff --git a/module/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/actuate/web/WebFluxManagementChildContextConfigurationIntegrationTests.java b/module/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/actuate/web/WebFluxManagementChildContextConfigurationIntegrationTests.java index 9e69217c444..3afc96cb7e7 100644 --- a/module/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/actuate/web/WebFluxManagementChildContextConfigurationIntegrationTests.java +++ b/module/spring-boot-webflux/src/test/java/org/springframework/boot/webflux/autoconfigure/actuate/web/WebFluxManagementChildContextConfigurationIntegrationTests.java @@ -84,7 +84,6 @@ class WebFluxManagementChildContextConfigurationIntegrationTests { .withPropertyValues("server.port=0", "management.server.port=0", "management.endpoints.web.exposure.include=*"); @TempDir - @SuppressWarnings("NullAway.Init") Path temp; @Test diff --git a/module/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/actuate/web/WebMvcEndpointChildContextConfigurationIntegrationTests.java b/module/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/actuate/web/WebMvcEndpointChildContextConfigurationIntegrationTests.java index 9b4deb8ea19..e1f2879b7e6 100644 --- a/module/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/actuate/web/WebMvcEndpointChildContextConfigurationIntegrationTests.java +++ b/module/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/actuate/web/WebMvcEndpointChildContextConfigurationIntegrationTests.java @@ -83,7 +83,6 @@ class WebMvcEndpointChildContextConfigurationIntegrationTests { "spring.web.error.include-binding-errors=always"); @TempDir - @SuppressWarnings("NullAway.Init") Path temp; @Test // gh-17938 diff --git a/module/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/error/DefaultErrorViewResolverTests.java b/module/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/error/DefaultErrorViewResolverTests.java index a272d250be4..330764ecfe4 100644 --- a/module/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/error/DefaultErrorViewResolverTests.java +++ b/module/spring-boot-webmvc/src/test/java/org/springframework/boot/webmvc/autoconfigure/error/DefaultErrorViewResolverTests.java @@ -62,7 +62,6 @@ class DefaultErrorViewResolverTests { private DefaultErrorViewResolver resolver; @Mock - @SuppressWarnings("NullAway.Init") private TemplateAvailabilityProvider templateAvailabilityProvider; private Resources resourcesProperties; diff --git a/module/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilderTests.java b/module/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilderTests.java index 049bff9d3d3..1ec7f342037 100644 --- a/module/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilderTests.java +++ b/module/spring-boot-webservices/src/test/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilderTests.java @@ -62,11 +62,9 @@ class WebServiceTemplateBuilderTests { private final WebServiceTemplateBuilder builder = new WebServiceTemplateBuilder(); @Mock - @SuppressWarnings("NullAway.Init") private WebServiceMessageSender messageSender; @Mock - @SuppressWarnings("NullAway.Init") private ClientInterceptor interceptor; @Test diff --git a/smoke-test/spring-boot-smoke-test-aspectj/src/main/java/smoketest/aspectj/service/HelloWorldService.java b/smoke-test/spring-boot-smoke-test-aspectj/src/main/java/smoketest/aspectj/service/HelloWorldService.java index 760ccbb252b..b3a22e255d9 100644 --- a/smoke-test/spring-boot-smoke-test-aspectj/src/main/java/smoketest/aspectj/service/HelloWorldService.java +++ b/smoke-test/spring-boot-smoke-test-aspectj/src/main/java/smoketest/aspectj/service/HelloWorldService.java @@ -23,7 +23,6 @@ import org.springframework.stereotype.Component; public class HelloWorldService { @Value("${test.name:World}") - @SuppressWarnings("NullAway.Init") private String name; public String getHelloMessage() { diff --git a/smoke-test/spring-boot-smoke-test-data-rest/src/main/java/smoketest/data/rest/domain/City.java b/smoke-test/spring-boot-smoke-test-data-rest/src/main/java/smoketest/data/rest/domain/City.java index fad6e7e3ab5..da4abb9aada 100644 --- a/smoke-test/spring-boot-smoke-test-data-rest/src/main/java/smoketest/data/rest/domain/City.java +++ b/smoke-test/spring-boot-smoke-test-data-rest/src/main/java/smoketest/data/rest/domain/City.java @@ -36,19 +36,15 @@ public class City implements Serializable { private @Nullable Long id; @Column(nullable = false) - @SuppressWarnings("NullAway.Init") private String name; @Column(nullable = false) - @SuppressWarnings("NullAway.Init") private String state; @Column(nullable = false) - @SuppressWarnings("NullAway.Init") private String country; @Column(nullable = false) - @SuppressWarnings("NullAway.Init") private String map; protected City() { diff --git a/smoke-test/spring-boot-smoke-test-data-rest/src/main/java/smoketest/data/rest/domain/Hotel.java b/smoke-test/spring-boot-smoke-test-data-rest/src/main/java/smoketest/data/rest/domain/Hotel.java index c48cf38ccf0..1f329ce0910 100644 --- a/smoke-test/spring-boot-smoke-test-data-rest/src/main/java/smoketest/data/rest/domain/Hotel.java +++ b/smoke-test/spring-boot-smoke-test-data-rest/src/main/java/smoketest/data/rest/domain/Hotel.java @@ -39,20 +39,16 @@ public class Hotel implements Serializable { @ManyToOne(optional = false) @NaturalId - @SuppressWarnings("NullAway.Init") private City city; @Column(nullable = false) @NaturalId - @SuppressWarnings("NullAway.Init") private String name; @Column(nullable = false) - @SuppressWarnings("NullAway.Init") private String address; @Column(nullable = false) - @SuppressWarnings("NullAway.Init") private String zip; protected Hotel() { diff --git a/smoke-test/spring-boot-smoke-test-flyway/src/main/java/smoketest/flyway/Person.java b/smoke-test/spring-boot-smoke-test-flyway/src/main/java/smoketest/flyway/Person.java index 6cea911fc1d..0cabcc85e0e 100644 --- a/smoke-test/spring-boot-smoke-test-flyway/src/main/java/smoketest/flyway/Person.java +++ b/smoke-test/spring-boot-smoke-test-flyway/src/main/java/smoketest/flyway/Person.java @@ -32,11 +32,9 @@ public class Person { private @Nullable Long id; @Column(nullable = false) - @SuppressWarnings("NullAway.Init") private String firstName; @Column(nullable = false) - @SuppressWarnings("NullAway.Init") private String lastName; public String getFirstName() { diff --git a/smoke-test/spring-boot-smoke-test-jersey/src/main/java/smoketest/jersey/Service.java b/smoke-test/spring-boot-smoke-test-jersey/src/main/java/smoketest/jersey/Service.java index 52255bb08b3..33f23c9c268 100644 --- a/smoke-test/spring-boot-smoke-test-jersey/src/main/java/smoketest/jersey/Service.java +++ b/smoke-test/spring-boot-smoke-test-jersey/src/main/java/smoketest/jersey/Service.java @@ -23,7 +23,6 @@ import org.springframework.stereotype.Component; public class Service { @Value("${message:World}") - @SuppressWarnings("NullAway.Init") private String msg; public String message() { diff --git a/smoke-test/spring-boot-smoke-test-jetty/src/main/java/smoketest/jetty/service/HelloWorldService.java b/smoke-test/spring-boot-smoke-test-jetty/src/main/java/smoketest/jetty/service/HelloWorldService.java index dd6300cc00e..8054dee6c24 100644 --- a/smoke-test/spring-boot-smoke-test-jetty/src/main/java/smoketest/jetty/service/HelloWorldService.java +++ b/smoke-test/spring-boot-smoke-test-jetty/src/main/java/smoketest/jetty/service/HelloWorldService.java @@ -23,7 +23,6 @@ import org.springframework.stereotype.Component; public class HelloWorldService { @Value("${test.name:World}") - @SuppressWarnings("NullAway.Init") private String name; public String getHelloMessage() { diff --git a/smoke-test/spring-boot-smoke-test-profile/src/main/java/smoketest/profile/service/GenericService.java b/smoke-test/spring-boot-smoke-test-profile/src/main/java/smoketest/profile/service/GenericService.java index 183c53e48b4..693b98f4884 100644 --- a/smoke-test/spring-boot-smoke-test-profile/src/main/java/smoketest/profile/service/GenericService.java +++ b/smoke-test/spring-boot-smoke-test-profile/src/main/java/smoketest/profile/service/GenericService.java @@ -25,11 +25,9 @@ import org.springframework.stereotype.Component; public class GenericService implements MessageService { @Value("${test.hello:Hello}") - @SuppressWarnings("NullAway.Init") private String hello; @Value("${test.name:World}") - @SuppressWarnings("NullAway.Init") private String name; @Override diff --git a/smoke-test/spring-boot-smoke-test-profile/src/main/java/smoketest/profile/service/GoodbyeWorldService.java b/smoke-test/spring-boot-smoke-test-profile/src/main/java/smoketest/profile/service/GoodbyeWorldService.java index 3e090cc19e2..60870c15cde 100644 --- a/smoke-test/spring-boot-smoke-test-profile/src/main/java/smoketest/profile/service/GoodbyeWorldService.java +++ b/smoke-test/spring-boot-smoke-test-profile/src/main/java/smoketest/profile/service/GoodbyeWorldService.java @@ -25,7 +25,6 @@ import org.springframework.stereotype.Component; public class GoodbyeWorldService implements MessageService { @Value("${test.name:World}") - @SuppressWarnings("NullAway.Init") private String name; @Override diff --git a/smoke-test/spring-boot-smoke-test-profile/src/main/java/smoketest/profile/service/HelloWorldService.java b/smoke-test/spring-boot-smoke-test-profile/src/main/java/smoketest/profile/service/HelloWorldService.java index 6d68331dfeb..36547631e09 100644 --- a/smoke-test/spring-boot-smoke-test-profile/src/main/java/smoketest/profile/service/HelloWorldService.java +++ b/smoke-test/spring-boot-smoke-test-profile/src/main/java/smoketest/profile/service/HelloWorldService.java @@ -25,7 +25,6 @@ import org.springframework.stereotype.Component; public class HelloWorldService implements MessageService { @Value("${test.name:World}") - @SuppressWarnings("NullAway.Init") private String name; @Override diff --git a/smoke-test/spring-boot-smoke-test-secure-jersey/src/main/java/smoketest/secure/jersey/Service.java b/smoke-test/spring-boot-smoke-test-secure-jersey/src/main/java/smoketest/secure/jersey/Service.java index be447809a8b..63e68a901f2 100644 --- a/smoke-test/spring-boot-smoke-test-secure-jersey/src/main/java/smoketest/secure/jersey/Service.java +++ b/smoke-test/spring-boot-smoke-test-secure-jersey/src/main/java/smoketest/secure/jersey/Service.java @@ -23,7 +23,6 @@ import org.springframework.stereotype.Component; public class Service { @Value("${message:World}") - @SuppressWarnings("NullAway.Init") private String msg; public String message() { diff --git a/smoke-test/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/service/HelloWorldService.java b/smoke-test/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/service/HelloWorldService.java index e932328e2a5..a3fbae181e3 100644 --- a/smoke-test/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/service/HelloWorldService.java +++ b/smoke-test/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/service/HelloWorldService.java @@ -25,11 +25,9 @@ import org.springframework.stereotype.Component; public class HelloWorldService { @Value("${test.name:World}") - @SuppressWarnings("NullAway.Init") private String name; @Value("${test.duration:10s}") - @SuppressWarnings("NullAway.Init") private Duration duration; public String getHelloMessage() { diff --git a/smoke-test/spring-boot-smoke-test-test/src/main/java/smoketest/test/domain/User.java b/smoke-test/spring-boot-smoke-test-test/src/main/java/smoketest/test/domain/User.java index 2dc158101c6..a433f8c3042 100644 --- a/smoke-test/spring-boot-smoke-test-test/src/main/java/smoketest/test/domain/User.java +++ b/smoke-test/spring-boot-smoke-test-test/src/main/java/smoketest/test/domain/User.java @@ -39,10 +39,8 @@ public class User { private @Nullable Long id; @Column(unique = true) - @SuppressWarnings("NullAway.Init") private String username; - @SuppressWarnings("NullAway.Init") private VehicleIdentificationNumber vin; protected User() { diff --git a/smoke-test/spring-boot-smoke-test-test/src/test/java/smoketest/test/web/UserVehicleServiceTests.java b/smoke-test/spring-boot-smoke-test-test/src/test/java/smoketest/test/web/UserVehicleServiceTests.java index f5a9503dda0..3adb325059b 100644 --- a/smoke-test/spring-boot-smoke-test-test/src/test/java/smoketest/test/web/UserVehicleServiceTests.java +++ b/smoke-test/spring-boot-smoke-test-test/src/test/java/smoketest/test/web/UserVehicleServiceTests.java @@ -44,11 +44,9 @@ class UserVehicleServiceTests { private static final VehicleIdentificationNumber VIN = new VehicleIdentificationNumber("00000000000000000"); @Mock - @SuppressWarnings("NullAway.Init") private VehicleDetailsService vehicleDetailsService; @Mock - @SuppressWarnings("NullAway.Init") private UserRepository userRepository; private UserVehicleService service; diff --git a/smoke-test/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/service/HelloWorldService.java b/smoke-test/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/service/HelloWorldService.java index fceb44e3dd4..8953350d713 100644 --- a/smoke-test/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/service/HelloWorldService.java +++ b/smoke-test/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/service/HelloWorldService.java @@ -23,7 +23,6 @@ import org.springframework.stereotype.Component; public class HelloWorldService { @Value("${test.name:World}") - @SuppressWarnings("NullAway.Init") private String name; public String getHelloMessage() { diff --git a/smoke-test/spring-boot-smoke-test-tomcat/src/main/java/smoketest/tomcat/service/HelloWorldService.java b/smoke-test/spring-boot-smoke-test-tomcat/src/main/java/smoketest/tomcat/service/HelloWorldService.java index f342cae43c4..dc197088b94 100644 --- a/smoke-test/spring-boot-smoke-test-tomcat/src/main/java/smoketest/tomcat/service/HelloWorldService.java +++ b/smoke-test/spring-boot-smoke-test-tomcat/src/main/java/smoketest/tomcat/service/HelloWorldService.java @@ -23,7 +23,6 @@ import org.springframework.stereotype.Component; public class HelloWorldService { @Value("${test.name:World}") - @SuppressWarnings("NullAway.Init") private String name; public String getHelloMessage() { diff --git a/smoke-test/spring-boot-smoke-test-websocket-jetty/src/test/java/smoketest/websocket/jetty/SampleWebSocketsApplicationTests.java b/smoke-test/spring-boot-smoke-test-websocket-jetty/src/test/java/smoketest/websocket/jetty/SampleWebSocketsApplicationTests.java index b608f9189ac..163d9e1208f 100644 --- a/smoke-test/spring-boot-smoke-test-websocket-jetty/src/test/java/smoketest/websocket/jetty/SampleWebSocketsApplicationTests.java +++ b/smoke-test/spring-boot-smoke-test-websocket-jetty/src/test/java/smoketest/websocket/jetty/SampleWebSocketsApplicationTests.java @@ -80,7 +80,6 @@ class SampleWebSocketsApplicationTests { static class ClientConfiguration implements CommandLineRunner { @Value("${websocket.uri}") - @SuppressWarnings("NullAway.Init") private String webSocketUri; private final CountDownLatch latch = new CountDownLatch(1); diff --git a/smoke-test/spring-boot-smoke-test-websocket-jetty/src/test/java/smoketest/websocket/jetty/echo/CustomContainerWebSocketsApplicationTests.java b/smoke-test/spring-boot-smoke-test-websocket-jetty/src/test/java/smoketest/websocket/jetty/echo/CustomContainerWebSocketsApplicationTests.java index e61060b827b..374375a98f5 100644 --- a/smoke-test/spring-boot-smoke-test-websocket-jetty/src/test/java/smoketest/websocket/jetty/echo/CustomContainerWebSocketsApplicationTests.java +++ b/smoke-test/spring-boot-smoke-test-websocket-jetty/src/test/java/smoketest/websocket/jetty/echo/CustomContainerWebSocketsApplicationTests.java @@ -95,7 +95,6 @@ class CustomContainerWebSocketsApplicationTests { static class ClientConfiguration implements CommandLineRunner { @Value("${websocket.uri}") - @SuppressWarnings("NullAway.Init") private String webSocketUri; private final CountDownLatch latch = new CountDownLatch(1); diff --git a/smoke-test/spring-boot-smoke-test-websocket-tomcat/src/test/java/smoketest/websocket/tomcat/SampleWebSocketsApplicationTests.java b/smoke-test/spring-boot-smoke-test-websocket-tomcat/src/test/java/smoketest/websocket/tomcat/SampleWebSocketsApplicationTests.java index e28af6bffb6..b7bdbcab54c 100644 --- a/smoke-test/spring-boot-smoke-test-websocket-tomcat/src/test/java/smoketest/websocket/tomcat/SampleWebSocketsApplicationTests.java +++ b/smoke-test/spring-boot-smoke-test-websocket-tomcat/src/test/java/smoketest/websocket/tomcat/SampleWebSocketsApplicationTests.java @@ -80,7 +80,6 @@ class SampleWebSocketsApplicationTests { static class ClientConfiguration implements CommandLineRunner { @Value("${websocket.uri}") - @SuppressWarnings("NullAway.Init") private String webSocketUri; private final CountDownLatch latch = new CountDownLatch(1); diff --git a/smoke-test/spring-boot-smoke-test-websocket-tomcat/src/test/java/smoketest/websocket/tomcat/echo/CustomContainerWebSocketsApplicationTests.java b/smoke-test/spring-boot-smoke-test-websocket-tomcat/src/test/java/smoketest/websocket/tomcat/echo/CustomContainerWebSocketsApplicationTests.java index c2f64d3df79..4ef36466a17 100644 --- a/smoke-test/spring-boot-smoke-test-websocket-tomcat/src/test/java/smoketest/websocket/tomcat/echo/CustomContainerWebSocketsApplicationTests.java +++ b/smoke-test/spring-boot-smoke-test-websocket-tomcat/src/test/java/smoketest/websocket/tomcat/echo/CustomContainerWebSocketsApplicationTests.java @@ -95,7 +95,6 @@ class CustomContainerWebSocketsApplicationTests { static class ClientConfiguration implements CommandLineRunner { @Value("${websocket.uri}") - @SuppressWarnings("NullAway.Init") private String webSocketUri; private final CountDownLatch latch = new CountDownLatch(1); diff --git a/smoke-test/spring-boot-smoke-test-xml/src/main/java/smoketest/xml/service/HelloWorldService.java b/smoke-test/spring-boot-smoke-test-xml/src/main/java/smoketest/xml/service/HelloWorldService.java index 3634e6e8400..45a47cc7600 100644 --- a/smoke-test/spring-boot-smoke-test-xml/src/main/java/smoketest/xml/service/HelloWorldService.java +++ b/smoke-test/spring-boot-smoke-test-xml/src/main/java/smoketest/xml/service/HelloWorldService.java @@ -23,7 +23,6 @@ import org.springframework.stereotype.Component; public class HelloWorldService { @Value("${test.name:World}") - @SuppressWarnings("NullAway.Init") private String name; public String getHelloMessage() {