Limit supported annotations to @ConfigurationProperties and @Configuration
Previously, the configuration property annotation processor declared that it supported all annotation types. This hurt performance and prevented incremental builds with Gradle when compiling source code containing source-retention annotations. This commit updates its supported annotation types to be only `@ConfigurationProperties` and `@Configuration`. The latter is declared to allow binding third-party classes returned from a `@Bean` method. Fixes gh-23580
This commit is contained in:
@@ -68,6 +68,13 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
*/
|
||||
class ConfigurationMetadataAnnotationProcessorTests extends AbstractMetadataGenerationTests {
|
||||
|
||||
@Test
|
||||
void supportedAnnotations() {
|
||||
assertThat(new ConfigurationMetadataAnnotationProcessor().getSupportedAnnotationTypes())
|
||||
.containsExactlyInAnyOrder("org.springframework.boot.context.properties.ConfigurationProperties",
|
||||
"org.springframework.context.annotation.Configuration");
|
||||
}
|
||||
|
||||
@Test
|
||||
void notAnnotated() {
|
||||
ConfigurationMetadata metadata = compile(NotAnnotated.class);
|
||||
|
||||
Reference in New Issue
Block a user