Add missing @Nullable annotations on parameters
Issue: SPR-15540
This commit is contained in:
@@ -25,6 +25,7 @@ import org.hibernate.SessionFactory;
|
||||
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.dao.DataAccessResourceFailureException;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.orm.hibernate5.SessionFactoryUtils;
|
||||
import org.springframework.orm.hibernate5.SessionHolder;
|
||||
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
||||
@@ -130,7 +131,7 @@ public class OpenSessionInViewInterceptor implements AsyncWebRequestInterceptor
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postHandle(WebRequest request, ModelMap model) {
|
||||
public void postHandle(WebRequest request, @Nullable ModelMap model) {
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -138,7 +139,7 @@ public class OpenSessionInViewInterceptor implements AsyncWebRequestInterceptor
|
||||
* @see TransactionSynchronizationManager
|
||||
*/
|
||||
@Override
|
||||
public void afterCompletion(WebRequest request, Exception ex) throws DataAccessException {
|
||||
public void afterCompletion(WebRequest request, @Nullable Exception ex) throws DataAccessException {
|
||||
if (!decrementParticipateCount(request)) {
|
||||
SessionHolder sessionHolder =
|
||||
(SessionHolder) TransactionSynchronizationManager.unbindResource(getSessionFactory());
|
||||
|
||||
@@ -300,7 +300,7 @@ public abstract class AbstractEntityManagerFactoryBean implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
public void setBeanClassLoader(@Nullable ClassLoader classLoader) {
|
||||
this.beanClassLoader = classLoader;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import javax.persistence.PersistenceException;
|
||||
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.jdbc.datasource.ConnectionHandle;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.transaction.InvalidIsolationLevelException;
|
||||
import org.springframework.transaction.TransactionDefinition;
|
||||
import org.springframework.transaction.TransactionException;
|
||||
@@ -81,7 +82,7 @@ public class DefaultJpaDialect implements JpaDialect, Serializable {
|
||||
* @see #beginTransaction
|
||||
*/
|
||||
@Override
|
||||
public void cleanupTransaction(Object transactionData) {
|
||||
public void cleanupTransaction(@Nullable Object transactionData) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,6 +21,7 @@ import javax.persistence.PersistenceException;
|
||||
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.dao.DataAccessResourceFailureException;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.orm.jpa.EntityManagerFactoryAccessor;
|
||||
import org.springframework.orm.jpa.EntityManagerFactoryUtils;
|
||||
import org.springframework.orm.jpa.EntityManagerHolder;
|
||||
@@ -99,11 +100,11 @@ public class OpenEntityManagerInViewInterceptor extends EntityManagerFactoryAcce
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postHandle(WebRequest request, ModelMap model) {
|
||||
public void postHandle(WebRequest request, @Nullable ModelMap model) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCompletion(WebRequest request, Exception ex) throws DataAccessException {
|
||||
public void afterCompletion(WebRequest request, @Nullable Exception ex) throws DataAccessException {
|
||||
if (!decrementParticipateCount(request)) {
|
||||
EntityManagerHolder emHolder = (EntityManagerHolder)
|
||||
TransactionSynchronizationManager.unbindResource(getEntityManagerFactory());
|
||||
|
||||
@@ -200,7 +200,7 @@ public class HibernateJpaDialect extends DefaultJpaDialect {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanupTransaction(Object transactionData) {
|
||||
public void cleanupTransaction(@Nullable Object transactionData) {
|
||||
((SessionTransactionData) transactionData).resetSessionState();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user