Skip to content

Commit 70eafa5

Browse files
committed
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.
1 parent dc22044 commit 70eafa5

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

spring-data-rest-core/src/main/java/org/springframework/data/rest/core/StringToLdapNameConverter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* {@link Converter} to convert a {@link String} to a {@link LdapName}.
2626
*
2727
* @author Mark Paluch
28-
* @since 3.1
28+
* @since 3.0.8
2929
*/
3030
public enum StringToLdapNameConverter implements Converter<String, Name> {
3131

spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java

+1-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.springframework.data.rest.webmvc.config;
1717

18-
import javax.naming.Name;
1918
import java.util.ArrayList;
2019
import java.util.Arrays;
2120
import java.util.Collection;
@@ -44,7 +43,6 @@
4443
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
4544
import org.springframework.core.Ordered;
4645
import org.springframework.core.convert.ConversionService;
47-
import org.springframework.core.convert.converter.Converter;
4846
import org.springframework.core.io.ClassPathResource;
4947
import org.springframework.data.auditing.AuditableBeanWrapperFactory;
5048
import org.springframework.data.auditing.MappingAuditableBeanWrapperFactory;
@@ -250,7 +248,7 @@ public DefaultFormattingConversionService defaultConversionService() {
250248
DefaultFormattingConversionService conversionService = new DefaultFormattingConversionService();
251249
// Add Spring Data Commons formatters
252250
conversionService.addConverter(uriToEntityConverter(conversionService));
253-
conversionService.addConverter(stringToNameConverter());
251+
conversionService.addConverter(StringToLdapNameConverter.INSTANCE);
254252
addFormatters(conversionService);
255253

256254
configurerDelegate.configureConversionService(conversionService);
@@ -677,10 +675,6 @@ protected UriToEntityConverter uriToEntityConverter(ConversionService conversion
677675
return new UriToEntityConverter(persistentEntities(), repositoryInvokerFactory(conversionService), repositories());
678676
}
679677

680-
protected Converter<String, ? extends Name> stringToNameConverter() {
681-
return StringToLdapNameConverter.INSTANCE;
682-
}
683-
684678
@Bean
685679
public ExcerptProjector excerptProjector() {
686680

0 commit comments

Comments
 (0)