Skip to content

Commit

Permalink
Merge pull request #1425 from xuwei-k/eta-expand
Browse files Browse the repository at this point in the history
[2.x] avoid deprecated eta-expand syntax
  • Loading branch information
eed3si9n authored Oct 4, 2024
2 parents 21f6ee8 + 1bcb7b2 commit 46356a7
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ final class HashAPI private (
hashDefinition(d)
extend(extraHash)
}
hashSymmetric(ds, hashDefinitionCombined _)
hashSymmetric(ds, hashDefinitionCombined)
}
def hashDefinition(d: Definition): Unit = {
hashString(d.name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ClassToAPISpecification extends UnitSpec {
val (Seq(tempSrcFile), analysisCallback) =
JavaCompilerForUnitTesting.compileJavaSrcs(src)(readAPI)
val apis = analysisCallback.apis(tempSrcFile)
apis.groupBy(_.name).map((companions _).tupled).toSet
apis.groupBy(_.name).map(companions.tupled).toSet
}

private def companions(className: String, classes: Set[ClassLike]): Companions = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private[inc] abstract class IncrementalCommon(
newApiChanges,
recompiledClasses,
cycleNum >= options.transitiveStep,
IncrementalCommon.comesFromScalaSource(previous.relations, Some(analysis.relations)) _
IncrementalCommon.comesFromScalaSource(previous.relations, Some(analysis.relations))
)

// No matter what shouldDoIncrementalCompilation returns, we are not in fact going to
Expand Down Expand Up @@ -554,7 +554,7 @@ private[inc] abstract class IncrementalCommon(
val byLibraryDep = changes.libraryDeps.flatMap(previous.usesLibrary)
val byExtSrcDep = {
// Invalidate changes
val isScalaSource = IncrementalCommon.comesFromScalaSource(previous) _
val isScalaSource = IncrementalCommon.comesFromScalaSource(previous)
changes.external.apiChanges.iterator.flatMap { externalAPIChange =>
invalidateClassesExternally(previous, externalAPIChange, isScalaSource)
}.toSet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private[inc] class IncrementalNameHashingCommon(
relations: Relations,
apis: APIs
): Set[String] = {
val findSubclasses = relations.inheritance.internal.reverse _
val findSubclasses = relations.inheritance.internal.reverse
val invalidatedClassesAndCodefinedClasses = for {
cls <- invalidatedClasses.iterator
file <- relations.definesClass(cls).iterator
Expand Down Expand Up @@ -127,7 +127,7 @@ private[inc] class IncrementalNameHashingCommon(
}

private def invalidateByInheritance(relations: Relations, modified: String): Set[String] = {
val inheritanceDeps = relations.inheritance.internal.reverse _
val inheritanceDeps = relations.inheritance.internal.reverse
log.debug(s"Invalidating (transitively) by inheritance from $modified...")
val transitiveInheritance = transitiveDeps(Set(modified), log)(inheritanceDeps)
log.debug("Invalidated by transitive inheritance dependency: " + transitiveInheritance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ trait FormatCommons {
val fmtStr = "%%0%dd".format(numDigits)
// We only use this for relatively short seqs, so creating this extra map won't be a performance hit.
val m: Map[String, T] = s.zipWithIndex.map(x => fmtStr.format(x._2) -> x._1).toMap
writeMap(out)(header, m, identity[String] _, t2s)
writeMap(out)(header, m, identity[String], t2s)
}

protected def writeMap[K, V](
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ class TextAnalysisFormat(val mappers: ReadWriteMappers)
val external = "external apis"
}

val stringToAnalyzedClass = ObjectStringifier.stringToObj[AnalyzedClass] _
val analyzedClassToString = ObjectStringifier.objToString[AnalyzedClass] _
val stringToAnalyzedClass = ObjectStringifier.stringToObj[AnalyzedClass]
val analyzedClassToString = ObjectStringifier.objToString[AnalyzedClass]

def write(out: Writer, apis: APIs): Unit = {
writeMap(out)(
Expand Down Expand Up @@ -362,8 +362,8 @@ class TextAnalysisFormat(val mappers: ReadWriteMappers)
val external = "external companions"
}

val stringToCompanions = ObjectStringifier.stringToObj[Companions] _
val companionsToString = ObjectStringifier.objToString[Companions] _
val stringToCompanions = ObjectStringifier.stringToObj[Companions]
val companionsToString = ObjectStringifier.objToString[Companions]

def write(out: Writer, apis: APIs): Unit = {
val internal = apis.internal map { case (k, v) => k -> v.api }
Expand Down Expand Up @@ -405,8 +405,8 @@ class TextAnalysisFormat(val mappers: ReadWriteMappers)
val infos = "source infos"
}

val stringToSourceInfo = ObjectStringifier.stringToObj[SourceInfo] _
val sourceInfoToString = ObjectStringifier.objToString[SourceInfo] _
val stringToSourceInfo = ObjectStringifier.stringToObj[SourceInfo]
val sourceInfoToString = ObjectStringifier.objToString[SourceInfo]

def write(out: Writer, infos: SourceInfos): Unit =
writeMap(out)(
Expand All @@ -426,8 +426,8 @@ class TextAnalysisFormat(val mappers: ReadWriteMappers)
val compilations = "compilations"
}

val stringToCompilation = ObjectStringifier.stringToObj[Compilation] _
val compilationToString = ObjectStringifier.objToString[Compilation] _
val stringToCompilation = ObjectStringifier.stringToObj[Compilation]
val compilationToString = ObjectStringifier.objToString[Compilation]

def write(out: Writer, compilations: Compilations): Unit =
writeSeq(out)(Headers.compilations, Nil, compilationToString)
Expand All @@ -451,8 +451,8 @@ class TextAnalysisFormat(val mappers: ReadWriteMappers)
private[this] val singleOutputMode = "single"
private[this] val multipleOutputMode = "multiple"

val stringToFileHash = ObjectStringifier.stringToObj[FileHash] _
val fileHashToString = ObjectStringifier.objToString[FileHash] _
val stringToFileHash = ObjectStringifier.stringToObj[FileHash]
val fileHashToString = ObjectStringifier.objToString[FileHash]

final val sourceDirMapper = Mapper(
(str: String) => readMapper.mapSourceDir(Mapper.forPath.read(str)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ object AnalysisGenerators {
entries <- listOfN(srcs.length, containerOfN[Set, T](n, g))
} yield Relation.reconstruct(zipMap(srcs, entries))

val genStringRelation = genVirtualFileRefRelation(unique(identifier)) _
val genFileVORefRelation = genVirtualFileRefRelation(unique(genFileVRef)) _
val genStringRelation = genVirtualFileRefRelation(unique(identifier))
val genFileVORefRelation = genVirtualFileRefRelation(unique(genFileVRef))

def rel[A, B](a: Seq[A], b: Seq[B]): Relation[A, B] =
Relation.reconstruct(zipMap(a, b).view.mapValues(Set(_)).toMap)
Expand Down

0 comments on commit 46356a7

Please sign in to comment.