[VIVO-1253] Merge pull request #46 from zednis/patch-2

update containsNullOrEmpty() to check if list is empty
This commit is contained in:
grahamtriggs 2016-06-28 22:29:35 +01:00 committed by GitHub
commit 55967c4326

View file

@ -11,6 +11,7 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@ -79,7 +80,11 @@ public class EditN3GeneratorVTwo {
} }
private boolean containsNullOrEmpty(List<String> values) { private boolean containsNullOrEmpty(List<String> values) {
return values != null && ( values.contains(null) || values.contains("") ); if(values == null || values.isEmpty()) return true ;
for(String str : values) {
if(StringUtils.isBlank(str)) return true ;
}
return false;
} }
/** /**