Fix MergedAnnotations.SearchStrategy deprecations

a6021cc968
This commit is contained in:
Gary Russell
2019-07-31 11:31:18 -04:00
parent fc827e1f92
commit bf1d562c3b
3 changed files with 7 additions and 4 deletions

View File

@@ -46,6 +46,7 @@ import org.springframework.util.StringUtils;
* @author Gareth Chapman
* @author Cameron Mayfield
* @author Chengchen Ji
* @author Gary Russell
*
* @since 2.0
*/
@@ -97,7 +98,7 @@ public class MethodAnnotationPublisherMetadataSource implements PublisherMetadat
method1 -> {
Expression payloadExpression = null;
MergedAnnotation<Payload> payloadMergedAnnotation =
MergedAnnotations.from(method, MergedAnnotations.SearchStrategy.EXHAUSTIVE)
MergedAnnotations.from(method, MergedAnnotations.SearchStrategy.TYPE_HIERARCHY)
.get(Payload.class);
if (payloadMergedAnnotation.isPresent()) {
String payloadExpressionString = payloadMergedAnnotation.getString("expression");
@@ -170,7 +171,7 @@ public class MethodAnnotationPublisherMetadataSource implements PublisherMetadat
@Nullable
private String getAnnotationValue(AnnotatedElement element, String attributeName) {
MergedAnnotations mergedAnnotations =
MergedAnnotations.from(element, MergedAnnotations.SearchStrategy.EXHAUSTIVE);
MergedAnnotations.from(element, MergedAnnotations.SearchStrategy.TYPE_HIERARCHY);
String value = null;
for (Class<? extends Annotation> annotationType : this.annotationTypes) {
MergedAnnotation<? extends Annotation> mergedAnnotation = mergedAnnotations.get(annotationType);

View File

@@ -42,11 +42,13 @@ import org.springframework.util.ReflectionUtils;
*
* @author Mark Fisher
* @author Artem Bilan
* @author Gary Russell
*
* @since 4.0
*/
public class ControlBusMethodFilter implements MethodFilter {
@Override
public List<Method> filter(List<Method> methods) {
List<Method> supportedMethods = new ArrayList<>();
for (Method method : methods) {
@@ -73,7 +75,7 @@ public class ControlBusMethodFilter implements MethodFilter {
}
MergedAnnotations mergedAnnotations =
MergedAnnotations.from(method, MergedAnnotations.SearchStrategy.EXHAUSTIVE,
MergedAnnotations.from(method, MergedAnnotations.SearchStrategy.TYPE_HIERARCHY,
RepeatableContainers.none(), AnnotationFilter.PLAIN);
return mergedAnnotations.get(ManagedAttribute.class).isPresent()

View File

@@ -59,7 +59,7 @@ public class IntegrationJmxAttributeSource extends AnnotationJmxAttributeSource
@Override
public ManagedResource getManagedResource(Class<?> beanClass) throws InvalidMetadataException {
MergedAnnotation<IntegrationManagedResource> ann =
MergedAnnotations.from(beanClass, MergedAnnotations.SearchStrategy.EXHAUSTIVE)
MergedAnnotations.from(beanClass, MergedAnnotations.SearchStrategy.TYPE_HIERARCHY)
.get(IntegrationManagedResource.class)
.withNonMergedAttributes();
if (!ann.isPresent()) {