Skip to content

Commit dcc49ba

Browse files
authored
GH-2456: (Re) Support Spring Framework 5.2 (#2530)
The framework is intended for use with Spring Framework 5.3. However, this change was the only thing preventing it being used with 5.2.
1 parent 429823b commit dcc49ba

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spring-rabbit/src/main/java/org/springframework/amqp/rabbit/annotation/RabbitListenerAnnotationBeanPostProcessor.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,9 @@ private TypeMetadata buildMetadata(Class<?> targetClass) {
320320
final List<ListenerMethod> methods = new ArrayList<>();
321321
final List<Method> multiMethods = new ArrayList<>();
322322
ReflectionUtils.doWithMethods(targetClass, method -> {
323+
if (method.getDeclaringClass().getName().contains("$MockitoMock$")) {
324+
return;
325+
}
323326
List<RabbitListener> listenerAnnotations = findListenerAnnotations(method);
324327
if (listenerAnnotations.size() > 0) {
325328
methods.add(new ListenerMethod(method,
@@ -331,8 +334,7 @@ private TypeMetadata buildMetadata(Class<?> targetClass) {
331334
multiMethods.add(method);
332335
}
333336
}
334-
}, ReflectionUtils.USER_DECLARED_METHODS
335-
.and(meth -> !meth.getDeclaringClass().getName().contains("$MockitoMock$")));
337+
}, ReflectionUtils.USER_DECLARED_METHODS);
336338
if (methods.isEmpty() && multiMethods.isEmpty()) {
337339
return TypeMetadata.EMPTY;
338340
}

0 commit comments

Comments
 (0)