AsynchronousSocketChannel still throws unspecified exception

Alan Bateman Alan.Bateman at oracle.com
Mon Jun 13 13:27:27 PDT 2011


cowwoc wrote:
> Hi Alan,
>
> Remember in http://web.archiveorange.com/archive/v/gpYtBJmUMNrbuF39jKmu we
> discussed that read() should throw a specific exception
> (IllegalStateException) instead of "an unspecified runtime exception"? You
> mentioned you would resolve this but it doesn't seem to have happened in the
> past couple of months. Now, with the JDK7 API being officially "frozen" I'm
> worried this will never make it in.
>
> Is this change going in?
>   
Ah boo, I did say we should change this to an IllegalStateException but 
it didn't happen. My fault. As it's not a critical/showstopper issue 
then there is little chance that we have fix this now. This means we'll 
have to re-examine it in 8. It helps that the implementation already 
throws IllegalStateException for this case and so compatibility risk is 
confined to other AsynchronousChannel implementations (likely to be 
few).  As I recall you ran into this with a serial port channel where 
data loss was acceptable or you could guarantee that no data would be 
loss, in which case you may already have specified your channel differently.

-Alan.


More information about the nio-dev mailing list