You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Niall Pemberton (JIRA)" <ji...@apache.org> on 2010/09/10 14:20:33 UTC

[jira] Updated: (BEANUTILS-380) BeanMap methods should initialize the root cause of exceptions that are thrown when running on JDK 1.4+

     [ https://issues.apache.org/jira/browse/BEANUTILS-380?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niall Pemberton updated BEANUTILS-380:
--------------------------------------

          Summary: BeanMap methods should initialize the root cause of exceptions that are thrown when running on JDK 1.4+  (was: [beanutils] BeanMap.put() method should pass the root cause of any InvocationTargetException that is thrown when invoking the setter)
         Assignee: Niall Pemberton
    Fix Version/s: 1.8.4
      Component/s: Bean-Collections
                       (was: Bean / Property Utils)

> BeanMap methods should initialize the root cause of exceptions that are thrown when running on JDK 1.4+
> -------------------------------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-380
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-380
>             Project: Commons BeanUtils
>          Issue Type: Improvement
>          Components: Bean-Collections
>    Affects Versions: 1.8.3
>            Reporter: Brendan Nolan
>            Assignee: Niall Pemberton
>             Fix For: 1.8.4
>
>         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.