Skip to content

Commit 4ece822

Browse files
committed
Add nullability annotations to module/spring-boot-data-jpa
See gh-46587
1 parent 5eedecd commit 4ece822

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

module/spring-boot-data-jpa/src/main/java/org/springframework/boot/data/jpa/autoconfigure/JpaRepositoriesAutoConfiguration.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
import javax.sql.DataSource;
2222

23+
import org.jspecify.annotations.Nullable;
24+
2325
import org.springframework.boot.autoconfigure.AutoConfiguration;
2426
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2527
import org.springframework.boot.autoconfigure.condition.AnyNestedCondition;
@@ -91,7 +93,7 @@ EntityManagerFactoryBuilderCustomizer entityManagerFactoryBootstrapExecutorCusto
9193
};
9294
}
9395

94-
private AsyncTaskExecutor determineBootstrapExecutor(Map<String, AsyncTaskExecutor> taskExecutors) {
96+
private @Nullable AsyncTaskExecutor determineBootstrapExecutor(Map<String, AsyncTaskExecutor> taskExecutors) {
9597
if (taskExecutors.size() == 1) {
9698
return taskExecutors.values().iterator().next();
9799
}

module/spring-boot-data-jpa/src/main/java/org/springframework/boot/data/jpa/autoconfigure/JpaRepositoriesRegistrar.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import java.lang.annotation.Annotation;
2020
import java.util.Locale;
2121

22+
import org.jspecify.annotations.Nullable;
23+
2224
import org.springframework.boot.autoconfigure.data.AbstractRepositoryConfigurationSourceSupport;
2325
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
2426
import org.springframework.core.env.Environment;
@@ -38,7 +40,7 @@
3840
*/
3941
class JpaRepositoriesRegistrar extends AbstractRepositoryConfigurationSourceSupport {
4042

41-
private BootstrapMode bootstrapMode = null;
43+
private @Nullable BootstrapMode bootstrapMode;
4244

4345
@Override
4446
protected Class<? extends Annotation> getAnnotation() {

module/spring-boot-data-jpa/src/main/java/org/springframework/boot/data/jpa/autoconfigure/package-info.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@
1717
/**
1818
* Auto-configuration for Spring Data JPA.
1919
*/
20+
@NullMarked
2021
package org.springframework.boot.data.jpa.autoconfigure;
22+
23+
import org.jspecify.annotations.NullMarked;

0 commit comments

Comments
 (0)