mx4j/src/core/mx4j/server ReflectionMBeanInvoker.java,1.5,1.6

Simone Bordet <[email protected]> Sun, 13 Feb 2005 18:05:55 +0000
Newsgroups gmane.comp.java.mx4j.cvs
Message-ID <[email protected]>
Update of /cvsroot/mx4j/mx4j/src/core/mx4j/server
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32671/src/core/mx4j/server

Modified Files:
	ReflectionMBeanInvoker.java 
Log Message:
Fix for #1115165: ReflectionExceptions are not wrapped

Index: ReflectionMBeanInvoker.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/mx4j/server/ReflectionMBeanInvoker.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ReflectionMBeanInvoker.java	13 Nov 2004 16:38:29 -0000	1.5
--- ReflectionMBeanInvoker.java	13 Feb 2005 18:05:53 -0000	1.6
***************
*** 11,18 ****
  import java.lang.reflect.InvocationTargetException;
  import java.lang.reflect.Method;
  import javax.management.Attribute;
  import javax.management.AttributeNotFoundException;
  import javax.management.InvalidAttributeValueException;
- import javax.management.JMRuntimeException;
  import javax.management.MBeanAttributeInfo;
  import javax.management.MBeanException;
--- 11,18 ----
  import java.lang.reflect.InvocationTargetException;
  import java.lang.reflect.Method;
+ 
  import javax.management.Attribute;
  import javax.management.AttributeNotFoundException;
  import javax.management.InvalidAttributeValueException;
  import javax.management.MBeanAttributeInfo;
  import javax.management.MBeanException;
***************
*** 129,138 ****
           throw x;
        }
        catch (Throwable t)
        {
-          if (t instanceof Error) throw new RuntimeErrorException((Error)t);
-          if (t instanceof JMRuntimeException) throw (JMRuntimeException)t;
           if (t instanceof RuntimeException) throw new RuntimeMBeanException((RuntimeException)t);
!          throw new MBeanException((Exception)t);
        }
     }
--- 129,144 ----
           throw x;
        }
+       catch (InvocationTargetException x)
+       {
+          Throwable t = x.getTargetException();
+          if (t instanceof RuntimeException) throw new RuntimeMBeanException((RuntimeException)t);
+          if (t instanceof Exception) throw new MBeanException((Exception)t);
+          throw new RuntimeErrorException((Error)t);
+       }
        catch (Throwable t)
        {
           if (t instanceof RuntimeException) throw new RuntimeMBeanException((RuntimeException)t);
!          if (t instanceof Exception) throw new MBeanException((Exception)t);
!          throw new RuntimeErrorException((Error)t);
        }
     }
***************
*** 158,165 ****
           throw new BadArgumentException(x);
        }
-       catch (InvocationTargetException x)
-       {
-          throw x.getTargetException();
-       }
     }
  
--- 164,167 ----



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click