7187876: ClassCastException in TCPTransport.executeAcceptLoop
authordmocek
Thu, 02 Aug 2012 18:12:18 -0700
changeset 13408 7b1c9c089326
parent 13407 255287ecff85
child 13409 fe3ab27ef1a6
child 13555 fb41599cf196
7187876: ClassCastException in TCPTransport.executeAcceptLoop Reviewed-by: dholmes, smarks
jdk/src/share/classes/sun/rmi/transport/tcp/TCPTransport.java
--- a/jdk/src/share/classes/sun/rmi/transport/tcp/TCPTransport.java	Thu Aug 02 10:42:19 2012 -0400
+++ b/jdk/src/share/classes/sun/rmi/transport/tcp/TCPTransport.java	Thu Aug 02 18:12:18 2012 -0700
@@ -28,6 +28,7 @@
 import java.lang.ref.SoftReference;
 import java.lang.ref.WeakReference;
 import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.UndeclaredThrowableException;
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
@@ -462,8 +463,10 @@
                             return;
                         }
                         // continue loop
+                    } else if (t instanceof Error) {
+                        throw (Error) t;
                     } else {
-                        throw (Error) t;
+                        throw new UndeclaredThrowableException(t);
                     }
                 }
             }