RFR: 8282395: URL.openConnection can throw IOOBE [v3]

Daniel Fuchs dfuchs at openjdk.org
Thu Sep 29 10:28:36 UTC 2022


On Thu, 29 Sep 2022 10:23:57 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> The constructor "MalformedURLException (Throwable cause)" doens'nt exist. Isn't there any other method?
>
> You can use `Throwable::initCause`

var mfue = new MalformedURLException(e.getMessage());
mfue.initCause(e);
throw mfue;

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

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


More information about the net-dev mailing list