Browse Source

Upgrade to Nullability Plugin 0.0.9

Closes gh-48638
pull/48817/head
Andy Wilkinson 2 months ago
parent
commit
0ffffee4bf
  1. 1
      build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/GettingStartedDocumentationTests.java
  2. 1
      build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java
  3. 1
      build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/ManagingDependenciesDocumentationTests.java
  4. 1
      build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java
  5. 1
      build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PublishingDocumentationTests.java
  6. 1
      build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.java
  7. 20
      build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/package-info.java
  8. 2
      build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleBuildFieldSetter.java
  9. 5
      build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleProjectBuilder.java
  10. 20
      build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/package-info.java
  11. 20
      build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/package-info.java
  12. 2
      build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveIntegrationTests.java
  13. 4
      build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests.java
  14. 2
      build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/run/BootTestRunIntegrationTests.java
  15. 20
      build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/package-info.java
  16. 0
      build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/bootjar/classpath/BootJarClasspathApplication.java
  17. 0
      build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/bootjar/main/CustomMainClass.java
  18. 0
      build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/bootrun/classpath/BootRunClasspathApplication.java
  19. 0
      build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/bootrun/jvmargs/BootRunJvmArgsApplication.java
  20. 0
      build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/bootrun/main/CustomMainClass.java
  21. 0
      build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/boottestrun/classpath/BootTestRunClasspathApplication.java
  22. 0
      build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/boottestrun/jvmargs/BootTestRunJvmArgsApplication.java
  23. 0
      build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/boottestrun/nomain/BootTestRunNoMain.java
  24. 0
      build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/bootwar/main/CustomMainClass.java
  25. 23
      build-plugin/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/sample/package-info.java
  26. 1
      buildSrc/build.gradle
  27. 13
      buildSrc/src/main/java/org/springframework/boot/build/architecture/ArchitectureCheck.java
  28. 82
      buildSrc/src/main/java/org/springframework/boot/build/architecture/ArchitectureCheckExtension.java
  29. 26
      buildSrc/src/main/java/org/springframework/boot/build/architecture/ArchitecturePlugin.java
  30. 18
      buildSrc/src/main/java/org/springframework/boot/build/architecture/ArchitectureRules.java
  31. 74
      buildSrc/src/test/java/org/springframework/boot/build/architecture/ArchitectureCheckTests.java
  32. 7
      cli/spring-boot-cli/build.gradle
  33. 20
      cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/package-info.java
  34. 6
      configuration-metadata/spring-boot-configuration-metadata-changelog-generator/build.gradle
  35. 6
      configuration-metadata/spring-boot-configuration-metadata/build.gradle
  36. 6
      configuration-metadata/spring-boot-configuration-processor/build.gradle
  37. 6
      core/spring-boot-autoconfigure-processor/build.gradle
  38. 20
      core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/config/first/package-info.java
  39. 20
      core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/config/package-info.java
  40. 20
      core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/config/second/package-info.java
  41. 20
      core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/scan/package-info.java
  42. 20
      core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/context/filtersample/package-info.java
  43. 20
      core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/packagestest/one/package-info.java
  44. 20
      core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/packagestest/two/package-info.java
  45. 12
      core/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/json/test/autoconfigure/app/ExampleBasicObject.java
  46. 20
      core/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/json/test/autoconfigure/app/package-info.java
  47. 20
      core/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/override/package-info.java
  48. 6
      core/spring-boot-test/src/test/java/org/springframework/boot/test/context/bootstrap/SpringBootTestContextBootstrapperTests.java
  49. 20
      core/spring-boot-test/src/test/java/org/springframework/boot/test/context/bootstrap/package-info.java
  50. 20
      core/spring-boot-test/src/test/java/org/springframework/boot/test/context/example/duplicate/first/package-info.java
  51. 20
      core/spring-boot-test/src/test/java/org/springframework/boot/test/context/example/duplicate/second/package-info.java
  52. 20
      core/spring-boot-test/src/test/java/org/springframework/boot/test/context/example/package-info.java
  53. 20
      core/spring-boot-test/src/test/java/org/springframework/boot/test/context/example/scan/package-info.java
  54. 20
      core/spring-boot-test/src/test/java/org/springframework/boot/test/context/example/scan/sub/package-info.java
  55. 20
      core/spring-boot-test/src/test/java/org/springframework/boot/test/context/nestedtests/package-info.java
  56. 20
      core/spring-boot/src/test/java/org/springframework/boot/context/configwarnings/annotation/package-info.java
  57. 20
      core/spring-boot/src/test/java/org/springframework/boot/context/configwarnings/dflt/package-info.java
  58. 20
      core/spring-boot/src/test/java/org/springframework/boot/context/configwarnings/orgspring/package-info.java
  59. 20
      core/spring-boot/src/test/java/org/springframework/boot/context/configwarnings/real/nested/package-info.java
  60. 20
      core/spring-boot/src/test/java/org/springframework/boot/context/configwarnings/real/package-info.java
  61. 20
      core/spring-boot/src/test/java/org/springframework/boot/context/filtersample/package-info.java
  62. 20
      core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/test/package-info.java
  63. 20
      core/spring-boot/src/test/java/org/springframework/boot/context/properties/scan/combined/c/package-info.java
  64. 20
      core/spring-boot/src/test/java/org/springframework/boot/context/properties/scan/combined/d/package-info.java
  65. 20
      core/spring-boot/src/test/java/org/springframework/boot/context/properties/scan/valid/a/package-info.java
  66. 20
      core/spring-boot/src/test/java/org/springframework/boot/context/properties/scan/valid/b/package-info.java
  67. 20
      core/spring-boot/src/test/java/org/springframework/boot/context/properties/scan/valid/package-info.java
  68. 20
      core/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/nounique/package-info.java
  69. 3
      core/spring-boot/src/test/java/org/springframework/boot/sampleconfig/package-info.java
  70. 20
      core/spring-boot/src/test/java/sampleconfig/package-info.java
  71. 6
      documentation/spring-boot-docs/build.gradle
  72. 2
      gradle.properties
  73. 23
      loader/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/sample/package-info.java
  74. 6
      loader/spring-boot-loader/build.gradle
  75. 5
      module/spring-boot-batch-jdbc/src/test/java/org/springframework/boot/batch/jdbc/autoconfigure/domain/City.java
  76. 20
      module/spring-boot-batch-jdbc/src/test/java/org/springframework/boot/batch/jdbc/autoconfigure/domain/package-info.java
  77. 2
      module/spring-boot-data-cassandra-test/src/dockerTest/java/org/springframework/boot/test/autoconfigure/data/cassandra/ExampleEntity.java
  78. 20
      module/spring-boot-data-cassandra-test/src/dockerTest/java/org/springframework/boot/test/autoconfigure/data/cassandra/package-info.java
  79. 22
      module/spring-boot-data-cassandra/src/test/java/org/springframework/boot/data/cassandra/domain/city/City.java
  80. 20
      module/spring-boot-data-cassandra/src/test/java/org/springframework/boot/data/cassandra/domain/city/package-info.java
  81. 20
      module/spring-boot-data-cassandra/src/test/java/org/springframework/boot/data/cassandra/domain/empty/package-info.java
  82. 4
      module/spring-boot-data-commons/src/test/java/org/springframework/boot/data/domain/city/City.java
  83. 20
      module/spring-boot-data-commons/src/test/java/org/springframework/boot/data/domain/city/package-info.java
  84. 6
      module/spring-boot-data-couchbase/src/test/java/org/springframework/boot/data/couchbase/domain/city/City.java
  85. 20
      module/spring-boot-data-couchbase/src/test/java/org/springframework/boot/data/couchbase/domain/city/package-info.java
  86. 20
      module/spring-boot-data-couchbase/src/test/java/org/springframework/boot/data/couchbase/domain/empty/package-info.java
  87. 20
      module/spring-boot-data-elasticsearch/src/dockerTest/java/org/springframework/boot/data/elasticsearch/domain/empty/package-info.java
  88. 5
      module/spring-boot-data-elasticsearch/src/test/java/org/springframework/boot/data/elasticsearch/domain/city/City.java
  89. 20
      module/spring-boot-data-elasticsearch/src/test/java/org/springframework/boot/data/elasticsearch/domain/city/package-info.java
  90. 5
      module/spring-boot-data-jdbc/src/test/java/org/springframework/boot/data/jdbc/domain/city/City.java
  91. 20
      module/spring-boot-data-jdbc/src/test/java/org/springframework/boot/data/jdbc/domain/city/package-info.java
  92. 20
      module/spring-boot-data-jdbc/src/test/java/org/springframework/boot/data/jdbc/domain/empty/package-info.java
  93. 5
      module/spring-boot-data-jpa/src/test/java/org/springframework/boot/data/jpa/autoconfigure/domain/city/City.java
  94. 20
      module/spring-boot-data-jpa/src/test/java/org/springframework/boot/data/jpa/autoconfigure/domain/city/package-info.java
  95. 2
      module/spring-boot-data-jpa/src/test/java/org/springframework/boot/data/jpa/autoconfigure/domain/country/Country.java
  96. 20
      module/spring-boot-data-jpa/src/test/java/org/springframework/boot/data/jpa/autoconfigure/domain/country/package-info.java
  97. 20
      module/spring-boot-data-ldap/src/test/java/org/springframework/boot/data/ldap/autoconfigure/domain/empty/package-info.java
  98. 6
      module/spring-boot-data-ldap/src/test/java/org/springframework/boot/data/ldap/autoconfigure/domain/person/Person.java
  99. 20
      module/spring-boot-data-ldap/src/test/java/org/springframework/boot/data/ldap/autoconfigure/domain/person/package-info.java
  100. 20
      module/spring-boot-data-mongodb/src/test/java/org/springframework/boot/data/mongodb/alt/package-info.java
  101. Some files were not shown because too many files have changed in this diff Show More

