From 7849361c82e5ba4a65352ec1dcc72192e82d9776 Mon Sep 17 00:00:00 2001 From: Grzegorz Kossakowski Date: Tue, 20 May 2014 19:51:28 +0200 Subject: [PATCH] Remove stale, commented out code from Incremental.scala The commented out code was sitting here since 2010. It bit-rotted to the point of not being useful anymore. Let's remove it. --- .../src/main/scala/sbt/inc/Incremental.scala | 41 ------------------- 1 file changed, 41 deletions(-) diff --git a/compile/inc/src/main/scala/sbt/inc/Incremental.scala b/compile/inc/src/main/scala/sbt/inc/Incremental.scala index 01f3a8749..e6fd8b308 100644 --- a/compile/inc/src/main/scala/sbt/inc/Incremental.scala +++ b/compile/inc/src/main/scala/sbt/inc/Incremental.scala @@ -403,47 +403,6 @@ private abstract class IncrementalCommon(log: Logger, options: IncOptions) { } xs.toSet } - - // unmodifiedSources should not contain any sources in the previous compilation run - // (this may unnecessarily invalidate them otherwise) - /*def scopeInvalidation(previous: Analysis, otherSources: Set[File], names: NameChanges): Set[File] = - { - val newNames = newTypes ++ names.newTerms - val newMap = pkgNameMap(newNames) - otherSources filter { src => scopeAffected(previous.extAPI(src), previous.srcDependencies(src), newNames, newMap) } - } - - def scopeAffected(api: Source, srcDependencies: Iterable[Source], newNames: Set[String], newMap: Map[String, List[String]]): Boolean = - collisions_?(TopLevel.names(api.definitions), newNames) || - pkgs(api) exists {p => shadowed_?(p, srcDependencies, newMap) } - - def collisions_?(existing: Set[String], newNames: Map[String, List[String]]): Boolean = - !(existing ** newNames).isEmpty - - // A proper implementation requires the actual symbol names used. This is a crude approximation in the meantime. - def shadowed_?(fromPkg: List[String], srcDependencies: Iterable[Source], newNames: Map[String, List[String]]): Boolean = - { - lazy val newPN = newNames.filter { pn => properSubPkg(fromPkg, pn._2) } - - def isShadowed(usedName: String): Boolean = - { - val (usedPkg, name) = pkgAndName(usedName) - newPN.get(name).forall { nPkg => properSubPkg(usedPkg, nPkg) } - } - - val usedNames = TopLevel.names(srcDependencies) // conservative approximation of referenced top-level names - usedNames exists isShadowed - } - def pkgNameMap(names: Iterable[String]): Map[String, List[String]] = - (names map pkgAndName).toMap - def pkgAndName(s: String) = - { - val period = s.lastIndexOf('.') - if(period < 0) (Nil, s) else (s.substring(0, period).split("\\."), s.substring(period+1)) - } - def pkg(s: String) = pkgAndName(s)._1 - def properSubPkg(testParent: Seq[String], testSub: Seq[String]) = testParent.length < testSub.length && testSub.startsWith(testParent) - def pkgs(api: Source) = names(api :: Nil).map(pkg)*/ } private final class IncrementalDefaultImpl(log: Logger, options: IncOptions) extends IncrementalCommon(log, options) {