Skip to content

Commit bf1d562

Browse files
committed
Fix MergedAnnotations.SearchStrategy deprecations
spring-projects/spring-framework@a6021cc
1 parent fc827e1 commit bf1d562

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

spring-integration-core/src/main/java/org/springframework/integration/aop/MethodAnnotationPublisherMetadataSource.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
* @author Gareth Chapman
4747
* @author Cameron Mayfield
4848
* @author Chengchen Ji
49+
* @author Gary Russell
4950
*
5051
* @since 2.0
5152
*/
@@ -97,7 +98,7 @@ public Expression getExpressionForPayload(Method method) {
9798
method1 -> {
9899
Expression payloadExpression = null;
99100
MergedAnnotation<Payload> payloadMergedAnnotation =
100-
MergedAnnotations.from(method, MergedAnnotations.SearchStrategy.EXHAUSTIVE)
101+
MergedAnnotations.from(method, MergedAnnotations.SearchStrategy.TYPE_HIERARCHY)
101102
.get(Payload.class);
102103
if (payloadMergedAnnotation.isPresent()) {
103104
String payloadExpressionString = payloadMergedAnnotation.getString("expression");
@@ -170,7 +171,7 @@ public Map<String, Expression> getExpressionsForHeaders(Method method) {
170171
@Nullable
171172
private String getAnnotationValue(AnnotatedElement element, String attributeName) {
172173
MergedAnnotations mergedAnnotations =
173-
MergedAnnotations.from(element, MergedAnnotations.SearchStrategy.EXHAUSTIVE);
174+
MergedAnnotations.from(element, MergedAnnotations.SearchStrategy.TYPE_HIERARCHY);
174175
String value = null;
175176
for (Class<? extends Annotation> annotationType : this.annotationTypes) {
176177
MergedAnnotation<? extends Annotation> mergedAnnotation = mergedAnnotations.get(annotationType);

spring-integration-core/src/main/java/org/springframework/integration/expression/ControlBusMethodFilter.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@
4242
*
4343
* @author Mark Fisher
4444
* @author Artem Bilan
45+
* @author Gary Russell
4546
*
4647
* @since 4.0
4748
*/
4849
public class ControlBusMethodFilter implements MethodFilter {
4950

51+
@Override
5052
public List<Method> filter(List<Method> methods) {
5153
List<Method> supportedMethods = new ArrayList<>();
5254
for (Method method : methods) {
@@ -73,7 +75,7 @@ private boolean accept(Method method) {
7375
}
7476

7577
MergedAnnotations mergedAnnotations =
76-
MergedAnnotations.from(method, MergedAnnotations.SearchStrategy.EXHAUSTIVE,
78+
MergedAnnotations.from(method, MergedAnnotations.SearchStrategy.TYPE_HIERARCHY,
7779
RepeatableContainers.none(), AnnotationFilter.PLAIN);
7880

7981
return mergedAnnotations.get(ManagedAttribute.class).isPresent()

spring-integration-jmx/src/main/java/org/springframework/integration/monitor/IntegrationJmxAttributeSource.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void setBeanFactory(BeanFactory beanFactory) {
5959
@Override
6060
public ManagedResource getManagedResource(Class<?> beanClass) throws InvalidMetadataException {
6161
MergedAnnotation<IntegrationManagedResource> ann =
62-
MergedAnnotations.from(beanClass, MergedAnnotations.SearchStrategy.EXHAUSTIVE)
62+
MergedAnnotations.from(beanClass, MergedAnnotations.SearchStrategy.TYPE_HIERARCHY)
6363
.get(IntegrationManagedResource.class)
6464
.withNonMergedAttributes();
6565
if (!ann.isPresent()) {

0 commit comments

Comments
 (0)