<commit_before>object Test extends App {
  val ns = (0 until 20)
  val arr = new Array[Int](10)

  def tryit(label: String, start: Int, len: Int): Unit = {
    val status = try {
      val it = ns.toIterator
      it.copyToArray(arr, start, len)
      "ok"
    } catch {
      case e: Exception => e.toString
    }
    println("%s: %s" format (label, status))
  }
<commit_msg>Fix test failure on Java 11<commit_after>object Test extends App {
  val ns = (0 until 20)
  val arr = new Array[Int](10)

  def tryit(label: String, start: Int, len: Int): Unit = {
    val status = try {
      val it = ns.toIterator
      it.copyToArray(arr, start, len)
      "ok"
    } catch {
      case e: ArrayIndexOutOfBoundsException =>
        // Special-case printing this exception because the toString changed in Java 11
        val java11toString = """java.lang.ArrayIndexOutOfBoundsException: Index (-?\d+).*""".r

        e.toString match {
          case java11toString(index) =>
            s"java.lang.ArrayIndexOutOfBoundsException: $index"
          case str =>
            str
        }
      case e: Exception => e.toString
    }
    println("%s: %s" format (label, status))
  }

{'fraction_non_alphanumeric': 0.12064570943075616, 'fraction_numerical': 0.015293118096856415, 'mean_word_length': 2.3850574712643677, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '7182660', 'n_tokens_mistral': 383, 'n_tokens_neox': 366, 'n_words': 115}