Allow null method for getTransactionAttribute
Update MatchAlwaysTransactionAttributeSource.getTransactionAttribute to allow a null method argument. Passing a null method is not recommended and is not indicated as valid in the Javadoc, however, this was allowed in previous versions of Spring. Issue: SPR-11048
This commit is contained in:
@@ -778,8 +778,12 @@ public abstract class ClassUtils {
|
||||
* @return {@code true} if the method can be considered as user-declared; [@code false} otherwise
|
||||
*/
|
||||
public static boolean isUserLevelMethod(Method method) {
|
||||
return (method.isBridge() ||
|
||||
(!method.isSynthetic() && !method.getDeclaringClass().getName().equals("groovy.lang.GroovyObject")));
|
||||
Assert.notNull(method, "Method must not be null");
|
||||
return (method.isBridge() || (!method.isSynthetic() && !isGroovyObjectMethod(method)));
|
||||
}
|
||||
|
||||
private static boolean isGroovyObjectMethod(Method method) {
|
||||
return method.getDeclaringClass().getName().equals("groovy.lang.GroovyObject");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user