changeset 13408:7b1c9c089326

7187876: ClassCastException in TCPTransport.executeAcceptLoop Reviewed-by: dholmes, smarks
author dmocek
date Thu, 02 Aug 2012 18:12:18 -0700
parents 255287ecff85
children fe3ab27ef1a6 fb41599cf196
files jdk/src/share/classes/sun/rmi/transport/tcp/TCPTransport.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);
                     }
                 }
             }