GH-323 - Move off of Google's Suppliers.memoize(…).
This commit is contained in:
@@ -22,6 +22,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
@@ -33,9 +34,7 @@ import org.springframework.modulith.core.ApplicationModule;
|
||||
import org.springframework.modulith.core.ApplicationModules;
|
||||
import org.springframework.modulith.core.JavaPackage;
|
||||
import org.springframework.modulith.test.ApplicationModuleTest.BootstrapMode;
|
||||
|
||||
import com.tngtech.archunit.thirdparty.com.google.common.base.Supplier;
|
||||
import com.tngtech.archunit.thirdparty.com.google.common.base.Suppliers;
|
||||
import org.springframework.util.function.SingletonSupplier;
|
||||
|
||||
/**
|
||||
* @author Oliver Drotbohm
|
||||
@@ -66,7 +65,7 @@ public class ModuleTestExecution implements Iterable<ApplicationModule> {
|
||||
|
||||
this.extraIncludes = getExtraModules(annotation, modules).toList();
|
||||
|
||||
this.basePackages = Suppliers.memoize(() -> {
|
||||
this.basePackages = SingletonSupplier.of(() -> {
|
||||
|
||||
var moduleBasePackages = module.getBootstrapBasePackages(modules, bootstrapMode.getDepth());
|
||||
var sharedBasePackages = modules.getSharedModules().stream().map(it -> it.getBasePackage());
|
||||
@@ -77,7 +76,7 @@ public class ModuleTestExecution implements Iterable<ApplicationModule> {
|
||||
return Stream.concat(intermediate, sharedBasePackages).distinct().toList();
|
||||
});
|
||||
|
||||
this.dependencies = Suppliers.memoize(() -> {
|
||||
this.dependencies = SingletonSupplier.of(() -> {
|
||||
|
||||
var bootstrapDependencies = module.getBootstrapDependencies(modules,
|
||||
bootstrapMode.getDepth());
|
||||
@@ -89,7 +88,7 @@ public class ModuleTestExecution implements Iterable<ApplicationModule> {
|
||||
}
|
||||
}
|
||||
|
||||
public static java.util.function.Supplier<ModuleTestExecution> of(Class<?> type) {
|
||||
public static Supplier<ModuleTestExecution> of(Class<?> type) {
|
||||
|
||||
return () -> {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user