1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-25 16:01:38 +03:00

Replace String.isEmpty() calls with Java 5 methods

This commit is contained in:
Patrick Forhan
2013-05-10 09:31:16 -05:00
parent 3ba54eed34
commit 70e13c131c

View File

@@ -146,7 +146,8 @@ public final class OkHostnameVerifier implements HostnameVerifier {
* {@code *.android.com}.
*/
public boolean verifyHostName(String hostName, String cn) {
if (hostName == null || hostName.isEmpty() || cn == null || cn.isEmpty()) {
// Check length == 0 instead of .isEmpty() to support Java 5.
if (hostName == null || hostName.length() == 0 || cn == null || cn.length() == 0) {
return false;
}