The java.net.http package description has a blanket statement indicating that "Unless otherwise stated, null parameter values will cause methods of all classes in this package to throw NullPointerException.". The message passed to the constructor of HttpTimeoutException and HttpConnectTimeoutException can be null, but the API documentation doesn't explicitly say so.