<commit_before>package org.smoothbuild.lang.message;

import com.google.common.base.Throwables;

public class Message extends RuntimeException {
  protected Message(String message) {
    super(message);
  }

  public final boolean equals(Object object) {
    if (object instanceof Message) {
      Message that = (Message) object;
      return this.getClass().equals(that.getClass()) && getMessage().equals(that.getMessage());
    }
    return false;
  }

  public final int hashCode() {
    return getClass().hashCode() + 17 * getMessage().hashCode();
  }

  public String toString() {
    return name() + ": " + getMessage() + stackTrace();
  }

  private String name() {
    if (this instanceof ErrorMessage) {
      return "ERROR";
    } else if (this instanceof WarningMessage) {
      return "WARNING";
    } else if (this instanceof InfoMessage) {
      return "INFO";
    } else {
      throw new RuntimeException("Unknown message type: " + getClass().getCanonicalName());
    }
  }

  private String stackTrace() {
    Throwable cause = getCause();
    if (cause == null) {
      return "";
    } else {
      return "\n" + Throwables.getStackTraceAsString(cause);
    }
  }
}<commit_msg>Message not contain java stack trace<commit_after>package org.smoothbuild.lang.message;

public class Message extends RuntimeException {
  protected Message(String message) {
    super(message);
  }

  public final boolean equals(Object object) {
    if (object instanceof Message) {
      Message that = (Message) object;
      return this.getClass().equals(that.getClass()) && getMessage().equals(that.getMessage());
    }
    return false;
  }

  public final int hashCode() {
    return getClass().hashCode() + 17 * getMessage().hashCode();
  }

  public String toString() {
    return name() + ": " + getMessage();
  }

  private String name() {
    if (this instanceof ErrorMessage) {
      return "ERROR";
    } else if (this instanceof WarningMessage) {
      return "WARNING";
    } else if (this instanceof InfoMessage) {
      return "INFO";
    } else {
      throw new RuntimeException("Unknown message type: " + getClass().getCanonicalName());
    }
  }
}
{'fraction_non_alphanumeric': 0.1260387811634349, 'fraction_numerical': 0.0018467220683287165, 'mean_word_length': 3.2159533073929962, 'pattern_counts': {'":': 2, '<': 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': '1368038', 'n_tokens_mistral': 610, 'n_tokens_neox': 596, 'n_words': 168}