<commit_before>package com.inmobi.messaging;

import java.nio.ByteBuffer;

/**
 *  Message class holding the data.
 *
 */
public final class Message {

  private ByteBuffer data;

  public Message() {
  }

  /**
   * Create new message with {@link ByteBuffer}
   * 
   * @param data The {@link ByteBuffer}
   */
  public Message(ByteBuffer data) {
    this.data = data;
  }

  /**
   * Create new message with byte array
   * 
   * @param data The byte array.
   */
  public Message(byte[] data) {
    this.data = ByteBuffer.wrap(data);
  }

  /**
   * Get the data associated with message.
   * 
   * @return {@link ByteBuffer} holding the data.
   */
  public ByteBuffer getData() {
    return data;
  }

  public void set(ByteBuffer data) {
    this.data = data;
  }

  public void clear() {
    data.clear();
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((data == null) ? 0 : data.hashCode());
    return result;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
      return false;
    if (getClass() != obj.getClass())
      return false;
    Message other = (Message) obj;
    if (data == null) {
      if (other.data != null)
        return false;
    } else if (!data.equals(other.data))
      return false;
    return true;
  }<commit_msg>make message setters synchronized<commit_after>package com.inmobi.messaging;

import java.nio.ByteBuffer;

/**
 *  Message class holding the data.
 *
 */
public final class Message {

  private ByteBuffer data;

  public Message() {
  }

  /**
   * Create new message with {@link ByteBuffer}
   * 
   * @param data The {@link ByteBuffer}
   */
  public Message(ByteBuffer data) {
    this.data = data;
  }

  /**
   * Create new message with byte array
   * 
   * @param data The byte array.
   */
  public Message(byte[] data) {
    this.data = ByteBuffer.wrap(data);
  }

  /**
   * Get the data associated with message.
   * 
   * @return {@link ByteBuffer} holding the data.
   */
  public ByteBuffer getData() {
    return data;
  }

  public synchronized void set(ByteBuffer data) {
    this.data = data;
  }

  public synchronized void clear() {
    data.clear();
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((data == null) ? 0 : data.hashCode());
    return result;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
      return false;
    if (getClass() != obj.getClass())
      return false;
    Message other = (Message) obj;
    if (data == null) {
      if (other.data != null)
        return false;
    } else if (!data.equals(other.data))
      return false;
    return true;
  }
{'fraction_non_alphanumeric': 0.12464589235127478, 'fraction_numerical': 0.0028328611898017, 'mean_word_length': 2.3711217183770885, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6648405', 'n_tokens_mistral': 911, 'n_tokens_neox': 879, 'n_words': 277}