<commit_before>package dk.br.mail;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.Serializable;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.util.*;
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.mail.*;
import javax.mail.internet.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * A serializable, transportable representation of an e-mail message. The <em>transportable</em>
 * part means that instances will never include references to "local" files or directories.
 *
 * @author     <NAME>
 * @since      21. november 2003
 */
public final class MailMessageData
     implements Serializable, MailMessageSource
{
  private final static Logger LOG = LoggerFactory.getLogger(MailMessageData.class);

  private static final long serialVersionUID = 3478570608187099960L;

  private final static String MIME_TYPE_HTML = "text/html";
  private final static String MIME_TYPE_PLAIN = "text/plain; charset=UTF-8; format=flowed";

  private InternetAddress m_sender;
  private InternetAddress m_bounceTo;
  private final List<InternetAddress> m_from = new LinkedList<InternetAddress>();
  private final List<InternetAddress> m_replyTo = new LinkedList<InternetAddress>();
  private final List<InternetAddress> m_recipientsTo = new LinkedList<InternetAddress>();
  private final List<InternetAddress> m_recipientsCc = new LinkedList<InternetAddress>();
  private final List<InternetAddress> m_recipientsBcc = new LinkedList<InternetAddress>();
  private String m_messageID;
  private Date m_sentDate = new Date();
  private String m_subject = "(no subject)";
  private String m_plainText;
  private String m_htmlText;
  private MailPartSource m_alternative;
  private final Map<String,MailPartSource> m_relatedBodyParts = new HashMap<String,MailPartSource>();
  private final Map<String,String> m_customHeaders = new HashMap<String,String>();
  private final List<MailPartSource> m_attachments = new LinkedList<MailPartSource>();

  @Override
  public void setCustomHeader(String name, String value)
  {
    m_customHeaders.put(name, value);
  }

  public void addReplyTo(InternetAddress addresses[])
  {
    m_replyTo.addAll(Arrays.asList(addresses));
  }

  public void addReplyTo(InternetAddress address)
  {
    m_replyTo.add(address);
  }

  public String getSubject()
  {
    return m_subject;
  }

  public void setSubject(String subject)
  {
    m_subject = subject;
  }

  public String getMessageID()
  {
    return m_messageID;
  }

  public void setMessageID(String messageID)
  {<commit_msg>Add for consistency and convenience<commit_after>package dk.br.mail;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.Serializable;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.util.*;
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.mail.*;
import javax.mail.internet.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * A serializable, transportable representation of an e-mail message. The <em>transportable</em>
 * part means that instances will never include references to "local" files or directories.
 *
 * @author     <NAME>
 * @since      21. november 2003
 */
public final class MailMessageData
     implements Serializable, MailMessageSource
{
  private final static Logger LOG = LoggerFactory.getLogger(MailMessageData.class);

  private static final long serialVersionUID = 3478570608187099960L;

  private final static String MIME_TYPE_HTML = "text/html";
  private final static String MIME_TYPE_PLAIN = "text/plain; charset=UTF-8; format=flowed";

  private InternetAddress m_sender;
  private InternetAddress m_bounceTo;
  private final List<InternetAddress> m_from = new LinkedList<InternetAddress>();
  private final List<InternetAddress> m_replyTo = new LinkedList<InternetAddress>();
  private final List<InternetAddress> m_recipientsTo = new LinkedList<InternetAddress>();
  private final List<InternetAddress> m_recipientsCc = new LinkedList<InternetAddress>();
  private final List<InternetAddress> m_recipientsBcc = new LinkedList<InternetAddress>();
  private String m_messageID;
  private Date m_sentDate = new Date();
  private String m_subject = "(no subject)";
  private String m_plainText;
  private String m_htmlText;
  private MailPartSource m_alternative;
  private final Map<String,MailPartSource> m_relatedBodyParts = new HashMap<String,MailPartSource>();
  private final Map<String,String> m_customHeaders = new HashMap<String,String>();
  private final List<MailPartSource> m_attachments = new LinkedList<MailPartSource>();

  @Override
  public void setCustomHeader(String name, String value)
  {
    m_customHeaders.put(name, value);
  }

  public void addReplyTo(InternetAddress addresses[])
  {
    m_replyTo.addAll(Arrays.asList(addresses));
  }

  public void addReplyTo(InternetAddress address)
  {
    m_replyTo.add(address);
  }

  public void addReplyTo(String name, String email)
  {
    addReplyTo(encodeAddress(name, email));
  }

  public String getSubject()
  {
    return m_subject;
  }

  public void setSubject(String subject)
  {
    m_subject = subject;
  }

  public String getMessageID()
  {
    return m_messageID;
  }

  public void setMessageID(String messageID)
  {
{'fraction_non_alphanumeric': 0.08860287259839582, 'fraction_numerical': 0.010445812348442454, 'mean_word_length': 5.206018518518518, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, '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': '3739767', 'n_tokens_mistral': 1619, 'n_tokens_neox': 1535, 'n_words': 418}