mirror of
https://github.com/square/okhttp.git
synced 2026-01-25 16:01:38 +03:00
Merge pull request #186 from square/pforhan/java5
Replace String.isEmpty() calls with Java 5 methods
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user