package com.ctrip.framework.foundation.internals;

public class Utils {
  public static boolean isBlank(String str) {
    if (str == null || str.length() == 0) {
      return true;
    }

    int length = str.length();
    for (int i = 0; i < length; i++) {
      char ch = str.charAt(i);

      if (!Character.isWhitespace(ch)) {
        return false;
      }
    }
    return true;
  }

  public static boolean isOSWindows() {
    String osName = System.getProperty("os.name");
    if (Utils.isBlank(osName)) {
      return false;
    }
    return osName.startsWith("Windows");
  }
}

@@ -44,16 +44,56 @@
 rnals;%0A%0A
+import com.google.common.base.Strings;%0A%0A
 public c
@@ -155,54 +155,8 @@
 ) %7B%0A
-    if (str == null %7C%7C str.length() == 0) %7B%0A  
     
@@ -166,215 +166,49 @@
 urn 
+S
 tr
-ue;%0A    %7D%0A%0A    int length = str.length();%0A    for (int i = 0; i %3C length; i++) %7B%0A      char ch = str.charAt(i);%0A%0A      if (!Character.isWhitespace(ch)) %7B%0A        return false;%0A      %7D%0A    %7D%0A    return true
+ings.nullToEmpty(str).trim().isEmpty()
 ;%0A  

clean code for isBlank