<commit_before>package org.jetbrains.plugins.scala
package project

import java.io.File

import com.intellij.openapi.roots.libraries.LibraryProperties
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.vfs.VfsUtilCore
import org.jetbrains.plugins.scala.util.HashBuilder._

/**
 * @author <NAME>
 */
final class ScalaLibraryProperties private(private[this] var _languageLevel: ScalaLanguageLevel,
                                           private[this] var _compilerClasspath: Seq[File])
  extends LibraryProperties[ScalaLibraryPropertiesState] {

  import ScalaLibraryProperties._

  def languageLevel: ScalaLanguageLevel = _languageLevel

  def languageLevel_=(languageLevel: ScalaLanguageLevel): Unit = {
    if (_languageLevel != languageLevel)
      settings.ScalaCompilerConfiguration.incModificationCount()
    _languageLevel = languageLevel
  }

  def compilerClasspath: Seq[File] = _compilerClasspath

  def compilerClasspath_=(compilerClasspath: Seq[File]): Unit = {
    _compilerClasspath = compilerClasspath
  }

  override def loadState(state: ScalaLibraryPropertiesState): Unit = {
    languageLevel = state.getLanguageLevel
    compilerClasspath = state.getCompilerClasspath.map(pathToFile)
  }

  override def getState: ScalaLibraryPropertiesState = new ScalaLibraryPropertiesState(
    languageLevel,
    compilerClasspath.map(fileToPath).toArray
  )

  override def equals(obj: Any): Boolean = obj match {
    case properties: ScalaLibraryProperties =>
      languageLevel == properties.languageLevel &&
        compilerClasspath == properties.compilerClasspath
    case _ => false
  }

  override def hashCode: Int = languageLevel #+ compilerClasspath

  override def toString = s"ScalaLibraryProperties($languageLevel, $compilerClasspath)"
}

object ScalaLibraryProperties {

  import ScalaLanguageLevel._
  import VfsUtilCore._

  def apply(version: Option[String] = None,
            compilerClasspath: Seq[File] = Seq.empty): ScalaLibraryProperties = {
    val languageLevel = version.flatMap(findByVersion).getOrElse(getDefault)
    new ScalaLibraryProperties(languageLevel, compilerClasspath)
  }

  private def pathToFile(url: String) =
    new File(urlToPath(url))
<commit_msg>compare compilerClasspath entries by absolute path<commit_after>package org.jetbrains.plugins.scala
package project

import java.io.File

import com.intellij.openapi.roots.libraries.LibraryProperties
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.vfs.VfsUtilCore
import org.jetbrains.plugins.scala.util.HashBuilder._

/**
 * @author <NAME>
 */
final class ScalaLibraryProperties private(private[this] var _languageLevel: ScalaLanguageLevel,
                                           private[this] var _compilerClasspath: Seq[File])
  extends LibraryProperties[ScalaLibraryPropertiesState] {

  import ScalaLibraryProperties._

  def languageLevel: ScalaLanguageLevel = _languageLevel

  def languageLevel_=(languageLevel: ScalaLanguageLevel): Unit = {
    if (_languageLevel != languageLevel)
      settings.ScalaCompilerConfiguration.incModificationCount()
    _languageLevel = languageLevel
  }

  def compilerClasspath: Seq[File] = _compilerClasspath

  def compilerClasspath_=(compilerClasspath: Seq[File]): Unit = {
    _compilerClasspath = compilerClasspath
  }

  override def loadState(state: ScalaLibraryPropertiesState): Unit = {
    languageLevel = state.getLanguageLevel
    compilerClasspath = state.getCompilerClasspath.map(pathToFile)
  }

  override def getState: ScalaLibraryPropertiesState = new ScalaLibraryPropertiesState(
    languageLevel,
    compilerClasspath.map(fileToPath).toArray
  )

  override def equals(obj: Any): Boolean = obj match {
    case properties: ScalaLibraryProperties =>
      languageLevel == properties.languageLevel &&
        compilerClasspath.map(_.getAbsolutePath) == properties.compilerClasspath.map(_.getAbsolutePath)
    case _ => false
  }

  override def hashCode: Int = languageLevel #+ compilerClasspath

  override def toString = s"ScalaLibraryProperties($languageLevel, $compilerClasspath)"
}

object ScalaLibraryProperties {

  import ScalaLanguageLevel._
  import VfsUtilCore._

  def apply(version: Option[String] = None,
            compilerClasspath: Seq[File] = Seq.empty): ScalaLibraryProperties = {
    val languageLevel = version.flatMap(findByVersion).getOrElse(getDefault)
    new ScalaLibraryProperties(languageLevel, compilerClasspath)
  }

  private def pathToFile(url: String) =
    new File(urlToPath(url))

{'fraction_non_alphanumeric': 0.08070562293274532, 'fraction_numerical': 0.0, 'mean_word_length': 4.684210526315789, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4559455', 'n_tokens_mistral': 1260, 'n_tokens_neox': 1225, 'n_words': 255}