mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Fix NullAway suppression in EntityManagerFactoryBuilder
See gh-46587
This commit is contained in:
+2
-10
@@ -266,8 +266,8 @@ public class EntityManagerFactoryBuilder {
|
||||
if (this.managedTypes != null) {
|
||||
entityManagerFactoryBean.setManagedTypes(this.managedTypes);
|
||||
}
|
||||
else {
|
||||
setPackagesToScan(entityManagerFactoryBean);
|
||||
else if (this.packagesToScan != null) {
|
||||
entityManagerFactoryBean.setPackagesToScan(this.packagesToScan);
|
||||
}
|
||||
Map<String, ?> jpaProperties = EntityManagerFactoryBuilder.this.jpaPropertiesFactory.apply(this.dataSource);
|
||||
entityManagerFactoryBean.getJpaPropertyMap().putAll(new LinkedHashMap<>(jpaProperties));
|
||||
@@ -289,14 +289,6 @@ public class EntityManagerFactoryBuilder {
|
||||
return entityManagerFactoryBean;
|
||||
}
|
||||
|
||||
// TODO: Review this. The test
|
||||
// HibernateJpaAutoConfigurationTests.usesManuallyDefinedLocalContainerEntityManagerFactoryBeanUsingBuilder
|
||||
// fails if an non-null assert is added
|
||||
@SuppressWarnings("NullAway")
|
||||
private void setPackagesToScan(LocalContainerEntityManagerFactoryBean entityManagerFactoryBean) {
|
||||
entityManagerFactoryBean.setPackagesToScan(this.packagesToScan);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user