changeset 7404:e036c254ef30

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 f40d035e338d
children 75dceeafa4c8
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 Aug 22 16:10:50 2014 +0100
+++ b/src/share/classes/jdk/net/Sockets.java	Tue Jun 24 11:32:10 2014 +0100
@@ -118,6 +118,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);
@@ -134,6 +136,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);