changeset 9699:2fbac715046f

8047186: jdk.net.Sockets throws InvocationTargetException instead of original runtime exceptions Reviewed-by: michaelm Contributed-by: artem.smotrakov@oracle.com
author michaelm
date Tue, 24 Jun 2014 11:32:10 +0100
parents 3258ec1855ef
children 23dc39c8a60c
files src/share/classes/jdk/net/Sockets.java
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/jdk/net/Sockets.java	Fri Jun 20 10:10:27 2014 -0700
+++ b/src/share/classes/jdk/net/Sockets.java	Tue Jun 24 11:32:10 2014 +0100
@@ -119,6 +119,8 @@
                 Throwable t = ((InvocationTargetException)e).getTargetException();
                 if (t instanceof IOException) {
                     throw (IOException)t;
+                } else if (t instanceof RuntimeException) {
+                    throw (RuntimeException)t;
                 }
             }
             throw new RuntimeException(e);
@@ -135,6 +137,8 @@
                 Throwable t = ((InvocationTargetException)e).getTargetException();
                 if (t instanceof IOException) {
                     throw (IOException)t;
+                } else if (t instanceof RuntimeException) {
+                    throw (RuntimeException)t;
                 }
             }
             throw new RuntimeException(e);