diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2016-04-21 20:31:04 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2016-04-23 12:46:48 +0200 |
commit | 43f7a86e931045c30575e4f0e5a6cd542dc0a380 (patch) | |
tree | c4fa310c4538f08e30dbd0b47a44663f2a9c59b5 /src/compiler/scala/tools/nsc/backend/JavaPlatform.scala | |
parent | f55dd2084eca97c576a982473ab6701f98fb79a7 (diff) | |
download | scala-43f7a86e931045c30575e4f0e5a6cd542dc0a380.tar.gz scala-43f7a86e931045c30575e4f0e5a6cd542dc0a380.tar.bz2 scala-43f7a86e931045c30575e4f0e5a6cd542dc0a380.zip |
remove recursive classpath implementation
Diffstat (limited to 'src/compiler/scala/tools/nsc/backend/JavaPlatform.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/JavaPlatform.scala | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/JavaPlatform.scala b/src/compiler/scala/tools/nsc/backend/JavaPlatform.scala index 0e2f059a36..1e4ea99509 100644 --- a/src/compiler/scala/tools/nsc/backend/JavaPlatform.scala +++ b/src/compiler/scala/tools/nsc/backend/JavaPlatform.scala @@ -9,7 +9,7 @@ package backend import io.AbstractFile import scala.tools.nsc.classpath.{AggregateFlatClassPath, FlatClassPath} import scala.tools.nsc.settings.ClassPathRepresentationType -import scala.tools.nsc.util.{ClassFileLookup, ClassPath, MergedClassPath} +import scala.tools.nsc.util.ClassFileLookup import scala.tools.util.FlatClassPathResolver import scala.tools.util.PathResolver @@ -19,38 +19,20 @@ trait JavaPlatform extends Platform { import global._ import definitions._ - private[nsc] var currentClassPath: Option[MergedClassPath[AbstractFile]] = None - - def classPath: ClassPath[AbstractFile] = { - assert(settings.YclasspathImpl.value == ClassPathRepresentationType.Recursive, - "To use recursive classpath representation you must enable it with -YclasspathImpl:recursive compiler option.") - - if (currentClassPath.isEmpty) currentClassPath = Some(new PathResolver(settings).result) - currentClassPath.get - } - private[nsc] var currentFlatClassPath: Option[FlatClassPath] = None private[nsc] def flatClassPath: FlatClassPath = { - assert(settings.YclasspathImpl.value == ClassPathRepresentationType.Flat, - "To use flat classpath representation you must enable it with -YclasspathImpl:flat compiler option.") - if (currentFlatClassPath.isEmpty) currentFlatClassPath = Some(new FlatClassPathResolver(settings).result) currentFlatClassPath.get } /** Update classpath with a substituted subentry */ - def updateClassPath(subst: Map[ClassFileLookup[AbstractFile], ClassFileLookup[AbstractFile]]) = global.classPath match { - case cp: ClassPath[AbstractFile] => - val s = subst.asInstanceOf[Map[ClassPath[AbstractFile], ClassPath[AbstractFile]]] - currentClassPath = Some(new MergedClassPath(cp.entries map (e => s.getOrElse(e, e)), cp.context)) - + def updateClassPath(subst: Map[FlatClassPath, FlatClassPath]): Unit = global.classPath match { case AggregateFlatClassPath(entries) => - val s = subst.asInstanceOf[Map[FlatClassPath, FlatClassPath]] - currentFlatClassPath = Some(AggregateFlatClassPath(entries map (e => s.getOrElse(e, e)))) + currentFlatClassPath = Some(AggregateFlatClassPath(entries map (e => subst.getOrElse(e, e)))) case cp: FlatClassPath => - currentFlatClassPath = Some(subst.getOrElse(cp, cp).asInstanceOf[FlatClassPath]) + currentFlatClassPath = Some(subst.getOrElse(cp, cp)) } def platformPhases = List( |