Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 22915 invoked from network); 9 Sep 2010 22:59:13 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Sep 2010 22:59:13 -0000 Received: (qmail 33822 invoked by uid 500); 9 Sep 2010 22:59:13 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 33753 invoked by uid 500); 9 Sep 2010 22:59:12 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 33745 invoked by uid 99); 9 Sep 2010 22:59:12 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Sep 2010 22:59:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Sep 2010 22:58:54 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o89MwWxF026363 for ; Thu, 9 Sep 2010 22:58:33 GMT Message-ID: <33438495.104661284073112683.JavaMail.jira@thor> Date: Thu, 9 Sep 2010 18:58:32 -0400 (EDT) From: "Brendan Nolan (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (BEANUTILS-380) [beanutils] BeanMap.put() method should pass the root cause of any InvocationTargetException that is thrown when invoking the setter In-Reply-To: <3247840.104581284072752945.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/BEANUTILS-380?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Brendan Nolan updated BEANUTILS-380: ------------------------------------ Attachment: BEANUTILS-380.patch Proposed code change and corresponding test case > [beanutils] BeanMap.put() method should pass the root cause of any InvocationTargetException that is thrown when invoking the setter > ------------------------------------------------------------------------------------------------------------------------------------ > > Key: BEANUTILS-380 > URL: https://issues.apache.org/jira/browse/BEANUTILS-380 > Project: Commons BeanUtils > Issue Type: Improvement > Components: Bean / Property Utils > Affects Versions: 1.8.3 > Reporter: Brendan Nolan > Attachments: BEANUTILS-380.patch > > > The following code > {code} > import org.apache.commons.beanutils.BeanMap; > import SetterTest.SetterThrownException; > public class SetterTest { > public static void main(String[] args) { > > try { > BeanMap map = new BeanMap(new SetterTest()); > map.put("value", "value"); > } catch (Exception e) { > e.printStackTrace(); > } > } > public void setValue(String value) throws SetterThrownException { > throw new SetterThrownException("I want to see this in the stacktrace"); > } > > > class SetterThrownException extends Exception > { > > public SetterThrownException(String message) { > super(message); > } > > } > } > {code} > will return this stacktrace > {code} > java.lang.IllegalArgumentException > at org.apache.commons.beanutils.BeanMap.put(BeanMap.java:438) > at SetterTest.main(SetterTest.java:9) > {code} > I think it should show the root cause of the exception > {code} > java.lang.IllegalArgumentException: java.lang.reflect.InvocationTargetException > at org.apache.commons.beanutils.BeanMap.put(BeanMap.java:438) > at SetterTest.main(SetterTest.java:11) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.apache.commons.beanutils.BeanMap.put(BeanMap.java:431) > ... 1 more > Caused by: SetterTest$SetterThrownException: I want to see this in the stacktrace > at SetterTest.setValue(SetterTest.java:18) > ... 6 more > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.