Support @Value for record injection
Add @Value support for record injection by disabling populateBean() for records, since records are immutable. See gh-28770 Closes gh-28774
This commit is contained in:
@@ -1353,6 +1353,10 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
||||
* @param bw the BeanWrapper with bean instance
|
||||
*/
|
||||
protected void populateBean(String beanName, RootBeanDefinition mbd, @Nullable BeanWrapper bw) {
|
||||
// record has not set methods
|
||||
if (mbd.getBeanClass().isRecord()) {
|
||||
return;
|
||||
}
|
||||
if (bw == null) {
|
||||
if (mbd.hasPropertyValues()) {
|
||||
throw new BeanCreationException(
|
||||
|
||||
Reference in New Issue
Block a user