Add missing @Nullable annotations on parameters
Issue: SPR-15540
This commit is contained in:
@@ -19,6 +19,7 @@ package org.springframework.transaction.interceptor;
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -53,7 +54,8 @@ public class CompositeTransactionAttributeSource implements TransactionAttribute
|
||||
|
||||
|
||||
@Override
|
||||
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
|
||||
@Nullable
|
||||
public TransactionAttribute getTransactionAttribute(Method method, @Nullable Class<?> targetClass) {
|
||||
for (TransactionAttributeSource tas : this.transactionAttributeSources) {
|
||||
TransactionAttribute ta = tas.getTransactionAttribute(method, targetClass);
|
||||
if (ta != null) {
|
||||
|
||||
@@ -19,6 +19,7 @@ package org.springframework.transaction.interceptor;
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
@@ -52,7 +53,7 @@ public class MatchAlwaysTransactionAttributeSource implements TransactionAttribu
|
||||
|
||||
|
||||
@Override
|
||||
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
|
||||
public TransactionAttribute getTransactionAttribute(Method method, @Nullable Class<?> targetClass) {
|
||||
return (method == null || ClassUtils.isUserLevelMethod(method) ? this.transactionAttribute : null);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.beans.factory.BeanClassLoaderAware;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
@@ -82,7 +83,7 @@ public class MethodMapTransactionAttributeSource
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader beanClassLoader) {
|
||||
public void setBeanClassLoader(@Nullable ClassLoader beanClassLoader) {
|
||||
this.beanClassLoader = beanClassLoader;
|
||||
}
|
||||
|
||||
@@ -207,7 +208,7 @@ public class MethodMapTransactionAttributeSource
|
||||
|
||||
|
||||
@Override
|
||||
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
|
||||
public TransactionAttribute getTransactionAttribute(Method method, @Nullable Class<?> targetClass) {
|
||||
if (this.eagerlyInitialized) {
|
||||
return this.transactionAttributeMap.get(method);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.util.Properties;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.PatternMatchUtils;
|
||||
@@ -100,7 +101,7 @@ public class NameMatchTransactionAttributeSource implements TransactionAttribute
|
||||
|
||||
|
||||
@Override
|
||||
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
|
||||
public TransactionAttribute getTransactionAttribute(Method method, @Nullable Class<?> targetClass) {
|
||||
if (!ClassUtils.isUserLevelMethod(method)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.springframework.util.ObjectUtils;
|
||||
abstract class TransactionAttributeSourcePointcut extends StaticMethodMatcherPointcut implements Serializable {
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class<?> targetClass) {
|
||||
public boolean matches(Method method, @Nullable Class<?> targetClass) {
|
||||
if (TransactionalProxy.class.isAssignableFrom(targetClass)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1200,7 +1200,7 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public Transaction createTransaction(String name, int timeout) throws NotSupportedException, SystemException {
|
||||
public Transaction createTransaction(@Nullable String name, int timeout) throws NotSupportedException, SystemException {
|
||||
TransactionManager tm = getTransactionManager();
|
||||
Assert.state(tm != null, "No JTA TransactionManager available");
|
||||
if (timeout >= 0) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import javax.transaction.SystemException;
|
||||
import javax.transaction.Transaction;
|
||||
import javax.transaction.TransactionManager;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -51,7 +52,7 @@ public class SimpleTransactionFactory implements TransactionFactory {
|
||||
|
||||
|
||||
@Override
|
||||
public Transaction createTransaction(String name, int timeout) throws NotSupportedException, SystemException {
|
||||
public Transaction createTransaction(@Nullable String name, int timeout) throws NotSupportedException, SystemException {
|
||||
if (timeout >= 0) {
|
||||
this.transactionManager.setTransactionTimeout(timeout);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import javax.transaction.Transaction;
|
||||
import javax.transaction.TransactionManager;
|
||||
import javax.transaction.UserTransaction;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.transaction.TransactionDefinition;
|
||||
import org.springframework.transaction.TransactionSystemException;
|
||||
|
||||
@@ -301,7 +302,7 @@ public class WebLogicJtaTransactionManager extends JtaTransactionManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Transaction createTransaction(String name, int timeout) throws NotSupportedException, SystemException {
|
||||
public Transaction createTransaction(@Nullable String name, int timeout) throws NotSupportedException, SystemException {
|
||||
if (this.weblogicUserTransactionAvailable && name != null) {
|
||||
try {
|
||||
if (timeout >= 0) {
|
||||
|
||||
@@ -334,7 +334,7 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
|
||||
* @see #doBegin
|
||||
*/
|
||||
@Override
|
||||
public final TransactionStatus getTransaction(TransactionDefinition definition) throws TransactionException {
|
||||
public final TransactionStatus getTransaction(@Nullable TransactionDefinition definition) throws TransactionException {
|
||||
Object transaction = doGetTransaction();
|
||||
|
||||
// Cache debug flag to avoid repeated checks.
|
||||
|
||||
Reference in New Issue
Block a user