felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r1092815 - in /felix/trunk/framework/src/main/java/org/apache/felix/framework: Felix.java URLHandlersStreamHandlerProxy.java
Date Fri, 15 Apr 2011 21:19:56 GMT
Author: rickhall
Date: Fri Apr 15 21:19:55 2011
New Revision: 1092815

URL: http://svn.apache.org/viewvc?rev=1092815&view=rev
Log:
Avoid using exception constructors with causal exception. (FELIX-2917)

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
    felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersStreamHandlerProxy.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java?rev=1092815&r1=1092814&r2=1092815&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java Fri Apr 15 21:19:55
2011
@@ -557,7 +557,9 @@ public class Felix extends BundleImpl im
                                 }
                                 catch (AccessControlException ex)
                                 {
-                                    throw new SecurityException(ex);
+                                    SecurityException se = new SecurityException(ex.getMessage());
+                                    se.initCause(ex);
+                                    throw se;
                                 }
                             }
                         });
@@ -571,7 +573,11 @@ public class Felix extends BundleImpl im
                         } 
                         catch (Throwable t)
                         {
-                            throw new SecurityException("Unable to install custom SecurityManager:
" + security, t); 
+                            SecurityException se =
+                                new SecurityException(
+                                    "Unable to install custom SecurityManager: " + security);
+                            se.initCause(t);
+                            throw se;
                         }
                     }
                 }

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersStreamHandlerProxy.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersStreamHandlerProxy.java?rev=1092815&r1=1092814&r2=1092815&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersStreamHandlerProxy.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersStreamHandlerProxy.java
Fri Apr 15 21:19:55 2011
@@ -328,7 +328,9 @@ public class URLHandlersStreamHandlerPro
             } 
             catch (NoSuchMethodException e) 
             {
-                throw new UnsupportedOperationException(e);
+                RuntimeException rte = new UnsupportedOperationException(e.getMessage());
+                rte.initCause(e);
+                throw rte;
             }
             try 
             {



Mime
View raw message