[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.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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue