[VIVO-1253] Merge pull request #46 from zednis/patch-2
update containsNullOrEmpty() to check if list is empty
This commit is contained in:
commit
55967c4326
1 changed files with 7 additions and 2 deletions
|
@ -11,6 +11,7 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
@ -78,8 +79,12 @@ public class EditN3GeneratorVTwo {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean containsNullOrEmpty(List<String> values) {
|
||||
return values != null && ( values.contains(null) || values.contains("") );
|
||||
private boolean containsNullOrEmpty(List<String> values) {
|
||||
if(values == null || values.isEmpty()) return true ;
|
||||
for(String str : values) {
|
||||
if(StringUtils.isBlank(str)) return true ;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue