Skip to content

Commit 939aa84

Browse files
committed
Revise type-level nullability in ConvertingComparator
This commit revises the type-level nullability declaration in ConvertingComparator in order to adapt to recent nullability changes in Converter. This commit also revises the workaround in commit 53d9ba8. See gh-35947
1 parent 9f77f40 commit 939aa84

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.springframework.aop.aspectj.annotation;
1818

1919
import java.io.Serializable;
20+
import java.lang.annotation.Annotation;
2021
import java.lang.reflect.Field;
2122
import java.lang.reflect.Method;
2223
import java.util.ArrayList;
@@ -82,8 +83,7 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
8283
// @AfterThrowing methods due to the fact that AspectJAfterAdvice.invoke(MethodInvocation)
8384
// invokes proceed() in a `try` block and only invokes the @After advice method
8485
// in a corresponding `finally` block.
85-
@SuppressWarnings("NullAway")
86-
Comparator<Method> adviceKindComparator = new ConvertingComparator<>(
86+
Comparator<Method> adviceKindComparator = new ConvertingComparator<Method, @Nullable Annotation>(
8787
new InstanceComparator<>(
8888
Around.class, Before.class, After.class, AfterReturning.class, AfterThrowing.class),
8989
method -> {

spring-core/src/main/java/org/springframework/core/convert/converter/ConvertingComparator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* @param <S> the source type
3737
* @param <T> the target type
3838
*/
39-
public class ConvertingComparator<S, T> implements Comparator<S> {
39+
public class ConvertingComparator<S, T extends @Nullable Object> implements Comparator<S> {
4040

4141
private final Comparator<T> comparator;
4242

0 commit comments

Comments
 (0)