From b3b7e78ce6aa895761dfe0a314f3f45dc6d18793 Mon Sep 17 00:00:00 2001 From: Krzysztof Majewski Date: Tue, 17 Sep 2019 09:07:47 +0200 Subject: [PATCH] review updates --- .../interpolation/MyMessageInterpolator.java | 3 ++- .../baeldung/interpolation/ValidationExamples.java | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/MyMessageInterpolator.java b/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/MyMessageInterpolator.java index 8251138b9b..efa3d62b88 100644 --- a/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/MyMessageInterpolator.java +++ b/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/MyMessageInterpolator.java @@ -17,12 +17,13 @@ public class MyMessageInterpolator implements MessageInterpolator { @Override public String interpolate(String messageTemplate, Context context) { - logger.debug("Selecting the language " + Locale.getDefault() + " for the error message."); + messageTemplate = messageTemplate.toUpperCase(); return defaultInterpolator.interpolate(messageTemplate, context, Locale.getDefault()); } @Override public String interpolate(String messageTemplate, Context context, Locale locale) { + messageTemplate = messageTemplate.toUpperCase(); return defaultInterpolator.interpolate(messageTemplate, context, locale); } } diff --git a/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java b/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java index d353e4f7f2..30d770205e 100644 --- a/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java +++ b/spring-mvc-simple-2/src/main/java/com/baeldung/interpolation/ValidationExamples.java @@ -10,21 +10,21 @@ public class ValidationExamples { private static final Formatter formatter = new Formatter(); @Size( - min = 5, - max = 14, - message = "The author email '${validatedValue}' must be between {min} and {max} characters long" + min = 5, + max = 14, + message = "The author email '${validatedValue}' must be between {min} and {max} characters long" ) private String authorEmail; @Min( - value = 1, - message = "There must be at least {value} test{value > 1 ? 's' : ''} int the test case" + value = 1, + message = "There must be at least {value} test{value > 1 ? 's' : ''} int the test case" ) private int testCount; @DecimalMin( - value = "50", - message = "The code coverage ${formatter.format('%1$.2f', validatedValue)} must be higher than {value}%" + value = "50", + message = "The code coverage ${formatter.format('%1$.2f', validatedValue)} must be higher than {value}%" ) private double codeCoverage;