mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-10-09 08:40:39 +00:00
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 53d9ba879d.
See gh-35947
This commit is contained in:
+2
-2
@@ -17,6 +17,7 @@
|
||||
package org.springframework.aop.aspectj.annotation;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
@@ -82,8 +83,7 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
|
||||
// @AfterThrowing methods due to the fact that AspectJAfterAdvice.invoke(MethodInvocation)
|
||||
// invokes proceed() in a `try` block and only invokes the @After advice method
|
||||
// in a corresponding `finally` block.
|
||||
@SuppressWarnings("NullAway")
|
||||
Comparator<Method> adviceKindComparator = new ConvertingComparator<>(
|
||||
Comparator<Method> adviceKindComparator = new ConvertingComparator<Method, @Nullable Annotation>(
|
||||
new InstanceComparator<>(
|
||||
Around.class, Before.class, After.class, AfterReturning.class, AfterThrowing.class),
|
||||
method -> {
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ import org.springframework.util.comparator.Comparators;
|
||||
* @param <S> the source type
|
||||
* @param <T> the target type
|
||||
*/
|
||||
public class ConvertingComparator<S, T> implements Comparator<S> {
|
||||
public class ConvertingComparator<S, T extends @Nullable Object> implements Comparator<S> {
|
||||
|
||||
private final Comparator<T> comparator;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user