Skip to content

Commit 011d42c

Browse files
committed
Improve null-safety of module/spring-boot-hibernate
See gh-46926
1 parent f272fb6 commit 011d42c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

module/spring-boot-hibernate/src/main/java/org/springframework/boot/hibernate/SpringJtaPlatform.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import jakarta.transaction.TransactionManager;
2020
import jakarta.transaction.UserTransaction;
2121
import org.hibernate.engine.transaction.jta.platform.internal.AbstractJtaPlatform;
22+
import org.jspecify.annotations.Nullable;
2223

2324
import org.springframework.transaction.jta.JtaTransactionManager;
2425
import org.springframework.util.Assert;
@@ -44,14 +45,12 @@ public SpringJtaPlatform(JtaTransactionManager transactionManager) {
4445
}
4546

4647
@Override
47-
@SuppressWarnings("NullAway") // TODO: Not sure about returning nullness here
48-
protected TransactionManager locateTransactionManager() {
48+
protected @Nullable TransactionManager locateTransactionManager() {
4949
return this.transactionManager.getTransactionManager();
5050
}
5151

5252
@Override
53-
@SuppressWarnings("NullAway") // TODO: Not sure about returning nullness here
54-
protected UserTransaction locateUserTransaction() {
53+
protected @Nullable UserTransaction locateUserTransaction() {
5554
return this.transactionManager.getUserTransaction();
5655
}
5756

0 commit comments

Comments
 (0)