4 ms·
> URL was deprecated in favor of URI before some of you were born. It hasn't been deprecated, it's still in use in the standard library[1][2][3] and they don't
by ben509 7y ago
> URL was deprecated in favor of URI before some of you were born.
It hasn't been deprecated, it's still in use in the standard library[1][2][3] and they don't offer additional classes that accept URIs.
> Easy to be a harsh judge now but back when java was first developed...
They've made no effort over 11 major versions to diminish its use beyond a brief note that encoding is easier with URIs. There's not even a warning on the equals or hashCode method, let alone the class documentation, it just quietly mentions that it's resolving a name. There's no way people are finding out that you should avoid URL except through lore.
[1]: https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/net/URLClassLoader.html https://docs.oracle.com/en/java/javase/12/docs/api/java.base...
[2]: https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/net/URLStreamHandler.html https://docs.oracle.com/en/java/javase/12/docs/api/java.base...
[3]: https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/net/URLConnection.html https://docs.oracle.com/en/java/javase/12/docs/api/java.base...