<commit_before>package org.smoothbuild.util;

import java.io.PrintWriter;
import java.io.StringWriter;

public class Throwables {
  public static RuntimeException unexpectedCaseExc(Object object) {
    return new RuntimeException(messageFor(object));
  }

  private static String messageFor(Object object) {
    return switch (object) {
      case null -> "Unexpected case. object=null.";
      case Object o -> "Unexpected case. object=" + o + " class=" + o.getClass().getCanonicalName();
    };
  }

  public static String stackTraceToString(Throwable throwable) {
    StringWriter stringWriter = new StringWriter();
    throwable.printStackTrace(new PrintWriter(stringWriter));
    return stringWriter.toString();
  }
}
<commit_msg>improved message in Throwables.unexpectedCase()<commit_after>package org.smoothbuild.util;

import java.io.PrintWriter;
import java.io.StringWriter;

public class Throwables {
  public static RuntimeException unexpectedCaseExc(Object object) {
    return new RuntimeException(messageFor(object));
  }

  private static String messageFor(Object object) {
    return switch (object) {
      case null -> "Unexpected case. object=null.";
      case Object o -> "Unexpected case.\nobject=" + o + "\nclass=" + o.getClass().getCanonicalName();
    };
  }

  public static String stackTraceToString(Throwable throwable) {
    StringWriter stringWriter = new StringWriter();
    throwable.printStackTrace(new PrintWriter(stringWriter));
    return stringWriter.toString();
  }
}

{'fraction_non_alphanumeric': 0.10557768924302789, 'fraction_numerical': 0.0, 'mean_word_length': 4.44043321299639, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '129735', 'n_tokens_mistral': 406, 'n_tokens_neox': 400, 'n_words': 106}