与通常的if (myString == null || myString.equals(""))不同,我倾向于使用org.apache.commons.lang.StringUtils类并执行if (StringUtils.isEmpty从Eclipse -将不再看到显式空-检查,它将不再认为myString可能为空,因此它将不再引发关于潜在(或确定)空指针的警告,在我看来这些警告是非常有用的。access: The variable myString may be null at this location"