7187876: ClassCastException in TCPTransport.executeAcceptLoop
Reviewed-by: dholmes, smarks
--- 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);
}
}
}