Skip to content

Commit 386e04b

Browse files
committed
Deprecate R2dbcConverters.getOverrideConvertersToRegister() and its converters.
…OverrideConverters are no longer required as converters are filtered using ConverterConfiguration. Closes #750
1 parent f5d374a commit 386e04b

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

src/main/java/org/springframework/data/r2dbc/convert/R2dbcConverters.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ public static Collection<Object> getConvertersToRegister() {
7777
* @return A list of the registered converters to enforce JSR-310 type usage.
7878
* @see CustomConversions#DEFAULT_CONVERTERS
7979
* @see Jsr310Converters
80+
* @deprecated since 1.5, no longer required due to {@code ConverterConfiguration} converter filtering. Will be
81+
* removed with the next major release.
8082
*/
83+
@Deprecated
8184
public static Collection<Object> getOverrideConvertersToRegister() {
8285

8386
List<Object> converters = new ArrayList<>();
@@ -256,8 +259,11 @@ public ZonedDateTime convert(Row row) {
256259
* {@link Converter} override that forces {@link LocalDate} to stay on {@link LocalDate}.
257260
*
258261
* @author Mark Paluch
262+
* @deprecated since 1.5, no longer required due to {@code ConverterConfiguration} converter filtering. Will be
263+
* removed with the next major release.
259264
*/
260265
@WritingConverter
266+
@Deprecated
261267
public enum LocalDateConverterOverride implements Converter<LocalDate, LocalDate> {
262268

263269
INSTANCE;
@@ -272,8 +278,11 @@ public LocalDate convert(LocalDate value) {
272278
* {@link Converter} override that forces {@link LocalDateTime} to stay on {@link LocalDateTime}.
273279
*
274280
* @author Mark Paluch
281+
* @deprecated since 1.5, no longer required due to {@code ConverterConfiguration} converter filtering. Will be
282+
* removed with the next major release.
275283
*/
276284
@WritingConverter
285+
@Deprecated
277286
public enum LocalDateTimeConverterOverride implements Converter<LocalDateTime, LocalDateTime> {
278287

279288
INSTANCE;
@@ -288,8 +297,11 @@ public LocalDateTime convert(LocalDateTime value) {
288297
* {@link Converter} override that forces {@link LocalTime} to stay on {@link LocalTime}.
289298
*
290299
* @author Mark Paluch
300+
* @deprecated since 1.5, no longer required due to {@code ConverterConfiguration} converter filtering. Will be
301+
* removed with the next major release.
291302
*/
292303
@WritingConverter
304+
@Deprecated
293305
public enum LocalTimeConverterOverride implements Converter<LocalTime, LocalTime> {
294306

295307
INSTANCE;

src/main/java/org/springframework/data/r2dbc/convert/R2dbcCustomConversions.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class R2dbcCustomConversions extends CustomConversions {
4747
*/
4848
@Deprecated
4949
public R2dbcCustomConversions(Collection<?> converters) {
50-
super(new R2dbcCustomConversionsConfiguration(STORE_CONVERSIONS, appendOverrides(converters)));
50+
super(new R2dbcCustomConversionsConfiguration(STORE_CONVERSIONS, new ArrayList<>(converters)));
5151
}
5252

5353
/**
@@ -57,7 +57,7 @@ public R2dbcCustomConversions(Collection<?> converters) {
5757
* @param converters must not be {@literal null}.
5858
*/
5959
public R2dbcCustomConversions(StoreConversions storeConversions, Collection<?> converters) {
60-
super(new R2dbcCustomConversionsConfiguration(storeConversions, appendOverrides(converters)));
60+
super(new R2dbcCustomConversionsConfiguration(storeConversions, new ArrayList<>(converters)));
6161
}
6262

6363
/**
@@ -88,14 +88,6 @@ public static R2dbcCustomConversions of(R2dbcDialect dialect, Collection<?> conv
8888
return new R2dbcCustomConversions(StoreConversions.of(dialect.getSimpleTypeHolder(), storeConverters), converters);
8989
}
9090

91-
private static List<?> appendOverrides(Collection<?> converters) {
92-
93-
List<Object> objects = new ArrayList<>(converters);
94-
objects.addAll(R2dbcConverters.getOverrideConvertersToRegister());
95-
96-
return objects;
97-
}
98-
9991
static class R2dbcCustomConversionsConfiguration extends ConverterConfiguration {
10092

10193
public R2dbcCustomConversionsConfiguration(StoreConversions storeConversions, List<?> userConverters) {

0 commit comments

Comments
 (0)