From 28d11aaf6469911e31e1f2bdb9c22b5c24715e19 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 27 Feb 2023 16:38:55 +0100 Subject: [PATCH] Polish contribution See gh-30036 --- src/docs/asciidoc/core/core-validation.adoc | 30 +++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/docs/asciidoc/core/core-validation.adoc b/src/docs/asciidoc/core/core-validation.adoc index 26af13fb6c..0df73438db 100644 --- a/src/docs/asciidoc/core/core-validation.adoc +++ b/src/docs/asciidoc/core/core-validation.adoc @@ -1577,20 +1577,22 @@ For example, the following Java configuration registers a global `yyyyMMdd` form public FormattingConversionService conversionService() { // Use the DefaultFormattingConversionService but do not register defaults - DefaultFormattingConversionService conversionService = new DefaultFormattingConversionService(false); + DefaultFormattingConversionService conversionService = + new DefaultFormattingConversionService(false); // Ensure @NumberFormat is still supported - conversionService.addFormatterForFieldAnnotation(new NumberFormatAnnotationFormatterFactory()); + conversionService.addFormatterForFieldAnnotation( + new NumberFormatAnnotationFormatterFactory()); // Register JSR-310 date conversion with a specific global format - DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar(); - registrar.setDateFormatter(DateTimeFormatter.ofPattern("yyyyMMdd")); - registrar.registerFormatters(conversionService); + DateTimeFormatterRegistrar dateTimeRegistrar = new DateTimeFormatterRegistrar(); + dateTimeRegistrar.setDateFormatter(DateTimeFormatter.ofPattern("yyyyMMdd")); + dateTimeRegistrar.registerFormatters(conversionService); // Register date conversion with a specific global format - DateFormatterRegistrar anotherRegistrar = new DateFormatterRegistrar(); - anotherRegistrar.setFormatter(new DateFormatter("yyyyMMdd")); - anotherRegistrar.registerFormatters(conversionService); + DateFormatterRegistrar dateRegistrar = new DateFormatterRegistrar(); + dateRegistrar.setFormatter(new DateFormatter("yyyyMMdd")); + dateRegistrar.registerFormatters(conversionService); return conversionService; } @@ -1611,14 +1613,14 @@ For example, the following Java configuration registers a global `yyyyMMdd` form addFormatterForFieldAnnotation(NumberFormatAnnotationFormatterFactory()) // Register JSR-310 date conversion with a specific global format - val registrar = DateTimeFormatterRegistrar() - registrar.setDateFormatter(DateTimeFormatter.ofPattern("yyyyMMdd")) - registrar.registerFormatters(this) + val dateTimeRegistrar = DateTimeFormatterRegistrar() + dateTimeRegistrar.setDateFormatter(DateTimeFormatter.ofPattern("yyyyMMdd")) + dateTimeRegistrar.registerFormatters(this) // Register date conversion with a specific global format - val anotherRegistrar = DateFormatterRegistrar() - anotherRegistrar.setFormatter(DateFormatter("yyyyMMdd")) - anotherRegistrar.registerFormatters(this) + val dateRegistrar = DateFormatterRegistrar() + dateRegistrar.setFormatter(DateFormatter("yyyyMMdd")) + dateRegistrar.registerFormatters(this) } } }