Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4C851200B9C for ; Mon, 10 Oct 2016 11:46:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4AEF7160AE1; Mon, 10 Oct 2016 09:46:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8F777160ACA for ; Mon, 10 Oct 2016 11:46:21 +0200 (CEST) Received: (qmail 7243 invoked by uid 500); 10 Oct 2016 09:46:20 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 7217 invoked by uid 99); 10 Oct 2016 09:46:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Oct 2016 09:46:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 961B12C0B04 for ; Mon, 10 Oct 2016 09:46:20 +0000 (UTC) Date: Mon, 10 Oct 2016 09:46:20 +0000 (UTC) From: "Hudson (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-4453) tag doesn't report missing value MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 10 Oct 2016 09:46:22 -0000 [ https://issues.apache.org/jira/browse/WW-4453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15561823#comment-15561823 ] Hudson commented on WW-4453: ---------------------------- SUCCESS: Integrated in Jenkins build Struts-JDK7-master #539 (See [https://builds.apache.org/job/Struts-JDK7-master/539/]) WW-4453 Reduces level to WARN (lukaszlenart: rev dbf2bcb5cd2130056796ecea2f6f3c1055914097) * (edit) core/src/main/java/org/apache/struts2/components/Date.java > tag doesn't report missing value > ------------------------------------------ > > Key: WW-4453 > URL: https://issues.apache.org/jira/browse/WW-4453 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - Tags > Affects Versions: 2.3.20 > Reporter: Lukasz Lenart > Assignee: Lukasz Lenart > Fix For: 2.3.24 > > > If you pass a value which isn't {{Date}} or {{Calendar}}, the {{}} ignores it and doesn't report any problems. The problem is here > {code:java} > public boolean end(Writer writer, String body) { > String msg; > java.util.Date date = null; > // find the name on the valueStack > try { > //suport Calendar also > Object dateObject = findValue(name); > if (dateObject instanceof java.util.Date) { > date = (java.util.Date) dateObject; > } else if(dateObject instanceof Calendar){ > date = ((Calendar) dateObject).getTime(); > } > } catch (Exception e) { > LOG.error("Could not convert object with key '#0' to a java.util.Date instance", name); > } > {code} > there must additional {{else}} clause to report missing value, ie: > {code:java} > if (dateObject instanceof java.util.Date) { > date = (java.util.Date) dateObject; > } else if(dateObject instanceof Calendar){ > date = ((Calendar) dateObject).getTime(); > } else { > LOG.error(...); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)