Merge pull request #463 from apache/WW-4742-no-key

[WW-4742] Stops evaluating default message as a OGNL expression
diff --git a/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java b/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java
index 2d08d8f..1fa4110 100644
--- a/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java
+++ b/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java
@@ -46,27 +46,6 @@
      * @return the message if found, otherwise the defaultMessage
      */
     public static String getText(String key, String defaultMessage, List<Object> args, ValueStack stack) {
-        return getText(key, defaultMessage, args, stack, false);
-    }
-
-    /**
-     * <p>Get a message from the first TextProvider encountered in the stack.
-     * If the first TextProvider doesn't provide the message the default message is returned.</p>
-     * <p>The search for a TextProvider is iterative from the root of the stack.</p>
-     * <p>This method was refactored from  {@link org.apache.struts2.components.Text} to use a
-     * consistent implementation across UIBean components.</p>
-     * @param key             the message key in the resource bundle
-     * @param defaultMessage  the message to return if not found (evaluated for OGNL)
-     * @param args            an array args to be used in a {@link java.text.MessageFormat} message
-     * @param stack           the value stack to use for finding the text
-     * @param searchStack     search stack for the key
-     *
-     * @return the message if found, otherwise the defaultMessage
-     *
-     * @deprecated The stack should never be searched for the key. Use the version without the searchStack boolean instead.
-     */
-    @Deprecated
-    public static String getText(String key, String defaultMessage, List<Object> args, ValueStack stack, boolean searchStack) {
         String msg = null;
         TextProvider tp = null;
 
@@ -80,17 +59,11 @@
         }
 
         if (msg == null) {
-            // evaluate the defaultMessage as an OGNL expression
-            if (searchStack)
-                msg = stack.findString(defaultMessage);
-            
-            if (msg == null) {
-                // use the defaultMessage literal value
-                msg = defaultMessage;
-                msg = StringEscapeUtils.escapeEcmaScript(msg);
-                msg = StringEscapeUtils.escapeHtml4(msg);
-                LOG.debug("Message for key '{}' is null, returns escaped default message [{}]", key, msg);
-            }
+            // use the defaultMessage literal value
+            msg = defaultMessage;
+            msg = StringEscapeUtils.escapeHtml4(msg);
+            msg = StringEscapeUtils.escapeEcmaScript(msg);
+            LOG.debug("Message for key '{}' is null, returns escaped default message [{}]", key, msg);
 
             if (LOG.isWarnEnabled()) {
                 if (tp != null) {