diff --git a/core/src/main/java/org/springframework/plugin/core/support/AbstractTypeAwareSupport.java b/core/src/main/java/org/springframework/plugin/core/support/AbstractTypeAwareSupport.java index 92eccf4..3baa63a 100644 --- a/core/src/main/java/org/springframework/plugin/core/support/AbstractTypeAwareSupport.java +++ b/core/src/main/java/org/springframework/plugin/core/support/AbstractTypeAwareSupport.java @@ -20,11 +20,10 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; -import java.util.stream.Collectors; +import java.util.function.Predicate; import org.springframework.aop.TargetSource; import org.springframework.aop.framework.ProxyFactory; -import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.context.ApplicationContext; @@ -219,10 +218,10 @@ public abstract class AbstractTypeAwareSupport private Collection getBeansOfTypeExcept(Class type, Collection> exceptions) { - return Arrays.stream(context.getBeanNamesForType(type, false, eagerInit)) // - .filter(it -> !exceptions.contains(context.getType(it))) // - .map(it -> context.getBean(it)) // - .collect(Collectors.toList()); + return context.getBeanProvider(type, eagerInit) + .stream(Predicate.not(exceptions::contains)) + .map(Object.class::cast) + .toList(); } } } diff --git a/pom.xml b/pom.xml index fc71d40..a258ba1 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,7 @@ 5.9.1 1.4.4 4.9.0 - 6.0.0 + 7.0.0-SNAPSHOT 2.0.3 3.4.0 @@ -359,4 +359,21 @@ https://github.com/spring-projects/spring-plugin/issues + + + spring-milestone + https://repo.spring.io/milestone + + false + + + + spring-snapshot + https://repo.spring.io/snapshot + + false + + + +