|
|
|
@ -173,7 +173,7 @@ public abstract class ReflectionTestUtils { |
|
|
|
* @see ReflectionUtils#setField(Field, Object, Object) |
|
|
|
* @see ReflectionUtils#setField(Field, Object, Object) |
|
|
|
* @see AopTestUtils#getUltimateTargetObject(Object) |
|
|
|
* @see AopTestUtils#getUltimateTargetObject(Object) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@SuppressWarnings("NullAway") |
|
|
|
@SuppressWarnings("NullAway") // Dataflow analysis limitation
|
|
|
|
public static void setField(@Nullable Object targetObject, @Nullable Class<?> targetClass, |
|
|
|
public static void setField(@Nullable Object targetObject, @Nullable Class<?> targetClass, |
|
|
|
@Nullable String name, @Nullable Object value, @Nullable Class<?> type) { |
|
|
|
@Nullable String name, @Nullable Object value, @Nullable Class<?> type) { |
|
|
|
|
|
|
|
|
|
|
|
@ -258,7 +258,7 @@ public abstract class ReflectionTestUtils { |
|
|
|
* @see ReflectionUtils#getField(Field, Object) |
|
|
|
* @see ReflectionUtils#getField(Field, Object) |
|
|
|
* @see AopTestUtils#getUltimateTargetObject(Object) |
|
|
|
* @see AopTestUtils#getUltimateTargetObject(Object) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@SuppressWarnings("NullAway") |
|
|
|
@SuppressWarnings("NullAway") // Dataflow analysis limitation
|
|
|
|
public static @Nullable Object getField(@Nullable Object targetObject, @Nullable Class<?> targetClass, String name) { |
|
|
|
public static @Nullable Object getField(@Nullable Object targetObject, @Nullable Class<?> targetClass, String name) { |
|
|
|
Assert.isTrue(targetObject != null || targetClass != null, |
|
|
|
Assert.isTrue(targetObject != null || targetClass != null, |
|
|
|
"Either targetObject or targetClass for the field must be specified"); |
|
|
|
"Either targetObject or targetClass for the field must be specified"); |
|
|
|
|