Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
import org.springframework.aop.scope.ScopedProxyUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanDefinitionHolder;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
Expand Down Expand Up @@ -53,11 +50,9 @@
import org.springframework.context.EnvironmentAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.weaving.LoadTimeWeaverAware;
import org.springframework.core.env.Environment;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.core.style.ToStringCreator;
import org.springframework.instrument.classloading.LoadTimeWeaver;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

Expand Down Expand Up @@ -158,27 +153,6 @@ public String toString() {

}

@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(name = "javax.persistence.EntityManagerFactory")
protected static class JpaInvokerConfiguration implements LoadTimeWeaverAware, InitializingBean {

@Autowired
private ListableBeanFactory beanFactory;

@Override
public void afterPropertiesSet() {
String cls = "org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataSourceInitializerInvoker was removed in the Spring Boot commit you referenced, correct?

Therefore the if statement below never actually gets executed, right?

Copy link
Contributor Author

@quaff quaff Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly, Spring Boot rework DataSource initialization to fix it entirely, it can be proved since @ConditionalOnClass(name = "javax.persistence.EntityManagerFactory") never matches since it renamed to jakarta.persistence.EntityManagerFactory.

if (this.beanFactory.containsBean(cls)) {
this.beanFactory.getBean(cls);
}
}

@Override
public void setLoadTimeWeaver(LoadTimeWeaver ltw) {
}

}

@Component
protected static class RefreshScopeBeanDefinitionEnhancer
implements BeanDefinitionRegistryPostProcessor, EnvironmentAware {
Expand Down
Loading