tandraschko commented on code in PR #272:
URL: https://github.com/apache/bval/pull/272#discussion_r4184453283


##########
bval-jsr/src/main/java/org/apache/bval/jsr/DefaultMessageInterpolator.java:
##########
@@ -134,17 +136,27 @@ public String interpolate(final String message, final 
Context context) {
     /** {@inheritDoc} */
     @Override
     public String interpolate(final String message, final Context context, 
final Locale locale) {
+        final Map<String, Object> annotationParameters = 
context.getConstraintDescriptor().getAttributes();
+        final FinalMessageKey finalKey = new FinalMessageKey(locale, message, 
annotationParameters);
+        final String cached = finalMessages.get(finalKey);
+        if (cached != null) {
+            return cached;
+        }
         if (!message.contains("{")) {
             return resolveEscapeSequences(message);
         }
 
         String resolvedMessage = getSharedInterpolatedMessage(message, locale);
 
         // resolve annotation attributes (step 4)
-        final Map<String, Object> annotationParameters = 
context.getConstraintDescriptor().getAttributes();
         resolvedMessage = replaceAnnotationAttributes(resolvedMessage, 
annotationParameters);
 
-        // EL handling
+        // EL handling; the evaluator leaves messages without "${" untouched

Review Comment:
   What about #{ here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to