Skip to content

Commit

Permalink
Merge pull request square#186 from square/pforhan/java5
Browse files Browse the repository at this point in the history
Replace String.isEmpty() calls with Java 5 methods
  • Loading branch information
JakeWharton committed May 10, 2013
2 parents 3ba54ee + 70e13c1 commit 8f586ba
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ private List<String> getSubjectAltNames(X509Certificate certificate, int type) {
* {@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;
}

Expand Down

0 comments on commit 8f586ba

Please sign in to comment.