http://docs.oracle.com/javase/1.5.0/docs/api/java/net/URL.html#equals(java.lang.Object)
Compares this URL for equality with another object.
If the given object is not a URL then this method immediately returns false.
Two URL objects are equal if they have the same protocol, reference equivalent hosts, have the same port number on the host, and the same file and fragment of the file.
Two hosts are considered equivalent if both host names can be resolved into the same IP addresses; else if either host name can't be resolved, the host names must be equal without regard to case; or both host names equal to null.
Since hosts comparison requires name resolution, this operation is a blocking operation.
Note: The defined behavior for equals is known to be inconsistent with virtual hosting in HTTP.
아침에 http://staging.krakenapps.org/와 http://download.krakenapps.org/ 가 equal로 나와서 코드가 망하는 바람에 찾아봤는데 아 이런 충격과 공포의 그지 깽깽이 썬 놈들아.... 시키지도 않은 IP 매칭하지마..
ps. 코드 다 고쳐야 됨 (...)




덧글
scynuri 2011/12/16 14:05 # 답글
ㄷㄷㄷㄷ 저게 좀 오래된 issue라지(...)
에디 2011/12/16 21:34 # 삭제 답글
병맛 돋네
Kevin 2011/12/17 01:35 # 삭제 답글
수년전쯤 Joshua Bloch 이 URL의 equals는 IP 비교해서 제대로 동작 안 하니까가능하면 URL 대신에 URI 쓰라고 말한적이 있습니다. :)
저도 수업 시간에 JDK에 있는 그지같이 만든 API의 예로 JAXP와 함께
주로 이녀석을 예로 듭니다... :)