Fix deprecation of ObjectUtils.toString

This commit is contained in:
Tim Donohue
2020-02-10 11:43:44 -06:00
parent 3ae9009dbd
commit db09a70d8f

View File

@@ -11,8 +11,8 @@ import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.solr.common.SolrDocument; import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrInputDocument; import org.apache.solr.common.SolrInputDocument;
@@ -140,8 +140,8 @@ public class PersonAuthorityValue extends AuthorityValue {
@Override @Override
public void setValues(SolrDocument document) { public void setValues(SolrDocument document) {
super.setValues(document); super.setValues(document);
this.firstName = ObjectUtils.toString(document.getFieldValue("first_name")); this.firstName = Objects.toString(document.getFieldValue("first_name"));
this.lastName = ObjectUtils.toString(document.getFieldValue("last_name")); this.lastName = Objects.toString(document.getFieldValue("last_name"));
nameVariants = new ArrayList<String>(); nameVariants = new ArrayList<String>();
Collection<Object> document_name_variant = document.getFieldValues("name_variant"); Collection<Object> document_name_variant = document.getFieldValues("name_variant");
if (document_name_variant != null) { if (document_name_variant != null) {