Make constructorOrFactory method resolution optional
This commit allows a custom code fragment to provide the code to create a bean without relying on ConstructorResolver. This is especially important for use cases that derive from the default behaviour and provide an instance supplier with the regular runtime scenario. This is a breaking change for code fragments providing a custom implementation of the related methods. As it turns out, almost all of them did not need the Executable argument. Configuration class parsing is the exception, where it needs to provide a different constructor in the case of the proxy. To make this use case possible, InstanceSupplierCodeGenerator has been made public. Closes gh-31117
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package org.springframework.orm.jpa.persistenceunit;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Executable;
|
||||
import java.util.List;
|
||||
|
||||
import javax.lang.model.element.Modifier;
|
||||
@@ -97,7 +96,6 @@ class PersistenceManagedTypesBeanRegistrationAotProcessor implements BeanRegistr
|
||||
@Override
|
||||
public CodeBlock generateInstanceSupplierCode(GenerationContext generationContext,
|
||||
BeanRegistrationCode beanRegistrationCode,
|
||||
Executable constructorOrFactoryMethod,
|
||||
boolean allowDirectSupplierShortcut) {
|
||||
PersistenceManagedTypes persistenceManagedTypes = this.registeredBean.getBeanFactory()
|
||||
.getBean(this.registeredBean.getBeanName(), PersistenceManagedTypes.class);
|
||||
|
||||
Reference in New Issue
Block a user