RFR: 8282395: URL.openConnection can throw IOOBE [v3]
Daniel Fuchs
dfuchs at openjdk.org
Thu Sep 29 10:28:35 UTC 2022
On Thu, 29 Sep 2022 09:55:17 GMT, KIRIYAMA Takuya <duke at openjdk.org> wrote:
>> src/java.base/share/classes/sun/net/www/protocol/ftp/Handler.java line 66:
>>
>>> 64: connection = new FtpURLConnection(u, p);
>>> 65: } catch (IllegalArgumentException e) {
>>> 66: throw new MalformedURLException(e.getMessage());
>>
>> I'd suggest keeping the IllegalArgumentException as the root cause of the MUE for better diagnosability. Otherwise LGTM.
>
> The constructor "MalformedURLException (Throwable cause)" doens'nt exist. Isn't there any other method?
You can use `Throwable::initCause`
-------------
PR: https://git.openjdk.org/jdk/pull/8155
More information about the net-dev
mailing list