Permalink
Browse files

replaces inferBootClasspath with a simple lookup at sun.boot.class.path

It's not like we're achieving any generality by iterating through all
keys in System.getProperties and looking for ones which resemble
"boot.class.path", so let's be simpler.
  • Loading branch information...
1 parent 35c0145 commit 75a3b88c697d485a321429a7526c823f1b4bfc8e @xeno-by xeno-by committed May 9, 2013
Showing with 1 addition and 12 deletions.
  1. +1 −12 src/reflect/scala/reflect/runtime/ReflectionUtils.scala
@@ -28,17 +28,6 @@ private[scala] object ReflectionUtils {
case ex if pf isDefinedAt unwrapThrowable(ex) => pf(unwrapThrowable(ex))
}
- private def systemProperties: Map[String, String] = {
- import scala.collection.JavaConverters._
- // cannot use System.getProperties.asScala because of SI-7465
- val javaProperties: java.util.Dictionary[Object, Object] = System.getProperties
- javaProperties.asScala.collect{ case (k: String, v: String) => (k, v) }.toMap
- }
-
- private def inferBootClasspath: String = (
- systemProperties find (_._1 endsWith ".boot.class.path") map (_._2) getOrElse ""
- )
-
def show(cl: ClassLoader): String = {
import scala.language.reflectiveCalls
@@ -53,7 +42,7 @@ private[scala] object ReflectionUtils {
case cl if cl != null && isAbstractFileClassLoader(cl.getClass) =>
cl.asInstanceOf[{val root: scala.reflect.io.AbstractFile}].root.canonicalPath
case null =>
- inferBootClasspath
+ scala.util.Properties.propOrEmpty("sun.boot.class.path")
case _ =>
"<unknown>"
}

0 comments on commit 75a3b88

Please sign in to comment.