summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/util/PathResolver.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/tools/util/PathResolver.scala')
-rw-r--r--src/compiler/scala/tools/util/PathResolver.scala29
1 files changed, 4 insertions, 25 deletions
diff --git a/src/compiler/scala/tools/util/PathResolver.scala b/src/compiler/scala/tools/util/PathResolver.scala
index 8e5b1e0a5c..9decc99c8d 100644
--- a/src/compiler/scala/tools/util/PathResolver.scala
+++ b/src/compiler/scala/tools/util/PathResolver.scala
@@ -12,10 +12,8 @@ import scala.tools.reflect.WrappedProperties.AccessControl
import scala.tools.nsc.Settings
import scala.tools.nsc.util.{ ClassFileLookup, ClassPath, JavaClassPath }
import scala.reflect.io.{ File, Directory, Path, AbstractFile }
-import scala.reflect.runtime.ReflectionUtils
-import ClassPath.{ JavaContext, DefaultJavaContext, join, split }
+import ClassPath.{ JavaContext, DefaultJavaContext, split }
import PartialFunction.condOpt
-import scala.language.postfixOps
import scala.tools.nsc.classpath.{ AggregateFlatClassPath, ClassPathFactory, FlatClassPath, FlatClassPathFactory }
import scala.tools.nsc.settings.ClassPathRepresentationType
@@ -52,7 +50,7 @@ object PathResolver {
*/
object Environment {
private def searchForBootClasspath =
- systemProperties find (_._1 endsWith ".boot.class.path") map (_._2) getOrElse ""
+ systemProperties collectFirst { case (k, v) if k endsWith ".boot.class.path" => v } getOrElse ""
/** Environment variables which java pays attention to so it
* seems we do as well.
@@ -166,12 +164,6 @@ object PathResolver {
|}""".asLines
}
- // used in PathResolver constructor
- private object NoImplClassJavaContext extends JavaContext {
- override def isValidName(name: String): Boolean =
- !ReflectionUtils.scalacShouldntLoadClassfile(name)
- }
-
@deprecated("This method is no longer used be scalap and will be deleted", "2.11.5")
def fromPathString(path: String, context: JavaContext = DefaultJavaContext): JavaClassPath = {
val s = new Settings()
@@ -254,17 +246,7 @@ abstract class PathResolverBase[BaseClassPathType <: ClassFileLookup[AbstractFil
* TODO: we should refactor this as a separate -bootstrap option to have a clean implementation, no? */
def sourcePath = if (!settings.isScaladoc) cmdLineOrElse("sourcepath", Defaults.scalaSourcePath) else ""
- /** Against my better judgment, giving in to martin here and allowing
- * CLASSPATH to be used automatically. So for the user-specified part
- * of the classpath:
- *
- * - If -classpath or -cp is given, it is that
- * - Otherwise, if CLASSPATH is set, it is that
- * - If neither of those, then "." is used.
- */
- def userClassPath =
- if (!settings.classpath.isDefault) settings.classpath.value
- else sys.env.getOrElse("CLASSPATH", ".")
+ def userClassPath = settings.classpath.value // default is specified by settings and can be overridden there
import classPathFactory._
@@ -322,10 +304,7 @@ abstract class PathResolverBase[BaseClassPathType <: ClassFileLookup[AbstractFil
class PathResolver(settings: Settings, context: JavaContext)
extends PathResolverBase[ClassPath[AbstractFile], JavaClassPath](settings, context) {
- def this(settings: Settings) =
- this(settings,
- if (settings.YnoLoadImplClass) PathResolver.NoImplClassJavaContext
- else DefaultJavaContext)
+ def this(settings: Settings) = this(settings, DefaultJavaContext)
override protected def computeResult(): JavaClassPath =
new JavaClassPath(containers.toIndexedSeq, context)