RFR: 8299827: Add resolved IP address in connection exception for sockets [v2]
Alan Bateman
alanb at openjdk.org
Sat Jan 14 08:13:10 UTC 2023
On Sat, 14 Jan 2023 05:12:08 GMT, Vyom Tewari <vtewari at openjdk.org> wrote:
>> Ralf Schmelter has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Simplified code
>
> src/java.base/share/classes/sun/net/util/SocketExceptions.java line 75:
>
>> 73: sb.append(": ");
>> 74: sb.append(addr.toString());
>> 75: String enhancedMsg = sb.toString();
>
> do you need extra "enhancedMsg" ? you can directly use "return create(e, sb.toString());"
Yes, and can reduced further with String.join
return create(e, String.join(": ", e.getMessage(), addr.toString()));
-------------
PR: https://git.openjdk.org/jdk/pull/11961
More information about the net-dev
mailing list