commit | d4e10c659fbf5143d46b9e1a6c5596fb8343c611 | [log] [tgz] |
---|---|---|
author | Richard S. Hall <rickhall@apache.org> | Fri Apr 15 21:19:55 2011 +0000 |
committer | Richard S. Hall <rickhall@apache.org> | Fri Apr 15 21:19:55 2011 +0000 |
tree | 30eb988bad325ec9289bc72c7a74be62dfe5ae74 | |
parent | 4e7b05294cda86197ff38f50b152511ef6f136ca [diff] |
Avoid using exception constructors with causal exception. (FELIX-2917) git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1092815 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/Felix.java b/framework/src/main/java/org/apache/felix/framework/Felix.java index 15aecd6..6062f97 100644 --- a/framework/src/main/java/org/apache/felix/framework/Felix.java +++ b/framework/src/main/java/org/apache/felix/framework/Felix.java
@@ -557,7 +557,9 @@ } catch (AccessControlException ex) { - throw new SecurityException(ex); + SecurityException se = new SecurityException(ex.getMessage()); + se.initCause(ex); + throw se; } } }); @@ -571,7 +573,11 @@ } 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; } } }
diff --git a/framework/src/main/java/org/apache/felix/framework/URLHandlersStreamHandlerProxy.java b/framework/src/main/java/org/apache/felix/framework/URLHandlersStreamHandlerProxy.java index 4278762..debd1fb 100644 --- a/framework/src/main/java/org/apache/felix/framework/URLHandlersStreamHandlerProxy.java +++ b/framework/src/main/java/org/apache/felix/framework/URLHandlersStreamHandlerProxy.java
@@ -328,7 +328,9 @@ } catch (NoSuchMethodException e) { - throw new UnsupportedOperationException(e); + RuntimeException rte = new UnsupportedOperationException(e.getMessage()); + rte.initCause(e); + throw rte; } try {