Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8F341118E1 for ; Sun, 21 Sep 2014 09:05:34 +0000 (UTC) Received: (qmail 34303 invoked by uid 500); 21 Sep 2014 09:05:34 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 34254 invoked by uid 500); 21 Sep 2014 09:05:34 -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 34243 invoked by uid 99); 21 Sep 2014 09:05:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Sep 2014 09:05:34 +0000 Date: Sun, 21 Sep 2014 09:05:34 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-3698) jasperreports plugin's ValueStackDataSource converts field values in ValueStackDataSource even when it's not wanted MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14142387#comment-14142387 ] ASF subversion and git services commented on WW-3698: ----------------------------------------------------- Commit 87c204ef6c28f918f9c18cdaaec883f1375fa786 in struts's branch refs/heads/develop from [~lukaszlenart] [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=87c204e ] WW-3698 Updates JavaDoc about new wrapField parameter > jasperreports plugin's ValueStackDataSource converts field values in ValueStackDataSource even when it's not wanted > ------------------------------------------------------------------------------------------------------------------- > > Key: WW-3698 > URL: https://issues.apache.org/jira/browse/WW-3698 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - JasperReports > Affects Versions: 2.2.3.1 > Environment: Tomcat 7 application server, Jasperreports 4.1.1 > Reporter: Dario Tortola > Assignee: Lukasz Lenart > Priority: Minor > Labels: patch > Fix For: 2.3.18 > > Original Estimate: 20m > Remaining Estimate: 20m > > Report A with Subreport B > Subreport B's datasource is a java.util.List field of Report A's datasource's elements > org.apache.struts2.views.jasperreports.ValueStackDataSource.getFieldValue, after locating the value, if org.apache.struts2.util.MakeIterator.isIterable(value) instead of value a new ValueStackDataSource over value is returned. > Since ValueStackDataSource is not a java.util.List, a javax.servlet.ServletException is thrown when the returned ValueStackDataSource fails to be cast to List > To avoid such unwanted conversion it's enough to change this code on ValueStackDataSource.getFieldValue > {code:java} > if (MakeIterator.isIterable(value)) { > return new ValueStackDataSource(this.valueStack, expression); > } else { > return value; > } > {code} > replace (MakeIterator.isIterable(value)) with (!field.getValueClass().isInstance(value) && MakeIterator.isIterable(value)) for the new ValueStackDataSource to be returned only if the value is not already what the field asks for -- This message was sent by Atlassian JIRA (v6.3.4#6332)