1
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/GettingStartedDocumentationTests.java

@ -31,6 +31,7 @@ import org.springframework.boot.testsupport.gradle.testkit.GradleBuild; @@ -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

1
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/IntegratingWithActuatorDocumentationTests.java

@ -38,6 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -38,6 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@ExtendWith(GradleMultiDslExtension.class)
class IntegratingWithActuatorDocumentationTests {
@SuppressWarnings("NullAway.Init")
GradleBuild gradleBuild;
@TestTemplate

1
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/ManagingDependenciesDocumentationTests.java

@ -35,6 +35,7 @@ import static org.junit.jupiter.api.Assumptions.assumingThat; @@ -35,6 +35,7 @@ import static org.junit.jupiter.api.Assumptions.assumingThat;
@ExtendWith(GradleMultiDslExtension.class)
class ManagingDependenciesDocumentationTests {
@SuppressWarnings("NullAway.Init")
GradleBuild gradleBuild;
@TestTemplate

1
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PackagingDocumentationTests.java

@ -45,6 +45,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -45,6 +45,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@ExtendWith(GradleMultiDslExtension.class)
class PackagingDocumentationTests {
@SuppressWarnings("NullAway.Init")
GradleBuild gradleBuild;
@TestTemplate

1
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/PublishingDocumentationTests.java

@ -33,6 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -33,6 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@ExtendWith(GradleMultiDslExtension.class)
class PublishingDocumentationTests {
@SuppressWarnings("NullAway.Init")
GradleBuild gradleBuild;
@TestTemplate

1
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/RunningDocumentationTests.java

@ -38,6 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -38,6 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@ExtendWith(GradleMultiDslExtension.class)
class RunningDocumentationTests {
@SuppressWarnings("NullAway.Init")
GradleBuild gradleBuild;
@TestTemplate

20
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/docs/package-info.java

@ -0,0 +1,20 @@ @@ -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;

2
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleBuildFieldSetter.java

@ -22,6 +22,7 @@ import org.junit.jupiter.api.extension.BeforeEachCallback; @@ -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 { @@ -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);

5
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleProjectBuilder.java

@ -20,6 +20,7 @@ import java.io.File; @@ -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; @@ -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() {
}

20
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/package-info.java

@ -0,0 +1,20 @@ @@ -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;

2
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/AbstractBootArchiveIntegrationTests.java

@ -661,7 +661,7 @@ abstract class AbstractBootArchiveIntegrationTests { @@ -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);
}

4
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/run/BootRunIntegrationTests.java

@ -160,7 +160,7 @@ class BootRunIntegrationTests { @@ -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 { @@ -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 {

2
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/run/BootTestRunIntegrationTests.java

@ -162,7 +162,7 @@ class BootTestRunIntegrationTests { @@ -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 {

20
build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/package-info.java

@ -0,0 +1,20 @@ @@ -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
build-plugin/spring-boot-gradle-plugin/src/test/java/com/example/bootjar/classpath/BootJarClasspathApplication.java → build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/bootjar/classpath/BootJarClasspathApplication.java

0
build-plugin/spring-boot-gradle-plugin/src/test/java/com/example/bootjar/main/CustomMainClass.java → build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/bootjar/main/CustomMainClass.java

0
build-plugin/spring-boot-gradle-plugin/src/test/java/com/example/bootrun/classpath/BootRunClasspathApplication.java → build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/bootrun/classpath/BootRunClasspathApplication.java

0
build-plugin/spring-boot-gradle-plugin/src/test/java/com/example/bootrun/jvmargs/BootRunJvmArgsApplication.java → build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/bootrun/jvmargs/BootRunJvmArgsApplication.java

0
build-plugin/spring-boot-gradle-plugin/src/test/java/com/example/bootrun/main/CustomMainClass.java → build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/bootrun/main/CustomMainClass.java

0
build-plugin/spring-boot-gradle-plugin/src/test/java/com/example/boottestrun/classpath/BootTestRunClasspathApplication.java → build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/boottestrun/classpath/BootTestRunClasspathApplication.java

0
build-plugin/spring-boot-gradle-plugin/src/test/java/com/example/boottestrun/jvmargs/BootTestRunJvmArgsApplication.java → build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/boottestrun/jvmargs/BootTestRunJvmArgsApplication.java

0
build-plugin/spring-boot-gradle-plugin/src/test/java/com/example/boottestrun/nomain/BootTestRunNoMain.java → build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/boottestrun/nomain/BootTestRunNoMain.java

0
build-plugin/spring-boot-gradle-plugin/src/test/java/com/example/bootwar/main/CustomMainClass.java → build-plugin/spring-boot-gradle-plugin/src/test/resources/com/example/bootwar/main/CustomMainClass.java

23
build-plugin/spring-boot-maven-plugin/src/test/java/org/springframework/boot/maven/sample/package-info.java

@ -0,0 +1,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 the Maven plugin for Spring Boot.
*/
@NullMarked
package org.springframework.boot.maven.sample;
import org.jspecify.annotations.NullMarked;

1
buildSrc/build.gradle

@ -26,6 +26,7 @@ repositories { @@ -26,6 +26,7 @@ repositories {
mavenCentral()
spring.mavenRepositoriesFor("${springFrameworkVersion}")
gradlePluginPortal()
maven { url = "https://repo.spring.io/snapshot" }
}
java {

13
buildSrc/src/main/java/org/springframework/boot/build/architecture/ArchitectureCheck.java

@ -45,7 +45,6 @@ import org.gradle.api.provider.ListProperty; @@ -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 { @@ -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 { @@ -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();

82
buildSrc/src/main/java/org/springframework/boot/build/architecture/ArchitectureCheckExtension.java

@ -1,82 +0,0 @@ @@ -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();
}
}

26
buildSrc/src/main/java/org/springframework/boot/build/architecture/ArchitecturePlugin.java

@ -16,8 +16,6 @@ @@ -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> { @@ -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())))));
}
}

18
buildSrc/src/main/java/org/springframework/boot/build/architecture/ArchitectureRules.java

@ -284,12 +284,6 @@ final class ArchitectureRules { @@ -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 { @@ -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() {

74
buildSrc/src/test/java/org/springframework/boot/build/architecture/ArchitectureCheckTests.java

@ -49,7 +49,6 @@ import org.springframework.boot.build.architecture.annotations.TestConfiguration @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 {

7
cli/spring-boot-cli/build.gradle

@ -61,11 +61,8 @@ dependencies { @@ -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) {

20
cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/package-info.java

@ -0,0 +1,20 @@ @@ -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;

6
configuration-metadata/spring-boot-configuration-metadata-changelog-generator/build.gradle

@ -38,10 +38,8 @@ dependencies { @@ -38,10 +38,8 @@ dependencies {
testImplementation("org.junit.jupiter:junit-jupiter")
}
architectureCheck {
nullMarked {
enabled = false
}
nullability {
requireExplicitNullMarking = false
}
def dependenciesOf(String version) {

6
configuration-metadata/spring-boot-configuration-metadata/build.gradle

@ -35,8 +35,6 @@ dependencies { @@ -35,8 +35,6 @@ dependencies {
testImplementation("org.springframework:spring-core")
}
architectureCheck {
nullMarked {
enabled = false
}
nullability {
requireExplicitNullMarking = false
}

6
configuration-metadata/spring-boot-configuration-processor/build.gradle

@ -30,10 +30,8 @@ sourceSets { @@ -30,10 +30,8 @@ sourceSets {
}
}
architectureCheck {
nullMarked {
enabled = false
}
nullability {
requireExplicitNullMarking = false
}
dependencies {

6
core/spring-boot-autoconfigure-processor/build.gradle

@ -27,8 +27,6 @@ dependencies { @@ -27,8 +27,6 @@ dependencies {
testImplementation(project(":test-support:spring-boot-test-support"))
}
architectureCheck {
nullMarked {
enabled = false
}
nullability {
requireExplicitNullMarking = false
}

20
core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/config/first/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/config/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/config/second/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/scan/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/context/filtersample/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/packagestest/one/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/packagestest/two/package-info.java

@ -0,0 +1,20 @@ @@ -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;

12
core/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/json/test/autoconfigure/app/ExampleBasicObject.java

@ -16,6 +16,10 @@ @@ -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; @@ -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 { @@ -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);
}
}

20
core/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/json/test/autoconfigure/app/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/override/package-info.java

@ -0,0 +1,20 @@ @@ -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;

6
core/spring-boot-test/src/test/java/org/springframework/boot/test/context/bootstrap/SpringBootTestContextBootstrapperTests.java

@ -27,6 +27,7 @@ import org.springframework.test.context.MergedContextConfiguration; @@ -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 { @@ -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)

20
core/spring-boot-test/src/test/java/org/springframework/boot/test/context/bootstrap/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot-test/src/test/java/org/springframework/boot/test/context/example/duplicate/first/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot-test/src/test/java/org/springframework/boot/test/context/example/duplicate/second/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot-test/src/test/java/org/springframework/boot/test/context/example/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot-test/src/test/java/org/springframework/boot/test/context/example/scan/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot-test/src/test/java/org/springframework/boot/test/context/example/scan/sub/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot-test/src/test/java/org/springframework/boot/test/context/nestedtests/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot/src/test/java/org/springframework/boot/context/configwarnings/annotation/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot/src/test/java/org/springframework/boot/context/configwarnings/dflt/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot/src/test/java/org/springframework/boot/context/configwarnings/orgspring/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot/src/test/java/org/springframework/boot/context/configwarnings/real/nested/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot/src/test/java/org/springframework/boot/context/configwarnings/real/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot/src/test/java/org/springframework/boot/context/filtersample/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/test/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot/src/test/java/org/springframework/boot/context/properties/scan/combined/c/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot/src/test/java/org/springframework/boot/context/properties/scan/combined/d/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot/src/test/java/org/springframework/boot/context/properties/scan/valid/a/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot/src/test/java/org/springframework/boot/context/properties/scan/valid/b/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot/src/test/java/org/springframework/boot/context/properties/scan/valid/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
core/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/nounique/package-info.java

@ -0,0 +1,20 @@ @@ -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;

3
core/spring-boot/src/test/java/org/springframework/boot/sampleconfig/package-info.java

@ -17,4 +17,7 @@ @@ -17,4 +17,7 @@
/**
* Sample config for tests
*/
@NullMarked
package org.springframework.boot.sampleconfig;
import org.jspecify.annotations.NullMarked;

20
core/spring-boot/src/test/java/sampleconfig/package-info.java

@ -0,0 +1,20 @@ @@ -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;

6
documentation/spring-boot-docs/build.gradle

@ -70,10 +70,8 @@ tasks.named('compileKotlin', KotlinCompilationTask.class) { @@ -70,10 +70,8 @@ tasks.named('compileKotlin', KotlinCompilationTask.class) {
javaSources.from = []
}
architectureCheck {
nullMarked {
enabled = false
}
nullability {
requireExplicitNullMarking = false
}
plugins.withType(EclipsePlugin) {

2
gradle.properties

@ -19,7 +19,7 @@ kotlinVersion=2.2.21 @@ -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

23
loader/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/sample/package-info.java

@ -0,0 +1,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;

6
loader/spring-boot-loader/build.gradle

@ -37,8 +37,6 @@ tasks.configureEach { @@ -37,8 +37,6 @@ tasks.configureEach {
}
}
architectureCheck {
nullMarked {
enabled = false
}
nullability {
requireExplicitNullMarking = false
}

5
module/spring-boot-batch-jdbc/src/test/java/org/springframework/boot/batch/jdbc/autoconfigure/domain/City.java

@ -30,18 +30,23 @@ public class City implements Serializable { @@ -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() {

20
module/spring-boot-batch-jdbc/src/test/java/org/springframework/boot/batch/jdbc/autoconfigure/domain/package-info.java

@ -0,0 +1,20 @@ @@ -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;

2
module/spring-boot-data-cassandra-test/src/dockerTest/java/org/springframework/boot/test/autoconfigure/data/cassandra/ExampleEntity.java

@ -29,8 +29,10 @@ import org.springframework.data.cassandra.core.mapping.Table; @@ -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() {

20
module/spring-boot-data-cassandra-test/src/dockerTest/java/org/springframework/boot/test/autoconfigure/data/cassandra/package-info.java

@ -0,0 +1,20 @@ @@ -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;

22
module/spring-boot-data-cassandra/src/test/java/org/springframework/boot/data/cassandra/domain/city/City.java

@ -16,6 +16,8 @@ @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -73,7 +75,7 @@ public class City {
this.country = country;
}
public String getMap() {
public @Nullable String getMap() {
return this.map;
}

20
module/spring-boot-data-cassandra/src/test/java/org/springframework/boot/data/cassandra/domain/city/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
module/spring-boot-data-cassandra/src/test/java/org/springframework/boot/data/cassandra/domain/empty/package-info.java

@ -0,0 +1,20 @@ @@ -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;

4
module/spring-boot-data-commons/src/test/java/org/springframework/boot/data/domain/city/City.java

@ -16,12 +16,14 @@ @@ -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;

20
module/spring-boot-data-commons/src/test/java/org/springframework/boot/data/domain/city/package-info.java

@ -0,0 +1,20 @@ @@ -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;

6
module/spring-boot-data-couchbase/src/test/java/org/springframework/boot/data/couchbase/domain/city/City.java

@ -16,6 +16,8 @@ @@ -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; @@ -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;
}

20
module/spring-boot-data-couchbase/src/test/java/org/springframework/boot/data/couchbase/domain/city/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
module/spring-boot-data-couchbase/src/test/java/org/springframework/boot/data/couchbase/domain/empty/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
module/spring-boot-data-elasticsearch/src/dockerTest/java/org/springframework/boot/data/elasticsearch/domain/empty/package-info.java

@ -0,0 +1,20 @@ @@ -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;

5
module/spring-boot-data-elasticsearch/src/test/java/org/springframework/boot/data/elasticsearch/domain/city/City.java

@ -29,14 +29,19 @@ public class City implements Serializable { @@ -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() {

20
module/spring-boot-data-elasticsearch/src/test/java/org/springframework/boot/data/elasticsearch/domain/city/package-info.java

@ -0,0 +1,20 @@ @@ -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;

5
module/spring-boot-data-jdbc/src/test/java/org/springframework/boot/data/jdbc/domain/city/City.java

@ -23,14 +23,19 @@ import org.springframework.data.relational.core.mapping.Table; @@ -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() {

20
module/spring-boot-data-jdbc/src/test/java/org/springframework/boot/data/jdbc/domain/city/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
module/spring-boot-data-jdbc/src/test/java/org/springframework/boot/data/jdbc/domain/empty/package-info.java

@ -0,0 +1,20 @@ @@ -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;

5
module/spring-boot-data-jpa/src/test/java/org/springframework/boot/data/jpa/autoconfigure/domain/city/City.java

@ -30,18 +30,23 @@ public class City implements Serializable { @@ -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() {

20
module/spring-boot-data-jpa/src/test/java/org/springframework/boot/data/jpa/autoconfigure/domain/city/package-info.java

@ -0,0 +1,20 @@ @@ -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;

2
module/spring-boot-data-jpa/src/test/java/org/springframework/boot/data/jpa/autoconfigure/domain/country/Country.java

@ -31,10 +31,12 @@ public class Country implements Serializable { @@ -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() {

20
module/spring-boot-data-jpa/src/test/java/org/springframework/boot/data/jpa/autoconfigure/domain/country/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
module/spring-boot-data-ldap/src/test/java/org/springframework/boot/data/ldap/autoconfigure/domain/empty/package-info.java

@ -0,0 +1,20 @@ @@ -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;

6
module/spring-boot-data-ldap/src/test/java/org/springframework/boot/data/ldap/autoconfigure/domain/person/Person.java

@ -18,6 +18,8 @@ package org.springframework.boot.data.ldap.autoconfigure.domain.person; @@ -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; @@ -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;
}

20
module/spring-boot-data-ldap/src/test/java/org/springframework/boot/data/ldap/autoconfigure/domain/person/package-info.java

@ -0,0 +1,20 @@ @@ -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;

20
module/spring-boot-data-mongodb/src/test/java/org/springframework/boot/data/mongodb/alt/package-info.java

@ -0,0 +1,20 @@ @@ -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

Loading…
Cancel
Save