changeset 6087:92c7d1df9851

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