Code Review Request 7187876: ClassCastException in TCPTransport.executeAcceptLoop

David Holmes david.holmes at oracle.com
Mon Jul 30 23:43:07 UTC 2012


Hi Darryl,

On 31/07/2012 8:27 AM, Darryl Mocek wrote:
> Hello core-libs. Please review this webrev to fix Bug #7187876. Webrev
> can be found here: http://cr.openjdk.java.net/~dmocek/7187876/webrev.00.
>
> The rmi/transport/acceptLoop/CloseServerSocketOnTermination.java test
> throws ClassCastException due to the Throwable not being of type Error
> in TCPTransport.

Just wondering what type it was? Something that extends Throwable directly?

This:

throw new Error(t.getMessage(), t.getCause());

loses the type of exception that was thrown. It is better to use:

throw new Error(t);

Cheers,
David

> Thanks,
> Darryl



More information about the core-libs-dev mailing list