Explicit nullability declarations for all AOP Alliance methods

Includes consistent declarations in AOP Alliance related Spring AOP code.

Closes gh-24117
This commit is contained in:
Juergen Hoeller
2020-05-13 23:33:47 +02:00
parent 60fac67884
commit 3c1ee64b7f
42 changed files with 202 additions and 77 deletions

View File

@@ -134,6 +134,7 @@ public class PersistenceExceptionTranslationInterceptor
@Override
@Nullable
public Object invoke(MethodInvocation mi) throws Throwable {
try {
return mi.proceed();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -107,6 +107,7 @@ public class GenericMessageEndpointFactory extends AbstractMessageEndpointFactor
private class GenericMessageEndpoint extends AbstractMessageEndpoint implements MethodInterceptor {
@Override
@Nullable
public Object invoke(MethodInvocation methodInvocation) throws Throwable {
Throwable endpointEx = null;
boolean applyDeliveryCalls = !hasBeforeDeliveryBeenCalled();

View File

@@ -375,7 +375,7 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
cleanupTransactionInfo(txInfo);
}
if (vavrPresent && VavrDelegate.isVavrTry(retVal)) {
if (retVal != null && vavrPresent && VavrDelegate.isVavrTry(retVal)) {
// Set rollback-only in case of Vavr failure matching our rollback rules...
TransactionStatus status = txInfo.getTransactionStatus();
if (status != null && txAttr != null) {
@@ -396,7 +396,7 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
TransactionInfo txInfo = prepareTransactionInfo(ptm, txAttr, joinpointIdentification, status);
try {
Object retVal = invocation.proceedWithInvocation();
if (vavrPresent && VavrDelegate.isVavrTry(retVal)) {
if (retVal != null && vavrPresent && VavrDelegate.isVavrTry(retVal)) {
// Set rollback-only in case of Vavr failure matching our rollback rules...
retVal = VavrDelegate.evaluateTryFailure(retVal, txAttr, status);
}
@@ -780,6 +780,7 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
@FunctionalInterface
protected interface InvocationCallback {
@Nullable
Object proceedWithInvocation() throws Throwable;
}