mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-28 21:19:02 +00:00
Improve null-safety of module/spring-boot-hibernate
See gh-46926
This commit is contained in:
+3
-4
@@ -19,6 +19,7 @@ package org.springframework.boot.hibernate;
|
||||
import jakarta.transaction.TransactionManager;
|
||||
import jakarta.transaction.UserTransaction;
|
||||
import org.hibernate.engine.transaction.jta.platform.internal.AbstractJtaPlatform;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.transaction.jta.JtaTransactionManager;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -44,14 +45,12 @@ public class SpringJtaPlatform extends AbstractJtaPlatform {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("NullAway") // TODO: Not sure about returning nullness here
|
||||
protected TransactionManager locateTransactionManager() {
|
||||
protected @Nullable TransactionManager locateTransactionManager() {
|
||||
return this.transactionManager.getTransactionManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("NullAway") // TODO: Not sure about returning nullness here
|
||||
protected UserTransaction locateUserTransaction() {
|
||||
protected @Nullable UserTransaction locateUserTransaction() {
|
||||
return this.transactionManager.getUserTransaction();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user