Refine null-safety in more modules

This commit refines the null-safety in:
 - spring-jdbc
 - spring-r2dbc
 - spring-orm
 - spring-beans
 - spring-aop

See gh-32475
This commit is contained in:
Sébastien Deleuze
2024-03-26 09:46:34 +01:00
parent dea31dd55e
commit 1b563f8ba4
40 changed files with 69 additions and 17 deletions

View File

@@ -136,7 +136,7 @@ public class MethodInvoker {
* Set arguments for the method invocation. If this property is not set,
* or the Object array is of length 0, a method with no arguments is assumed.
*/
public void setArguments(Object... arguments) {
public void setArguments(@Nullable Object... arguments) {
this.arguments = arguments;
}

View File

@@ -137,7 +137,7 @@ public abstract class ReflectionUtils {
* @param ex the exception to rethrow
* @throws RuntimeException the rethrown exception
*/
public static void rethrowRuntimeException(Throwable ex) {
public static void rethrowRuntimeException(@Nullable Throwable ex) {
if (ex instanceof RuntimeException runtimeException) {
throw runtimeException;
}
@@ -158,7 +158,7 @@ public abstract class ReflectionUtils {
* @param throwable the exception to rethrow
* @throws Exception the rethrown exception (in case of a checked exception)
*/
public static void rethrowException(Throwable throwable) throws Exception {
public static void rethrowException(@Nullable Throwable throwable) throws Exception {
if (throwable instanceof Exception exception) {
throw exception;
}