You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2016/10/10 09:02:37 UTC

struts git commit: WW-4453 Reduces level to WARN

Repository: struts
Updated Branches:
  refs/heads/master 1bd9bde61 -> dbf2bcb5c


WW-4453 Reduces level to WARN


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/dbf2bcb5
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/dbf2bcb5
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/dbf2bcb5

Branch: refs/heads/master
Commit: dbf2bcb5cd2130056796ecea2f6f3c1055914097
Parents: 1bd9bde
Author: Lukasz Lenart <lu...@apache.org>
Authored: Mon Oct 10 11:02:27 2016 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Mon Oct 10 11:02:27 2016 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/struts2/components/Date.java | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/dbf2bcb5/core/src/main/java/org/apache/struts2/components/Date.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/components/Date.java b/core/src/main/java/org/apache/struts2/components/Date.java
index 6500ef5..3c89ce4 100644
--- a/core/src/main/java/org/apache/struts2/components/Date.java
+++ b/core/src/main/java/org/apache/struts2/components/Date.java
@@ -23,6 +23,7 @@ package org.apache.struts2.components;
 
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.TextProvider;
+import com.opensymphony.xwork2.util.LocalizedTextUtil;
 import com.opensymphony.xwork2.util.ValueStack;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
@@ -291,8 +292,17 @@ public class Date extends ContextBean {
                 date = ((Calendar) dateObject).getTime();
             } else {
                 if (devMode) {
-                    LOG.error("Expression [{}] passed to <s:date/> tag which was evaluated to [{}]({}) isn't instance of java.util.Date nor java.util.Calendar!",
-                            name, dateObject, (dateObject != null ? dateObject.getClass() : "null"));
+                    String developerNotification = LocalizedTextUtil.findText(
+                            Date.class,
+                            "devmode.notification",
+                            ActionContext.getContext().getLocale(),
+                            "Developer Notification:\n{0}",
+                            new Object[]{
+                                    "Expression [" + name + "] passed to <s:date/> tag which was evaluated to [" + dateObject + "]("
+                                            + (dateObject != null ? dateObject.getClass() : "null") + ") isn't instance of java.util.Date nor java.util.Calendar!"
+                            }
+                    );
+                    LOG.warn(developerNotification);
                 } else {
                     LOG.debug("Expression [{}] passed to <s:date/> tag which was evaluated to [{}]({}) isn't instance of java.util.Date nor java.util.Calendar!",
                             name, dateObject, (dateObject != null ? dateObject.getClass() : "null"));