From a84abd088df0105c542aa3192de5a634f3ceda35 Mon Sep 17 00:00:00 2001 From: Heather Miller Date: Wed, 15 Oct 2014 16:46:21 -0700 Subject: SI-6502 Addressing review comments --- src/compiler/scala/tools/nsc/Global.scala | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'src/compiler/scala/tools/nsc/Global.scala') diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 0a7fd1c3e1..658aa66fd9 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -845,12 +845,8 @@ class Global(var currentSettings: Settings, var reporter: Reporter) /** Is given package class a system package class that cannot be invalidated? */ - private def isSystemPackageClass(pkg: Symbol) = - pkg == RootClass || - pkg == definitions.ScalaPackageClass || { - val pkgname = pkg.fullName - (pkgname startsWith "scala.") && !(pkgname startsWith "scala.tools") - } + private def isSystemPackageClass(pkg: Symbol) = + pkg == RootClass || (pkg.hasTransOwner(definitions.ScalaPackageClass) && !pkg.hasTransOwner(this.rootMirror.staticPackage("scala.tools").moduleClass.asClass)) /** Invalidates packages that contain classes defined in a classpath entry, and * rescans that entry. @@ -872,13 +868,11 @@ class Global(var currentSettings: Settings, var reporter: Reporter) * * @param paths Fully-qualified names that refer to directories or jar files that are * entries on the classpath. - * - * @return A pair consisting of - * - a list of invalidated packages - * - a list of of packages that should have been invalidated but were not because - * they are system packages. */ - def invalidateClassPathEntries(paths: String*): (List[ClassSymbol], List[ClassSymbol]) = { + def invalidateClassPathEntries(paths: String*): Unit = { + implicit object ClassPathOrdering extends Ordering[PlatformClassPath] { + def compare(a:PlatformClassPath, b:PlatformClassPath) = a.asClasspathString compare b.asClasspathString + } val invalidated, failed = new mutable.ListBuffer[ClassSymbol] classPath match { case cp: MergedClassPath[_] => @@ -899,7 +893,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter) List() } } - val subst = Map(paths flatMap assoc: _*) + val subst = immutable.TreeMap(paths flatMap assoc: _*) if (subst.nonEmpty) { platform updateClassPath subst informProgress(s"classpath updated on entries [${subst.keys mkString ","}]") @@ -916,7 +910,6 @@ class Global(var currentSettings: Settings, var reporter: Reporter) informProgress(s"$msg: ${syms map (_.fullName) mkString ","}") show("invalidated packages", invalidated) show("could not invalidate system packages", failed) - (invalidated.toList, failed.toList) } /** Merges new classpath entries into the symbol table -- cgit v1.2.3