summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2013-05-09 14:04:14 +0200
committerEugene Burmako <xeno.by@gmail.com>2013-05-09 14:04:14 +0200
commit75a3b88c697d485a321429a7526c823f1b4bfc8e (patch)
tree788ae26d74c294f1ca01cef10b06ffb6172afcda
parent35c0145313659b0431481617c53fb30b2c0ec109 (diff)
downloadscala-75a3b88c697d485a321429a7526c823f1b4bfc8e.tar.gz
scala-75a3b88c697d485a321429a7526c823f1b4bfc8e.tar.bz2
scala-75a3b88c697d485a321429a7526c823f1b4bfc8e.zip
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.
-rw-r--r--src/reflect/scala/reflect/runtime/ReflectionUtils.scala13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/reflect/scala/reflect/runtime/ReflectionUtils.scala b/src/reflect/scala/reflect/runtime/ReflectionUtils.scala
index 2685085326..3ee53eb7a1 100644
--- a/src/reflect/scala/reflect/runtime/ReflectionUtils.scala
+++ b/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>"
}