RFR: 8299827: Add resolved IP address in connection exception for sockets [v2]

Jaikiran Pai jpai at openjdk.org
Wed Jan 18 06:49:20 UTC 2023


On Mon, 16 Jan 2023 09:30:17 GMT, Ralf Schmelter <rschmelter at openjdk.org> wrote:

>> Yes, and can reduced further with String.join
>> 
>> return create(e, String.join(": ", e.getMessage(), addr.toString()));
>
> Cool, that's really short. I've updated the PR.

Hello @schmelter-sap, The javadoc of `String.join` states that it can throw a `NullPointerException` if any of the elements in `null`. As far as I can see, the `IOException` that may get thrown, probably isn't guaranteed to have a exception message, in which case this will run into a `NullPointerException`. Perhaps we should guard this code against that possibility?

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

PR: https://git.openjdk.org/jdk/pull/11961


More information about the net-dev mailing list