From 70eafa5fd122e764c7a360fb45d675a5757e9df7 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Wed, 13 Jun 2018 10:13:56 +0200 Subject: [PATCH] DATAREST-1198 - Polishing. Fixed @since tag in new converter implementation as we're going to backport the fix to Kay. Simplified converter setup in RepositoryRestMvcConfiguration to expose less API until someone actually requests access. Original pull request: #290. --- .../data/rest/core/StringToLdapNameConverter.java | 2 +- .../webmvc/config/RepositoryRestMvcConfiguration.java | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/StringToLdapNameConverter.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/StringToLdapNameConverter.java index 275385cb9..c09b9e4d3 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/StringToLdapNameConverter.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/StringToLdapNameConverter.java @@ -25,7 +25,7 @@ * {@link Converter} to convert a {@link String} to a {@link LdapName}. * * @author Mark Paluch - * @since 3.1 + * @since 3.0.8 */ public enum StringToLdapNameConverter implements Converter { 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 6fc32e772..58fc8f882 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 @@ -15,7 +15,6 @@ */ package org.springframework.data.rest.webmvc.config; -import javax.naming.Name; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -44,7 +43,6 @@ import org.springframework.context.support.ReloadableResourceBundleMessageSource; import org.springframework.core.Ordered; import org.springframework.core.convert.ConversionService; -import org.springframework.core.convert.converter.Converter; import org.springframework.core.io.ClassPathResource; import org.springframework.data.auditing.AuditableBeanWrapperFactory; import org.springframework.data.auditing.MappingAuditableBeanWrapperFactory; @@ -250,7 +248,7 @@ public DefaultFormattingConversionService defaultConversionService() { DefaultFormattingConversionService conversionService = new DefaultFormattingConversionService(); // Add Spring Data Commons formatters conversionService.addConverter(uriToEntityConverter(conversionService)); - conversionService.addConverter(stringToNameConverter()); + conversionService.addConverter(StringToLdapNameConverter.INSTANCE); addFormatters(conversionService); configurerDelegate.configureConversionService(conversionService); @@ -677,10 +675,6 @@ protected UriToEntityConverter uriToEntityConverter(ConversionService conversion return new UriToEntityConverter(persistentEntities(), repositoryInvokerFactory(conversionService), repositories()); } - protected Converter stringToNameConverter() { - return StringToLdapNameConverter.INSTANCE; - } - @Bean public ExcerptProjector excerptProjector() {