<commit_before>package com.indexdata.mkjsf.pazpar2.data;

import com.indexdata.mkjsf.pazpar2.data.ResponseDataObject;

/**
 * Data from the <code>show</code> command, child object of Hit
 * 
 * @author <NAME>
 *
 */
public class Location extends ResponseDataObject {
    
  private static final long serialVersionUID = -1386527442857478225L;
  private int seqno = -1;
  
  public String getId() {
    return getAttribute("id");
  }
  
  public String getChecksum() {
    logger.debug("Request to get checksum");
    return getAttribute("checksum"); 
  }
    
  public String getName () {
    return getAttribute("name");
  }
  
  public String getSubject() {
    return getOneValue("md-subject");
  }
  
  public void setSequenceNumber(int num) {
    seqno = num;
  }
  
  public int getSequenceNumber () {
    return seqno;
  }
  
  public String getSubjects() {
    StringBuilder builder = new StringBuilder("");
    for (ResponseDataObject data : getElements("md-subject")) {
      if (builder.length()==0) {
        builder.append(data.getValue());
      } else {
        builder.append(", ");
        builder.append(data.getValue());
      }
    }
    return builder.toString();
  }

  public String getAuthor() {
    return getOneValue("md-author");
  }
  
  public String getAuthors() {
    StringBuilder builder = new StringBuilder("");
    if (getElements("md-author") != null) {
      for (ResponseDataObject data : getElements("md-author")) {
        if (builder.length()==0) {
          builder.append(data.getValue());
        } else {
          builder.append(", ");
          builder.append(data.getValue());
        }
      }
    }
    return builder.toString();
  }
  
}
<commit_msg>Fixes npe when no subjects in location<commit_after>package com.indexdata.mkjsf.pazpar2.data;

import com.indexdata.mkjsf.pazpar2.data.ResponseDataObject;

/**
 * Data from the <code>show</code> command, child object of Hit
 * 
 * @author <NAME>
 *
 */
public class Location extends ResponseDataObject {
    
  private static final long serialVersionUID = -1386527442857478225L;
  private int seqno = -1;
  
  public String getId() {
    return getAttribute("id");
  }
  
  public String getChecksum() {
    logger.debug("Request to get checksum");
    return getAttribute("checksum"); 
  }
    
  public String getName () {
    return getAttribute("name");
  }
  
  public String getSubject() {
    return getOneValue("md-subject");
  }
  
  public void setSequenceNumber(int num) {
    seqno = num;
  }
  
  public int getSequenceNumber () {
    return seqno;
  }
  
  public String getSubjects() {
    StringBuilder builder = new StringBuilder("");
    if (getElements("md-subject") != null) {
      for (ResponseDataObject data : getElements("md-subject")) {
        if (builder.length()==0) {
          builder.append(data.getValue());
        } else {
          builder.append(", ");
          builder.append(data.getValue());
        }
      }
    }
    return builder.toString();
  }

  public String getAuthor() {
    return getOneValue("md-author");
  }
  
  public String getAuthors() {
    StringBuilder builder = new StringBuilder("");
    if (getElements("md-author") != null) {
      for (ResponseDataObject data : getElements("md-author")) {
        if (builder.length()==0) {
          builder.append(data.getValue());
        } else {
          builder.append(", ");
          builder.append(data.getValue());
        }
      }
    }
    return builder.toString();
  }
  
}

{'fraction_non_alphanumeric': 0.12774725274725274, 'fraction_numerical': 0.013186813186813187, 'mean_word_length': 2.3342490842490844, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '935516', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1061, 'n_words': 231}