Use MergedAnnotation.getRoot() method

Closes gh-16661
pull/16699/head
Madhura Bhave 6 years ago
parent 8b30ad21bb
commit fd97066604

@ -179,7 +179,7 @@
<snakeyaml.version>1.24</snakeyaml.version> <snakeyaml.version>1.24</snakeyaml.version>
<solr.version>8.0.0</solr.version> <solr.version>8.0.0</solr.version>
<!-- deprecated in favor of "spring-framework.version" --> <!-- deprecated in favor of "spring-framework.version" -->
<spring.version>5.2.0.M1</spring.version> <spring.version>5.2.0.BUILD-SNAPSHOT</spring.version>
<spring-amqp.version>2.2.0.M1</spring-amqp.version> <spring-amqp.version>2.2.0.M1</spring-amqp.version>
<spring-batch.version>4.2.0.M1</spring-batch.version> <spring-batch.version>4.2.0.M1</spring-batch.version>
<spring-cloud-connectors.version>2.0.5.RELEASE</spring-cloud-connectors.version> <spring-cloud-connectors.version>2.0.5.RELEASE</spring-cloud-connectors.version>

@ -114,11 +114,8 @@ class ConfigurationPropertiesScanRegistrar
.from(type, MergedAnnotations.SearchStrategy.EXHAUSTIVE) .from(type, MergedAnnotations.SearchStrategy.EXHAUSTIVE)
.get(Component.class); .get(Component.class);
if (component.isPresent()) { if (component.isPresent()) {
MergedAnnotation<?> parent = component; throw new InvalidConfigurationPropertiesException(type,
while (parent.getParent() != null) { component.getRoot().getType());
parent = parent.getParent();
}
throw new InvalidConfigurationPropertiesException(type, parent.getType());
} }
} }

Loading…
Cancel
Save