diff --git a/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceProxyRegistryFactoryBean.java b/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceProxyRegistryFactoryBean.java index 421510c7102..e136e993592 100644 --- a/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceProxyRegistryFactoryBean.java +++ b/spring-web/src/main/java/org/springframework/web/service/registry/HttpServiceProxyRegistryFactoryBean.java @@ -17,7 +17,6 @@ package org.springframework.web.service.registry; import java.util.Arrays; -import java.util.Collection; import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; @@ -90,19 +89,15 @@ public final class HttpServiceProxyRegistryFactoryBean // Set client builders this.groupAdapters.forEach((clientType, groupAdapter) -> - this.groupSet.stream() - .filter(group -> group.clientType().equals(clientType)) - .forEach(group -> group.initialize(groupAdapter))); + this.groupSet.stream() + .filter(group -> group.clientType().equals(clientType)) + .forEach(group -> group.initialize(groupAdapter))); // Apply group configurers - this.groupAdapters.forEach((clientType, groupAdapter) -> { - Collection> configurers = - this.applicationContext.getBeansOfType(groupAdapter.getConfigurerType()).values(); - - configurers.stream() - .filter(configurer -> groupAdapter.getConfigurerType().isInstance(configurer)) - .forEach(configurer -> configurer.configureGroups(new DefaultGroups<>(clientType))); - }); + this.groupAdapters.forEach((clientType, groupAdapter) -> + this.applicationContext.getBeanProvider(groupAdapter.getConfigurerType()) + .orderedStream() + .forEach(configurer -> configurer.configureGroups(new DefaultGroups<>(clientType)))); // Create proxies Map, Object>> groupProxyMap = this.groupSet.stream()