Bug 111227 - java.net should not throw NotYetConnectedException
Summary: java.net should not throw NotYetConnectedException
Status: UNCONFIRMED
Alias: None
Product: classpath
Classification: Unclassified
Component: classpath (show other bugs)
Version: 0.99
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-29 14:03 UTC by Guillermo Rodriguez
Modified: 2023-08-29 14:03 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guillermo Rodriguez 2023-08-29 14:03:24 UTC
In addition to the fact that the isConnected check is probably wrong (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52135), if the socket is really not connected, this should not result in a NotYetConnectedException for java.net. NotYetConnectedException was introduced with java.nio and is an unchecked exception, and thus probably not expected by code using java.net.

A SocketException should be used in this case instead.