Previously, regular bean definitions for configuration properties classes that attempt to use constructor binding were detected in a bean factory post-processor, ConfigurationPropertiesBeanDefinitionValidator. This validation examined every standard bean definition and failed if it encountered one for a class that should have used constructor binding. There were two downsides to this approach: 1. Reflection used to identify if the bean should be using constructor binding triggered class loading that could prevent subsequent instrumentation by a load-time weaver. 2. The cost of the validation was incurred when there was no misconfiguration to report. This commit replaces ConfigurationPropertiesBeanDefinitionValidator with a failure analyzer. This failure analyzer only runs once a failure has occurred and the application context is not going to complete refresh. This avoids causing problems with subsequent instrumentation and also avoids the cost of validation and error reporting unless there is an error. Fixes gh-20798 |
||
---|---|---|
.. | ||
src | ||
pom.xml |