What is the most misleading method in the Java Base API? [closed]

The URL equals() method compares IP addresses, uses a network connection and is a blocking operation!

From the javadocs:

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.

Use URI instead.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)