From 9cd9e1cef919ee19db88824abdb3f1b839b8891f Mon Sep 17 00:00:00 2001 From: Oliver Drotbohm Date: Thu, 19 Aug 2021 23:19:08 +0200 Subject: [PATCH] Avoid eager reference to BackendIdConverter beans. Switched to bean method parameter reference to all BackendIdConverter instances. Fixes #2055. --- .../rest/webmvc/config/RepositoryRestMvcConfiguration.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java index 97d3de9f9..6d0febec0 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java @@ -158,7 +158,6 @@ public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebCon @Autowired ApplicationContext applicationContext; - @Autowired(required = false) List idConverters = Collections.emptyList(); @Autowired(required = false) List> lookups = Collections.emptyList(); @Autowired List> defaultMessageConverters; @@ -848,10 +847,10 @@ public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebCon } @Bean - public PluginRegistry> backendIdConverterRegistry() { + public PluginRegistry> backendIdConverterRegistry( + List backendIdConverter) { - List converters = new ArrayList<>(idConverters.size()); - converters.addAll(this.idConverters); + List converters = new ArrayList<>(backendIdConverter); converters.add(DefaultIdConverter.INSTANCE); return PluginRegistry.of(converters);