Fix NPE for @Indexed in the MessagingGatewayReg
The `@Indexed` comes without any attributes, but it is included into a chain via `importingClassMetadata.getMetaAnnotationTypes(ann)`. So, skip attributes from meta annotation when it is `null` **Cherry-pick to `5.4.x` & `5.3.x`**
This commit is contained in:
@@ -45,7 +45,6 @@ import org.springframework.stereotype.Indexed;
|
||||
*/
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Indexed
|
||||
public @interface MessagingGateway {
|
||||
|
||||
|
||||
@@ -199,7 +199,10 @@ public class MessagingGatewayRegistrar implements ImportBeanDefinitionRegistrar
|
||||
Set<String> chain = importingClassMetadata.getMetaAnnotationTypes(ann);
|
||||
if (chain.contains(MessagingGateway.class.getName())) {
|
||||
for (String meta : chain) {
|
||||
valuesHierarchy.add(importingClassMetadata.getAllAnnotationAttributes(meta));
|
||||
MultiValueMap<String, Object> attributes = importingClassMetadata.getAllAnnotationAttributes(meta);
|
||||
if (attributes != null) {
|
||||
valuesHierarchy.add(attributes);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user