From 61c081586afd52fa8c504ee48a3c601ff55957be Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Tue, 12 Aug 2025 11:19:45 +0200 Subject: [PATCH] Add nullability annotations to smoke-test/spring-boot-smoke-test-simple See gh-46587 --- .../simple/SampleConfigurationProperties.java | 1 + .../java/smoketest/simple/package-info.java | 20 +++++++++++++++++++ .../simple/service/HelloWorldService.java | 2 ++ .../simple/service/package-info.java | 20 +++++++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 smoke-test/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/package-info.java create mode 100644 smoke-test/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/service/package-info.java diff --git a/smoke-test/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/SampleConfigurationProperties.java b/smoke-test/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/SampleConfigurationProperties.java index 85ca0c63b69..5046e62101b 100644 --- a/smoke-test/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/SampleConfigurationProperties.java +++ b/smoke-test/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/SampleConfigurationProperties.java @@ -26,6 +26,7 @@ import org.springframework.validation.annotation.Validated; public final class SampleConfigurationProperties { @NotNull + @SuppressWarnings("NullAway.Init") private String name; public String getName() { diff --git a/smoke-test/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/package-info.java b/smoke-test/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/package-info.java new file mode 100644 index 00000000000..6e2660217f0 --- /dev/null +++ b/smoke-test/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2012-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@NullMarked +package smoketest.simple; + +import org.jspecify.annotations.NullMarked; 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 a3fbae181e3..e932328e2a5 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,9 +25,11 @@ 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-simple/src/main/java/smoketest/simple/service/package-info.java b/smoke-test/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/service/package-info.java new file mode 100644 index 00000000000..eff5be1086b --- /dev/null +++ b/smoke-test/spring-boot-smoke-test-simple/src/main/java/smoketest/simple/service/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2012-present the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@NullMarked +package smoketest.simple.service; + +import org.jspecify.annotations.NullMarked;