RFR: 8343791: Socket.connect API should document whether the socket will be closed when hostname resolution fails or another error occurs [v26]

Volkan Yazıcı duke at openjdk.org
Mon Dec 2 08:07:48 UTC 2024


On Fri, 29 Nov 2024 15:40:47 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Volkan Yazıcı has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Improve Javadoc
>>  - Match `UHE` message in `Socket` and `SocketImpl`
>>    
>>    This discrepancy was causing following tests to fail:
>>    
>>    - javax/xml/jaxp/unittest/common/dtd/DOMTest.java
>>    - javax/xml/jaxp/unittest/common/dtd/SAXTest.java
>>    - javax/xml/jaxp/unittest/common/catalog/SAXTest.java
>>    - javax/xml/jaxp/unittest/common/catalog/DOMTest.java
>
> src/java.base/share/classes/java/net/Socket.java line 664:
> 
>> 662: 
>> 663:         if (epoint.isUnresolved()) {
>> 664:             var uhe = new UnknownHostException(epoint.getHostName());
> 
> In this instance, I believe reverting to the same message as was thrown before and reconciling Socket with SocketImpl is the right call. The change to the exception message was somewhat gratuitous. Since it makes several tests fail, let's avoid that.

Changed as requested.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/22160#discussion_r1865394939


More information about the net-dev mailing list