<commit_before>/*
 * Scala.js (https://www.scala-js.org/)
 *
 * Copyright EPFL.
 *
 * Licensed under Apache License 2.0
 * (https://www.apache.org/licenses/LICENSE-2.0).
 *
 * See the NOTICE file distributed with this work for
 * additional information regarding copyright ownership.
 */

package java.io

class BufferedReader(in: Reader, sz: Int) extends Reader {

  def this(in: Reader) = this(in, 4096)

  private[this] var buf = new Array[Char](sz)

  /** Last valid value in the buffer (exclusive) */
  private[this] var end = 0

  /** Next position to read from buffer */
  private[this] var pos = 0

  private[this] var closed = false

  private[this] var validMark = false

  override def close(): Unit = {
    if (!closed) {
      closed = true
      in.close()
    }
  }

  override def mark(readAheadLimit: Int): Unit = {
    if (readAheadLimit < 0)
      throw new IllegalArgumentException("Read-ahead limit < 0")<commit_msg>Work around a Scala 2.11 compiler crash with -no-specialization.<commit_after>/*
 * Scala.js (https://www.scala-js.org/)
 *
 * Copyright EPFL.
 *
 * Licensed under Apache License 2.0
 * (https://www.apache.org/licenses/LICENSE-2.0).
 *
 * See the NOTICE file distributed with this work for
 * additional information regarding copyright ownership.
 */

package java.io

class BufferedReader(in: Reader, sz: Int) extends Reader {

  def this(in: Reader) = this(in, 4096)

  // Workaround 2.11 with no-specialization ; buf should be initialized on the same line
  private[this] var buf: Array[Char] = null
  buf = new Array[Char](sz)

  /** Last valid value in the buffer (exclusive) */
  private[this] var end = 0

  /** Next position to read from buffer */
  private[this] var pos = 0

  private[this] var closed = false

  private[this] var validMark = false

  override def close(): Unit = {
    if (!closed) {
      closed = true
      in.close()
    }
  }

  override def mark(readAheadLimit: Int): Unit = {
    if (readAheadLimit < 0)
      throw new IllegalArgumentException("Read-ahead limit < 0")
{'fraction_non_alphanumeric': 0.12009803921568628, 'fraction_numerical': 0.014705882352941176, 'mean_word_length': 3.173824130879346, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, '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': '2135879', 'n_tokens_mistral': 660, 'n_tokens_neox': 613, 'n_words': 212}