Skip to content

Commit

Permalink
Replace String.isEmpty() calls with Java 5 methods
Browse files Browse the repository at this point in the history
  • Loading branch information
pforhan committed May 10, 2013
1 parent 3ba54ee commit 70e13c1
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 70e13c1

Please sign in to comment.