From 76c3be9ad6eb2b9c23cf4e98087181bc22b70953 Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Tue, 12 Aug 2025 10:28:25 +0200 Subject: [PATCH] Add nullability annotations to smoke-test/spring-boot-smoke-test-flyway See gh-46587 --- .../main/java/smoketest/flyway/Person.java | 15 +++++++------- .../java/smoketest/flyway/package-info.java | 20 +++++++++++++++++++ 2 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 smoke-test/spring-boot-smoke-test-flyway/src/main/java/smoketest/flyway/package-info.java 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 d16882d45d4..ec0a7a712eb 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 @@ -20,6 +20,7 @@ import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; import jakarta.persistence.SequenceGenerator; +import org.jspecify.annotations.Nullable; @Entity public class Person { @@ -27,25 +28,25 @@ public class Person { @Id @SequenceGenerator(name = "person_generator", sequenceName = "person_sequence", allocationSize = 1) @GeneratedValue(generator = "person_generator") - private Long id; + private @Nullable Long id; - private String firstName; + private @Nullable String firstName; - private String lastName; + private @Nullable String lastName; - public String getFirstName() { + public @Nullable String getFirstName() { return this.firstName; } - public void setFirstName(String firstName) { + public void setFirstName(@Nullable String firstName) { this.firstName = firstName; } - public String getLastName() { + public @Nullable String getLastName() { return this.lastName; } - public void setLastName(String lastname) { + public void setLastName(@Nullable String lastname) { this.lastName = lastname; } diff --git a/smoke-test/spring-boot-smoke-test-flyway/src/main/java/smoketest/flyway/package-info.java b/smoke-test/spring-boot-smoke-test-flyway/src/main/java/smoketest/flyway/package-info.java new file mode 100644 index 00000000000..98c9f73e66e --- /dev/null +++ b/smoke-test/spring-boot-smoke-test-flyway/src/main/java/smoketest/flyway/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.flyway; + +import org.jspecify.annotations.NullMarked;