5 ms·
I mean, I can see host resolution equivalence being a useful piece of functionality. I could even see it being built-in to a std URL library. Just, y'know... no
by lmkg 7y ago
I mean, I can see host resolution equivalence being a useful piece of functionality. I could even see it being built-in to a std URL library. Just, y'know... not as the default equality operator.
And yes, I know that overriding .equals() does not change the behavior of == in Java. But I would still consider .equals() to be the "default" equality operator for objects.
- BenjiWiebe 7y agoThanks to virtual hosting (which is extremely common) host resolution is actively harmful to URL comparison.
- jefftk 7y ago> Thanks to virtual hosting (which is extremely common) It's extremely common now, but it wasn't possible yet when they made this design decision.
- pdw 7y agoI'm pretty sure the specification of this class predates name-based virtual hosting. After all, that only appeared in 1997, or perhaps late 1996, and it took a couple of years to be standardized. The URL class existed in Java in 1995 :) (Edit: And really, virtual hosts are an extremely weird HTTP feature. What other internet protocol cares about what domain name you used to establish a connection?)
- merb 7y ago> (Edit: And really, virtual hosts are an extremely weird HTTP feature. What other internet protocol cares about what domain name you used to establish a connection?) kerberos? (btw. this is older than 1995) or smtp (little bit different than the http version, tough)