Upgrade to Nullability Plugin 0.0.9

Closes gh-48638
This commit is contained in:
Andy Wilkinson
2026-01-08 11:59:51 +00:00
parent 9bd1a460a1
commit 0ffffee4bf
212 changed files with 2601 additions and 356 deletions
@@ -31,6 +31,7 @@ import org.springframework.boot.testsupport.gradle.testkit.GradleBuild;
@ExtendWith(GradleMultiDslExtension.class)
class GettingStartedDocumentationTests {
@SuppressWarnings("NullAway.Init")
GradleBuild gradleBuild;
// NOTE: We can't run any 'apply-plugin' tests because during a release the
@@ -38,6 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@ExtendWith(GradleMultiDslExtension.class)
class IntegratingWithActuatorDocumentationTests {
@SuppressWarnings("NullAway.Init")
GradleBuild gradleBuild;
@TestTemplate
@@ -35,6 +35,7 @@ import static org.junit.jupiter.api.Assumptions.assumingThat;
@ExtendWith(GradleMultiDslExtension.class)
class ManagingDependenciesDocumentationTests {
@SuppressWarnings("NullAway.Init")
GradleBuild gradleBuild;
@TestTemplate
@@ -45,6 +45,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@ExtendWith(GradleMultiDslExtension.class)
class PackagingDocumentationTests {
@SuppressWarnings("NullAway.Init")
GradleBuild gradleBuild;
@TestTemplate
@@ -33,6 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@ExtendWith(GradleMultiDslExtension.class)
class PublishingDocumentationTests {
@SuppressWarnings("NullAway.Init")
GradleBuild gradleBuild;
@TestTemplate
@@ -38,6 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@ExtendWith(GradleMultiDslExtension.class)
class RunningDocumentationTests {
@SuppressWarnings("NullAway.Init")
GradleBuild gradleBuild;
@TestTemplate
@@ -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 org.springframework.boot.gradle.docs;
import org.jspecify.annotations.NullMarked;
@@ -22,6 +22,7 @@ import org.junit.jupiter.api.extension.BeforeEachCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.springframework.boot.testsupport.gradle.testkit.GradleBuild;
import org.springframework.util.Assert;
import org.springframework.util.ReflectionUtils;
/**
@@ -41,6 +42,7 @@ final class GradleBuildFieldSetter implements BeforeEachCallback {
@Override
public void beforeEach(ExtensionContext context) throws Exception {
Field field = ReflectionUtils.findField(context.getRequiredTestClass(), "gradleBuild");
Assert.notNull(field, "Field named gradleBuild not found in " + context.getRequiredTestClass().getName());
field.setAccessible(true);
field.set(context.getRequiredTestInstance(), this.gradleBuild);
@@ -20,6 +20,7 @@ import java.io.File;
import org.gradle.api.Project;
import org.gradle.testfixtures.ProjectBuilder;
import org.jspecify.annotations.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
@@ -32,9 +33,9 @@ import org.springframework.util.StringUtils;
*/
public final class GradleProjectBuilder {
private File projectDir;
private @Nullable File projectDir;
private String name;
private @Nullable String name;
private GradleProjectBuilder() {
}
@@ -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 org.springframework.boot.gradle.junit;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.gradle;
import org.jspecify.annotations.NullMarked;
@@ -661,7 +661,7 @@ abstract class AbstractBootArchiveIntegrationTests {
"src/main/java/com/example/" + this.taskName.toLowerCase(Locale.ROOT) + "/" + name);
output.mkdirs();
FileSystemUtils.copyRecursively(
new File("src/test/java/com/example/" + this.taskName.toLowerCase(Locale.ENGLISH) + "/" + name),
new File("src/test/resources/com/example/" + this.taskName.toLowerCase(Locale.ENGLISH) + "/" + name),
output);
}
@@ -160,7 +160,7 @@ class BootRunIntegrationTests {
void classesFromASecondarySourceSetCanBeOnTheClasspath() throws IOException {
File output = new File(this.gradleBuild.getProjectDir(), "src/secondary/java/com/example/bootrun/main");
output.mkdirs();
FileSystemUtils.copyRecursively(new File("src/test/java/com/example/bootrun/main"), output);
FileSystemUtils.copyRecursively(new File("src/test/resources/com/example/bootrun/main"), output);
BuildResult result = this.gradleBuild.build("bootRun");
BuildTask task = result.task(":bootRun");
assertThat(task).isNotNull();
@@ -203,7 +203,7 @@ class BootRunIntegrationTests {
private void copyApplication(String name) throws IOException {
File output = new File(this.gradleBuild.getProjectDir(), "src/main/java/com/example/bootrun/" + name);
output.mkdirs();
FileSystemUtils.copyRecursively(new File("src/test/java/com/example/bootrun/" + name), output);
FileSystemUtils.copyRecursively(new File("src/test/resources/com/example/bootrun/" + name), output);
}
private String canonicalPathOf(String path) throws IOException {
@@ -162,7 +162,7 @@ class BootTestRunIntegrationTests {
private void copyApplication(String name) throws IOException {
File output = new File(this.gradleBuild.getProjectDir(), "src/test/java/com/example/boottestrun/" + name);
output.mkdirs();
FileSystemUtils.copyRecursively(new File("src/test/java/com/example/boottestrun/" + name), output);
FileSystemUtils.copyRecursively(new File("src/test/resources/com/example/boottestrun/" + name), output);
}
private String canonicalPathOf(String path) throws IOException {
@@ -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 org.springframework.boot.gradle.testkit;
import org.jspecify.annotations.NullMarked;
@@ -0,0 +1,23 @@
/*
* 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.
*/
/**
* Sample code for testing the Maven plugin for Spring Boot.
*/
@NullMarked
package org.springframework.boot.maven.sample;
import org.jspecify.annotations.NullMarked;
+1
View File
@@ -26,6 +26,7 @@ repositories {
mavenCentral()
spring.mavenRepositoriesFor("${springFrameworkVersion}")
gradlePluginPortal()
maven { url = "https://repo.spring.io/snapshot" }
}
java {
@@ -45,7 +45,6 @@ import org.gradle.api.provider.ListProperty;
import org.gradle.api.provider.MapProperty;
import org.gradle.api.provider.Property;
import org.gradle.api.provider.Provider;
import org.gradle.api.provider.SetProperty;
import org.gradle.api.tasks.Classpath;
import org.gradle.api.tasks.IgnoreEmptyDirectories;
import org.gradle.api.tasks.Input;
@@ -93,15 +92,9 @@ public abstract class ArchitectureCheck extends DefaultTask {
getRules().addAll(whenMainSources(
() -> ArchitectureRules.configurationPropertiesDeprecation(ArchitectureCheckAnnotation.classFor(
getAnnotationClasses().get(), ArchitectureCheckAnnotation.DEPRECATED_CONFIGURATION_PROPERTY))));
getRules().addAll(and(getNullMarkedEnabled(), isMainSourceSet()).map(whenTrue(() -> Collections.singletonList(
ArchitectureRules.packagesShouldBeAnnotatedWithNullMarked(getNullMarkedIgnoredPackages().get())))));
getRuleDescriptions().set(getRules().map(this::asDescriptions));
}
private Provider<Boolean> and(Provider<Boolean> provider1, Provider<Boolean> provider2) {
return provider1.zip(provider2, (result1, result2) -> result1 && result2);
}
private Provider<List<ArchRule>> whenMainSources(Supplier<List<ArchRule>> rules) {
return isMainSourceSet().map(whenTrue(rules));
}
@@ -211,12 +204,6 @@ public abstract class ArchitectureCheck extends DefaultTask {
@Input // Use descriptions as input since rules aren't serializable
abstract ListProperty<String> getRuleDescriptions();
@Internal
abstract Property<Boolean> getNullMarkedEnabled();
@Internal
abstract SetProperty<String> getNullMarkedIgnoredPackages();
@Internal
abstract MapProperty<String, String> getAnnotationClasses();
@@ -1,82 +0,0 @@
/*
* 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.
*/
package org.springframework.boot.build.architecture;
import java.util.LinkedHashSet;
import javax.inject.Inject;
import org.gradle.api.Action;
import org.gradle.api.model.ObjectFactory;
import org.gradle.api.provider.Property;
import org.gradle.api.provider.SetProperty;
/**
* Extension to configure the {@link ArchitecturePlugin}.
*
* @author Moritz Halbritter
*/
public abstract class ArchitectureCheckExtension {
private final NullMarkedExtension nullMarked;
@Inject
public ArchitectureCheckExtension(ObjectFactory objects) {
this.nullMarked = objects.newInstance(NullMarkedExtension.class);
}
/**
* Get the {@code NullMarked} extension.
* @return the {@code NullMarked} extension
*/
public NullMarkedExtension getNullMarked() {
return this.nullMarked;
}
/**
* Configure the {@code NullMarked} extension.
* @param action the action to configure the {@code NullMarked} extension with
*/
public void nullMarked(Action<? super NullMarkedExtension> action) {
action.execute(this.nullMarked);
}
/**
* Extension to configure the {@code NullMarked} extension.
*/
public abstract static class NullMarkedExtension {
public NullMarkedExtension() {
getEnabled().convention(true);
getIgnoredPackages().convention(new LinkedHashSet<>());
}
/**
* Whether this project uses JSpecify's {@code NullMarked} annotations.
* @return whether this project uses JSpecify's @NullMarked annotations
*/
public abstract Property<Boolean> getEnabled();
/**
* Packages that should be ignored by the {@code NullMarked} checker.
* @return the ignored packages
*/
public abstract SetProperty<String> getIgnoredPackages();
}
}
@@ -16,8 +16,6 @@
package org.springframework.boot.build.architecture;
import java.util.Collections;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.plugins.JavaPlugin;
@@ -39,30 +37,22 @@ public class ArchitecturePlugin implements Plugin<Project> {
@Override
public void apply(Project project) {
ArchitectureCheckExtension extension = project.getExtensions()
.create("architectureCheck", ArchitectureCheckExtension.class);
project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> registerTasks(project, extension));
project.getPlugins().withType(JavaPlugin.class, (javaPlugin) -> registerTasks(project));
}
private void registerTasks(Project project, ArchitectureCheckExtension extension) {
private void registerTasks(Project project) {
JavaPluginExtension javaPluginExtension = project.getExtensions().getByType(JavaPluginExtension.class);
for (SourceSet sourceSet : javaPluginExtension.getSourceSets()) {
registerArchitectureCheck(sourceSet, "java", project).configure((task) -> {
task.setClasses(project.files(project.getTasks()
registerArchitectureCheck(sourceSet, "java", project)
.configure((task) -> task.setClasses(project.files(project.getTasks()
.named(sourceSet.getCompileTaskName("java"), JavaCompile.class)
.flatMap((compile) -> compile.getDestinationDirectory())));
task.getNullMarkedEnabled().set(extension.getNullMarked().getEnabled());
task.getNullMarkedIgnoredPackages().set(extension.getNullMarked().getIgnoredPackages());
});
.flatMap((compile) -> compile.getDestinationDirectory()))));
project.getPlugins()
.withId("org.jetbrains.kotlin.jvm",
(kotlinPlugin) -> registerArchitectureCheck(sourceSet, "kotlin", project).configure((task) -> {
task.setClasses(project.files(project.getTasks()
(kotlinPlugin) -> registerArchitectureCheck(sourceSet, "kotlin", project)
.configure((task) -> task.setClasses(project.files(project.getTasks()
.named(sourceSet.getCompileTaskName("kotlin"), KotlinCompileTool.class)
.flatMap((compile) -> compile.getDestinationDirectory())));
task.getNullMarkedEnabled().set(false);
task.getNullMarkedIgnoredPackages().set(Collections.emptySet());
}));
.flatMap((compile) -> compile.getDestinationDirectory())))));
}
}
@@ -284,12 +284,6 @@ final class ArchitectureRules {
.allowEmptyShould(true);
}
static ArchRule packagesShouldBeAnnotatedWithNullMarked(Set<String> ignoredPackages) {
return ArchRuleDefinition.all(packages((javaPackage) -> !ignoredPackages.contains(javaPackage.getName())))
.should(beAnnotatedWithNullMarked())
.allowEmptyShould(true);
}
private static ArchCondition<? super JavaMethod> notSpecifyOnlyATypeThatIsTheSameAsTheMethodReturnType(
String annotation) {
return check("not specify only a type that is the same as the method's return type", (item, events) -> {
@@ -587,18 +581,6 @@ final class ArchitectureRules {
};
}
private static ArchCondition<JavaPackage> beAnnotatedWithNullMarked() {
return new ArchCondition<>("be annotated with @NullMarked") {
@Override
public void check(JavaPackage item, ConditionEvents events) {
if (!item.isAnnotatedWith("org.jspecify.annotations.NullMarked")) {
String message = String.format("Package %s is not annotated with @NullMarked", item.getName());
events.add(SimpleConditionEvent.violated(item, message));
}
}
};
}
private static class OverridesPublicMethod<T extends JavaMember> extends DescribedPredicate<T> {
OverridesPublicMethod() {
@@ -49,7 +49,6 @@ import org.springframework.boot.build.architecture.annotations.TestConfiguration
import org.springframework.boot.build.architecture.annotations.TestConfigurationPropertiesBinding;
import org.springframework.boot.build.architecture.annotations.TestDeprecatedConfigurationProperty;
import org.springframework.util.ClassUtils;
import org.springframework.util.CollectionUtils;
import org.springframework.util.FileSystemUtils;
import org.springframework.util.StringUtils;
@@ -75,7 +74,7 @@ class ArchitectureCheckTests {
@BeforeEach
void setup(@TempDir Path projectDir) {
this.gradleBuild = new GradleBuild(projectDir).withNullMarkedEnabled(false);
this.gradleBuild = new GradleBuild(projectDir);
}
@ParameterizedTest(name = "{0}")
@@ -380,28 +379,6 @@ class ArchitectureCheckTests {
build(this.gradleBuild.withDependencies(SPRING_CONTEXT), task);
}
@Test
void whenPackageIsNotAnnotatedWithNullMarkedWithMainSourcesShouldFailAndWriteEmptyReport() throws IOException {
prepareTask(Task.CHECK_ARCHITECTURE_MAIN, "nullmarked/notannotated");
buildAndFail(this.gradleBuild.withNullMarkedEnabled(true), Task.CHECK_ARCHITECTURE_MAIN,
"Package org.springframework.boot.build.architecture.nullmarked.notannotated is not annotated with @NullMarked");
}
@Test
void whenPackageIsIgnoredAndNotAnnotatedWithNullMarkedWithMainSourcesShouldSucceedAndWriteEmptyReport()
throws IOException {
prepareTask(Task.CHECK_ARCHITECTURE_MAIN, "nullmarked/notannotated");
build(this.gradleBuild.withNullMarkedEnabled(true)
.withNullMarkedIgnoredPackages("org.springframework.boot.build.architecture.nullmarked.notannotated"),
Task.CHECK_ARCHITECTURE_MAIN);
}
@Test
void whenPackageIsNotAnnotatedWithNullMarkedWithTestSourcesShouldSucceedAndWriteEmptyReport() throws IOException {
prepareTask(Task.CHECK_ARCHITECTURE_TEST, "nullmarked/notannotated");
build(this.gradleBuild.withNullMarkedEnabled(true), Task.CHECK_ARCHITECTURE_TEST);
}
@Test
void whenEnumSourceValueIsInferredShouldSucceedAndWriteEmptyReport() throws IOException {
prepareTask(Task.CHECK_ARCHITECTURE_TEST, "junit/enumsource/inferredfromparametertype");
@@ -533,8 +510,6 @@ class ArchitectureCheckTests {
private final Set<String> dependencies = new LinkedHashSet<>();
private NullMarkedExtension nullMarkedExtension;
private final Map<Task, TaskConfiguration> taskConfigurations = new LinkedHashMap<>();
private GradleBuild(Path projectDir) {
@@ -583,16 +558,6 @@ class ArchitectureCheckTests {
return this;
}
GradleBuild withNullMarkedEnabled(Boolean enabled) {
configureNullMarkedExtension((nullMarked) -> nullMarked.withEnabled(enabled));
return this;
}
GradleBuild withNullMarkedIgnoredPackages(String... ignorePackages) {
configureNullMarkedExtension((nullMarked) -> nullMarked.withIgnoredPackages(ignorePackages));
return this;
}
private void configureTasks(String annotationName, String annotationClass) {
for (Task task : Task.values()) {
configureTask(task, (configuration) -> configuration.withAnnotation(annotationName, annotationClass));
@@ -604,14 +569,6 @@ class ArchitectureCheckTests {
this.taskConfigurations.compute(task, (key, value) -> configurer.apply(value));
}
private void configureNullMarkedExtension(UnaryOperator<NullMarkedExtension> configurer) {
NullMarkedExtension nullMarkedExtension = this.nullMarkedExtension;
if (nullMarkedExtension == null) {
nullMarkedExtension = new NullMarkedExtension(null, null);
}
this.nullMarkedExtension = configurer.apply(nullMarkedExtension);
}
GradleBuild withDependencies(String... dependencies) {
this.dependencies.clear();
this.dependencies.addAll(Arrays.asList(dependencies));
@@ -658,23 +615,6 @@ class ArchitectureCheckTests {
}
buildFile.append("\n}\n");
});
NullMarkedExtension nullMarkedExtension = this.nullMarkedExtension;
if (nullMarkedExtension != null) {
buildFile.append("architectureCheck {");
buildFile.append("\n nullMarked {");
if (nullMarkedExtension.enabled() != null) {
buildFile.append("\n enabled = ").append(nullMarkedExtension.enabled());
}
if (!CollectionUtils.isEmpty(nullMarkedExtension.ignoredPackages())) {
buildFile.append("\n ignoredPackages = ")
.append(nullMarkedExtension.ignoredPackages()
.stream()
.map(StringUtils::quote)
.collect(Collectors.joining(",", "[", "]")));
}
buildFile.append("\n }");
buildFile.append("\n}\n\n");
}
Files.writeString(this.projectDir.resolve("build.gradle"), buildFile, StandardCharsets.UTF_8);
return GradleRunner.create()
.withProjectDir(this.projectDir.toFile())
@@ -689,18 +629,6 @@ class ArchitectureCheckTests {
.collect(Collectors.joining(", ", "[", "]"));
}
private record NullMarkedExtension(Boolean enabled, Set<String> ignoredPackages) {
private NullMarkedExtension withEnabled(Boolean enabled) {
return new NullMarkedExtension(enabled, this.ignoredPackages);
}
private NullMarkedExtension withIgnoredPackages(String... ignoredPackages) {
return new NullMarkedExtension(this.enabled, new LinkedHashSet<>(Arrays.asList(ignoredPackages)));
}
}
private record TaskConfiguration(Boolean prohibitObjectsRequireNonNull, Map<String, String> annotations) {
public TaskConfiguration {
+2 -5
View File
@@ -61,11 +61,8 @@ dependencies {
testImplementation(project(":test-support:spring-boot-test-support"))
}
architectureCheck {
nullMarked {
enabled = true
ignoredPackages = ['org.springframework.boot.cli.json']
}
nullability {
requireExplicitNullMarking = false
}
tasks.register("fullJar", Jar) {
@@ -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.
*/
@NullUnmarked
package org.springframework.boot.cli.json;
import org.jspecify.annotations.NullUnmarked;
@@ -38,10 +38,8 @@ dependencies {
testImplementation("org.junit.jupiter:junit-jupiter")
}
architectureCheck {
nullMarked {
enabled = false
}
nullability {
requireExplicitNullMarking = false
}
def dependenciesOf(String version) {
@@ -35,8 +35,6 @@ dependencies {
testImplementation("org.springframework:spring-core")
}
architectureCheck {
nullMarked {
enabled = false
}
nullability {
requireExplicitNullMarking = false
}
@@ -30,10 +30,8 @@ sourceSets {
}
}
architectureCheck {
nullMarked {
enabled = false
}
nullability {
requireExplicitNullMarking = false
}
dependencies {
@@ -27,8 +27,6 @@ dependencies {
testImplementation(project(":test-support:spring-boot-test-support"))
}
architectureCheck {
nullMarked {
enabled = false
}
nullability {
requireExplicitNullMarking = false
}
@@ -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 org.springframework.boot.autoconfigure.condition.config.first;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.autoconfigure.condition.config;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.autoconfigure.condition.config.second;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.autoconfigure.condition.scan;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.autoconfigure.context.filtersample;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.autoconfigure.packagestest.one;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.autoconfigure.packagestest.two;
import org.jspecify.annotations.NullMarked;
@@ -16,6 +16,10 @@
package org.springframework.boot.json.test.autoconfigure.app;
import java.util.Objects;
import org.jspecify.annotations.Nullable;
/**
* Example object to read/write as JSON.
*
@@ -23,9 +27,9 @@ package org.springframework.boot.json.test.autoconfigure.app;
*/
public class ExampleBasicObject {
private String value;
private @Nullable String value;
public String getValue() {
public @Nullable String getValue() {
return this.value;
}
@@ -36,14 +40,14 @@ public class ExampleBasicObject {
@Override
public boolean equals(Object obj) {
if (obj != null && obj.getClass() == getClass()) {
return this.value.equals(((ExampleBasicObject) obj).value);
return Objects.equals(this.value, ((ExampleBasicObject) obj).value);
}
return false;
}
@Override
public int hashCode() {
return this.value.hashCode();
return Objects.hashCode(this.value);
}
}
@@ -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 org.springframework.boot.json.test.autoconfigure.app;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.test.autoconfigure.override;
import org.jspecify.annotations.NullMarked;
@@ -27,6 +27,7 @@ import org.springframework.test.context.MergedContextConfiguration;
import org.springframework.test.context.TestContext;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.util.Assert;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
@@ -110,7 +111,10 @@ class SpringBootTestContextBootstrapperTests {
}
private MergedContextConfiguration getMergedContextConfiguration(TestContext context) {
return (MergedContextConfiguration) ReflectionTestUtils.getField(context, "mergedConfig");
MergedContextConfiguration mergedConfig = (MergedContextConfiguration) ReflectionTestUtils.getField(context,
"mergedConfig");
Assert.notNull(mergedConfig, context + " had no MergedContextConfiguration");
return mergedConfig;
}
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@@ -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 org.springframework.boot.test.context.bootstrap;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.test.context.example.duplicate.first;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.test.context.example.duplicate.second;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.test.context.example;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.test.context.example.scan;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.test.context.example.scan.sub;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.test.context.nestedtests;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.context.configwarnings.annotation;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.context.configwarnings.dflt;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.context.configwarnings.orgspring;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.context.configwarnings.real.nested;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.context.configwarnings.real;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.context.filtersample;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.context.properties.bind.test;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.context.properties.scan.combined.c;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.context.properties.scan.combined.d;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.context.properties.scan.valid.a;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.context.properties.scan.valid.b;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.context.properties.scan.valid;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.diagnostics.analyzer.nounique;
import org.jspecify.annotations.NullMarked;
@@ -17,4 +17,7 @@
/**
* Sample config for tests
*/
@NullMarked
package org.springframework.boot.sampleconfig;
import org.jspecify.annotations.NullMarked;
@@ -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 sampleconfig;
import org.jspecify.annotations.NullMarked;
+2 -4
View File
@@ -70,10 +70,8 @@ tasks.named('compileKotlin', KotlinCompilationTask.class) {
javaSources.from = []
}
architectureCheck {
nullMarked {
enabled = false
}
nullability {
requireExplicitNullMarking = false
}
plugins.withType(EclipsePlugin) {
+1 -1
View File
@@ -19,7 +19,7 @@ kotlinVersion=2.2.21
mavenVersion=3.9.10
mockitoVersion=5.20.0
nativeBuildToolsVersion=0.11.3
nullabilityPluginVersion=0.0.8
nullabilityPluginVersion=0.0.9
snakeYamlVersion=2.5
springFrameworkVersion=7.0.2
springFramework60xVersion=6.0.23
@@ -0,0 +1,23 @@
/*
* 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.
*/
/**
* Sample code for testing Spring Boot's loader tools.
*/
@NullMarked
package org.springframework.boot.loader.tools.sample;
import org.jspecify.annotations.NullMarked;
+2 -4
View File
@@ -37,8 +37,6 @@ tasks.configureEach {
}
}
architectureCheck {
nullMarked {
enabled = false
}
nullability {
requireExplicitNullMarking = false
}
@@ -30,18 +30,23 @@ public class City implements Serializable {
@Id
@GeneratedValue
@SuppressWarnings("NullAway.Init")
private 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() {
@@ -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 org.springframework.boot.batch.jdbc.autoconfigure.domain;
import org.jspecify.annotations.NullMarked;
@@ -29,8 +29,10 @@ import org.springframework.data.cassandra.core.mapping.Table;
public class ExampleEntity {
@PrimaryKey
@SuppressWarnings("NullAway.Init")
private String id;
@SuppressWarnings("NullAway.Init")
private String description;
public String getId() {
@@ -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 org.springframework.boot.test.autoconfigure.data.cassandra;
import org.jspecify.annotations.NullMarked;
@@ -16,6 +16,8 @@
package org.springframework.boot.data.cassandra.domain.city;
import org.jspecify.annotations.Nullable;
import org.springframework.data.cassandra.core.mapping.CassandraType;
import org.springframework.data.cassandra.core.mapping.CassandraType.Name;
import org.springframework.data.cassandra.core.mapping.Column;
@@ -27,21 +29,21 @@ public class City {
@PrimaryKey
@CassandraType(type = Name.BIGINT)
private Long id;
private @Nullable Long id;
@Column
private String name;
private @Nullable String name;
@Column
private String state;
private @Nullable String state;
@Column
private String country;
private @Nullable String country;
@Column
private String map;
private @Nullable String map;
public Long getId() {
public @Nullable Long getId() {
return this.id;
}
@@ -49,7 +51,7 @@ public class City {
this.id = id;
}
public String getName() {
public @Nullable String getName() {
return this.name;
}
@@ -57,7 +59,7 @@ public class City {
this.name = name;
}
public String getState() {
public @Nullable String getState() {
return this.state;
}
@@ -65,7 +67,7 @@ public class City {
this.state = state;
}
public String getCountry() {
public @Nullable String getCountry() {
return this.country;
}
@@ -73,7 +75,7 @@ public class City {
this.country = country;
}
public String getMap() {
public @Nullable String getMap() {
return this.map;
}
@@ -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 org.springframework.boot.data.cassandra.domain.city;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.data.cassandra.domain.empty;
import org.jspecify.annotations.NullMarked;
@@ -16,12 +16,14 @@
package org.springframework.boot.data.domain.city;
import org.jspecify.annotations.Nullable;
import org.springframework.data.annotation.Id;
public class City {
@Id
private Long id;
private @Nullable Long id;
private String name;
@@ -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 org.springframework.boot.data.domain.city;
import org.jspecify.annotations.NullMarked;
@@ -16,6 +16,8 @@
package org.springframework.boot.data.couchbase.domain.city;
import org.jspecify.annotations.Nullable;
import org.springframework.data.annotation.Id;
import org.springframework.data.couchbase.core.mapping.Document;
import org.springframework.data.couchbase.core.mapping.Field;
@@ -24,9 +26,9 @@ import org.springframework.data.couchbase.core.mapping.Field;
public class City {
@Id
private String id;
private @Nullable String id;
@Field
private String name;
private @Nullable String name;
}
@@ -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 org.springframework.boot.data.couchbase.domain.city;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.data.couchbase.domain.empty;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.data.elasticsearch.domain.empty;
import org.jspecify.annotations.NullMarked;
@@ -29,14 +29,19 @@ public class City implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@SuppressWarnings("NullAway.Init")
private Long id;
@SuppressWarnings("NullAway.Init")
private String name;
@SuppressWarnings("NullAway.Init")
private String state;
@SuppressWarnings("NullAway.Init")
private String country;
@SuppressWarnings("NullAway.Init")
private String map;
protected City() {
@@ -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 org.springframework.boot.data.elasticsearch.domain.city;
import org.jspecify.annotations.NullMarked;
@@ -23,14 +23,19 @@ import org.springframework.data.relational.core.mapping.Table;
public class City {
@Id
@SuppressWarnings("NullAway.Init")
private Long id;
@SuppressWarnings("NullAway.Init")
private String name;
@SuppressWarnings("NullAway.Init")
private String state;
@SuppressWarnings("NullAway.Init")
private String country;
@SuppressWarnings("NullAway.Init")
private String map;
protected City() {
@@ -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 org.springframework.boot.data.jdbc.domain.city;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.data.jdbc.domain.empty;
import org.jspecify.annotations.NullMarked;
@@ -30,18 +30,23 @@ public class City implements Serializable {
@Id
@GeneratedValue
@SuppressWarnings("NullAway.Init")
private 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() {
@@ -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 org.springframework.boot.data.jpa.autoconfigure.domain.city;
import org.jspecify.annotations.NullMarked;
@@ -31,10 +31,12 @@ public class Country implements Serializable {
@Id
@GeneratedValue
@SuppressWarnings("NullAway.Init")
private Long id;
@Audited
@Column
@SuppressWarnings("NullAway.Init")
private String name;
public Long getId() {
@@ -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 org.springframework.boot.data.jpa.autoconfigure.domain.country;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.data.ldap.autoconfigure.domain.empty;
import org.jspecify.annotations.NullMarked;
@@ -18,6 +18,8 @@ package org.springframework.boot.data.ldap.autoconfigure.domain.person;
import javax.naming.Name;
import org.jspecify.annotations.Nullable;
import org.springframework.ldap.odm.annotations.Attribute;
import org.springframework.ldap.odm.annotations.DnAttribute;
import org.springframework.ldap.odm.annotations.Entry;
@@ -27,10 +29,10 @@ import org.springframework.ldap.odm.annotations.Id;
public class Person {
@Id
private Name dn;
private @Nullable Name dn;
@Attribute(name = "cn")
@DnAttribute(value = "cn", index = 1)
private String fullName;
private @Nullable String fullName;
}
@@ -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 org.springframework.boot.data.ldap.autoconfigure.domain.person;
import org.jspecify.annotations.NullMarked;
@@ -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 org.springframework.boot.data.mongodb.alt;
import org.jspecify.annotations.NullMarked;

Some files were not shown because too many files have changed in this diff Show More