You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bval.apache.org by rm...@apache.org on 2019/02/17 11:01:58 UTC

[bval] branch master updated: BVAL-170 skip interpolation when not needed

This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bval.git


The following commit(s) were added to refs/heads/master by this push:
     new d1abb1e  BVAL-170 skip interpolation when not needed
d1abb1e is described below

commit d1abb1ef3c33df6a4a355505929f5278337a0b37
Author: Romain Manni-Bucau <rm...@apache.org>
AuthorDate: Sun Feb 17 12:01:55 2019 +0100

    BVAL-170 skip interpolation when not needed
---
 .../src/main/java/org/apache/bval/jsr/DefaultMessageInterpolator.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultMessageInterpolator.java b/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultMessageInterpolator.java
index d94187a..34c4f68 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultMessageInterpolator.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/DefaultMessageInterpolator.java
@@ -134,6 +134,10 @@ public class DefaultMessageInterpolator implements MessageInterpolator {
     /** {@inheritDoc} */
     @Override
     public String interpolate(final String message, final Context context, final Locale locale) {
+        if (!message.contains("{")) {
+            return resolveEscapeSequences(message);
+        }
+
         final ResourceBundle userResourceBundle = findUserResourceBundle(locale);
         final ResourceBundle defaultResourceBundle = findDefaultResourceBundle(locale);