RFR: 8294241: Deprecate URL public constructors

Daniel Fuchs daniel.fuchs at oracle.com
Thu Oct 27 11:29:45 UTC 2022


On 27/10/2022 07:26, Alan Bateman wrote:
>> We have a strict URI 3986 implementation, which we use to create all 
>> URL instances from.

Note also that though this change proposes to deprecate these
constructors in order to provide a stronger warning against their
potential misuse, it does not deprecate them for removal.

If you are confident in your parsing/validation you can of course
still provide a `URL toURL(org.apache.river.api.net.URI)` method that
calls a constructor, and annotate that one place with 
`@SuppressWarnings("deprecation")`.

best regards,

-- dabniel



More information about the net-dev mailing list