tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r659167 - /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbHomeProxyHandler.java
Date Thu, 22 May 2008 17:29:42 GMT
Author: dblevins
Date: Thu May 22 10:29:42 2008
New Revision: 659167

URL: http://svn.apache.org/viewvc?rev=659167&view=rev
Log:
Removed unsafe casts to Exception, replaced with initCause(Throwable)

Modified:
    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbHomeProxyHandler.java

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbHomeProxyHandler.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbHomeProxyHandler.java?rev=659167&r1=659166&r2=659167&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbHomeProxyHandler.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/EjbHomeProxyHandler.java
Thu May 22 10:29:42 2008
@@ -200,7 +200,7 @@
             */
         } catch (RemoteException re) {
             if (interfaceType.isLocal()) {
-                throw new EJBException(re.getMessage(), (Exception) re.detail);
+                throw new EJBException(re.getMessage()).initCause(re.detail);
             } else {
                 throw re;
             }
@@ -210,7 +210,7 @@
             if (cause instanceof RemoteException && interfaceType.isLocal()) {
                 RemoteException re = (RemoteException) cause;
                 Throwable detail = (re.detail != null) ? re.detail : re;
-                cause = new EJBException(re.getMessage(), (Exception) detail);
+                cause = new EJBException(re.getMessage()).initCause(detail);
             }
             throw cause;
             /*
@@ -226,7 +226,7 @@
                     if (interfaceType.isLocal()) {
                         throw (AccessLocalException)new AccessLocalException(exc.getMessage()).initCause(exc);
                     } else {
-                        throw new AccessException(exc.getMessage(), (Exception)exc);
+                        throw new AccessException(exc.getMessage()).initCause(exc);
                     }
                 }
 
@@ -238,13 +238,13 @@
             */
         } catch (org.apache.openejb.SystemException se) {
             if (interfaceType.isLocal()) {
-                throw new EJBException("Container has suffered a SystemException", (Exception)
se.getRootCause());
+                throw new EJBException("Container has suffered a SystemException").initCause(se.getRootCause());
             } else {
                 throw new RemoteException("Container has suffered a SystemException", se.getRootCause());
             }
         } catch (org.apache.openejb.OpenEJBException oe) {
             if (interfaceType.isLocal()) {
-                throw new EJBException("Unknown Container Exception", (Exception) oe.getRootCause());
+                throw new EJBException("Unknown Container Exception").initCause(oe.getRootCause());
             } else {
                 throw new RemoteException("Unknown Container Exception", oe.getRootCause());
             }



Mime
View raw message