From 49c3a67cfb3d72e99361655fa23e25f4d712fe2c Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Tue, 12 Aug 2025 11:25:42 +0200 Subject: [PATCH] Add nullability annotations to smoke-test/spring-boot-smoke-test-testng See gh-46587 --- .../java/smoketest/testng/package-info.java | 20 +++++++++++++++++++ .../testng/service/HelloWorldService.java | 1 + .../testng/service/package-info.java | 20 +++++++++++++++++++ .../smoketest/testng/web/package-info.java | 20 +++++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 smoke-test/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/package-info.java create mode 100644 smoke-test/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/service/package-info.java create mode 100644 smoke-test/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/web/package-info.java diff --git a/smoke-test/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/package-info.java b/smoke-test/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/package-info.java new file mode 100644 index 00000000000..9247299e039 --- /dev/null +++ b/smoke-test/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/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.testng; + +import org.jspecify.annotations.NullMarked; 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 8953350d713..fceb44e3dd4 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,6 +23,7 @@ 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-testng/src/main/java/smoketest/testng/service/package-info.java b/smoke-test/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/service/package-info.java new file mode 100644 index 00000000000..c84718950a5 --- /dev/null +++ b/smoke-test/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/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.testng.service; + +import org.jspecify.annotations.NullMarked; diff --git a/smoke-test/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/web/package-info.java b/smoke-test/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/web/package-info.java new file mode 100644 index 00000000000..e6fbb9f96be --- /dev/null +++ b/smoke-test/spring-boot-smoke-test-testng/src/main/java/smoketest/testng/web/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.testng.web; + +import org.jspecify.annotations.NullMarked;