-------代码测试
// TODO: 2017/3/23 "" is empty
if (TextUtils.isEmpty(""))
Log.i(TAG, "fastJsonWithDiffFields: \"\" is empty");
// TODO: 2017/3/23 null is empty
if (TextUtils.isEmpty(null))
Log.i(TAG, "fastJsonWithDiffFields: null is empty");
// TODO: 2017/3/23 "" equals null
if (TextUtils.equals("", null)) {
Log.i(TAG, "fastJsonWithDiffFields: \"\" equals null");
} else {
Log.i(TAG, "fastJsonWithDiffFields:\"\" unequals null ");
}
String simpleName = "".getClass().getSimpleName();
Log.i(TAG, "fastJsonWithDiffFields: \"\" type = " + simpleName);
------ 测试结果
"" is empty
null is empty
"" unequals null
"" type = String