mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Stop using an instance supplier in EntityScanPackages' bean definition
Closes gh-34371
This commit is contained in:
parent
5e08ee6483
commit
fa63f6cc9e
@ -23,7 +23,6 @@ import java.util.Collections;
|
|||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.BeanFactory;
|
import org.springframework.beans.factory.BeanFactory;
|
||||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||||
@ -170,13 +169,9 @@ public class EntityScanPackages {
|
|||||||
addPackageNames(packageNames);
|
addPackageNames(packageNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Supplier<?> getInstanceSupplier() {
|
|
||||||
return () -> new EntityScanPackages(StringUtils.toStringArray(this.packageNames));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addPackageNames(Collection<String> additionalPackageNames) {
|
private void addPackageNames(Collection<String> additionalPackageNames) {
|
||||||
this.packageNames.addAll(additionalPackageNames);
|
this.packageNames.addAll(additionalPackageNames);
|
||||||
|
getConstructorArgumentValues().addIndexedArgumentValue(0, StringUtils.toStringArray(this.packageNames));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user