Skip to content

Commit fd97066

Browse files
committed
Use MergedAnnotation.getRoot() method
Closes gh-16661
1 parent 8b30ad2 commit fd97066

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

spring-boot-project/spring-boot-dependencies/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
<snakeyaml.version>1.24</snakeyaml.version>
180180
<solr.version>8.0.0</solr.version>
181181
<!-- deprecated in favor of "spring-framework.version" -->
182-
<spring.version>5.2.0.M1</spring.version>
182+
<spring.version>5.2.0.BUILD-SNAPSHOT</spring.version>
183183
<spring-amqp.version>2.2.0.M1</spring-amqp.version>
184184
<spring-batch.version>4.2.0.M1</spring-batch.version>
185185
<spring-cloud-connectors.version>2.0.5.RELEASE</spring-cloud-connectors.version>

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesScanRegistrar.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,8 @@ private void validateScanConfiguration(Class<?> type) {
114114
.from(type, MergedAnnotations.SearchStrategy.EXHAUSTIVE)
115115
.get(Component.class);
116116
if (component.isPresent()) {
117-
MergedAnnotation<?> parent = component;
118-
while (parent.getParent() != null) {
119-
parent = parent.getParent();
120-
}
121-
throw new InvalidConfigurationPropertiesException(type, parent.getType());
117+
throw new InvalidConfigurationPropertiesException(type,
118+
component.getRoot().getType());
122119
}
123120
}
124121

0 commit comments

Comments
 (0)