<commit_before>package coursier.cache

import java.io.{Serializable => _, _}
import java.math.BigInteger
import java.net.{HttpURLConnection, URLConnection}
import java.nio.charset.StandardCharsets.UTF_8
import java.nio.file.{Files, StandardCopyOption}
import java.security.MessageDigest
import java.util.concurrent.ExecutorService

import coursier.cache.internal.FileUtil
import coursier.core.{Artifact, Authentication, Repository}
import coursier.paths.CachePath
import coursier.util.{EitherT, Sync, Task}

import scala.annotation.tailrec
import scala.concurrent.ExecutionContext
import scala.concurrent.duration.Duration
import scala.util.control.NonFatal

final class FileCache[F[_]](private val params: FileCache.Params[F]) extends Cache[F] {

  def location: File = params.location
  def cachePolicies: Seq[CachePolicy] = params.cachePolicies
  def checksums: Seq[Option[String]] = params.checksums
  def logger: CacheLogger = params.logger
  def pool: ExecutorService = params.pool
  def ttl: Option[Duration] = params.ttl
  def localArtifactsShouldBeCached: Boolean = params.localArtifactsShouldBeCached
  def followHttpToHttpsRedirections: Boolean = params.followHttpToHttpsRedirections
  def sslRetry: Int = params.sslRetry
  def retry: Int = params.retry
  def bufferSize: Int = params.bufferSize
  def S: Sync[F] = params.S

  private def withParams[G[_]](params: FileCache.Params[G]): FileCache[G] =
    new FileCache(params)

  def withLocation(location: File): FileCache[F] =
    withParams(params.copy(location = location))
  def withLocation(location: String): FileCache[F] =
    withLocation(new File(location))
  def withCachePolicies(cachePolicies: Seq[CachePolicy]): FileCache[F] =
    withParams(params.copy(cachePolicies = cachePolicies))
  def withChecksums(checksums: Seq[Option[String]]): FileCache[F] =
    withParams(params.copy(checksums = checksums))
  def withLogger(logger: CacheLogger): FileCache[F] =<commit_msg>Add missing equals / hashCode / toString overrides in FileCache (#1090)<commit_after>package coursier.cache

import java.io.{Serializable => _, _}
import java.math.BigInteger
import java.net.{HttpURLConnection, URLConnection}
import java.nio.charset.StandardCharsets.UTF_8
import java.nio.file.{Files, StandardCopyOption}
import java.security.MessageDigest
import java.util.concurrent.ExecutorService

import coursier.cache.internal.FileUtil
import coursier.core.{Artifact, Authentication, Repository}
import coursier.paths.CachePath
import coursier.util.{EitherT, Sync, Task}

import scala.annotation.tailrec
import scala.concurrent.ExecutionContext
import scala.concurrent.duration.Duration
import scala.util.control.NonFatal

final class FileCache[F[_]](private val params: FileCache.Params[F]) extends Cache[F] {

  override def equals(obj: Any): Boolean =
    obj match {
      case other: FileCache[_] =>
        params == other.params
      case _ => false
    }

  override def hashCode(): Int =
    17 + params.##

  override def toString: String =
    s"FileCache($params)"


  def location: File = params.location
  def cachePolicies: Seq[CachePolicy] = params.cachePolicies
  def checksums: Seq[Option[String]] = params.checksums
  def logger: CacheLogger = params.logger
  def pool: ExecutorService = params.pool
  def ttl: Option[Duration] = params.ttl
  def localArtifactsShouldBeCached: Boolean = params.localArtifactsShouldBeCached
  def followHttpToHttpsRedirections: Boolean = params.followHttpToHttpsRedirections
  def sslRetry: Int = params.sslRetry
  def retry: Int = params.retry
  def bufferSize: Int = params.bufferSize
  def S: Sync[F] = params.S

  private def withParams[G[_]](params: FileCache.Params[G]): FileCache[G] =
    new FileCache(params)

  def withLocation(location: File): FileCache[F] =
    withParams(params.copy(location = location))
  def withLocation(location: String): FileCache[F] =
    withLocation(new File(location))
  def withCachePolicies(cachePolicies: Seq[CachePolicy]): FileCache[F] =
    withParams(params.copy(cachePolicies = cachePolicies))
  def withChecksums(checksums: Seq[Option[String]]): FileCache[F] =
    withParams(params.copy(checksums = checksums))
  def withLogger(logger: CacheLogger): FileCache[F] =
{'fraction_non_alphanumeric': 0.10270398481973435, 'fraction_numerical': 0.0018975332068311196, 'mean_word_length': 5.609717868338558, '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': '4153053', 'n_tokens_mistral': 1303, 'n_tokens_neox': 1295, 'n_words': 291}