summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2013-05-09 12:07:03 +0200
committerEugene Burmako <xeno.by@gmail.com>2013-05-09 12:07:03 +0200
commita3d03ab8667e09e53c74d3fbb0cd7b8ae00fc8c9 (patch)
treec263ae2ec9d1b453c1b6697fc6c863a74311dc38 /src
parent5c77e01794434b2fa01a1bd250c08198c31796e3 (diff)
downloadscala-a3d03ab8667e09e53c74d3fbb0cd7b8ae00fc8c9.tar.gz
scala-a3d03ab8667e09e53c74d3fbb0cd7b8ae00fc8c9.tar.bz2
scala-a3d03ab8667e09e53c74d3fbb0cd7b8ae00fc8c9.zip
fixes a crash in ReflectionUtils.systemProperties
Due to SI-7465 we were erroneously assuming that System.getProperties only contains string key and string values. This led to a CCE when there was something else.
Diffstat (limited to 'src')
-rw-r--r--src/reflect/scala/reflect/runtime/ReflectionUtils.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/reflect/scala/reflect/runtime/ReflectionUtils.scala b/src/reflect/scala/reflect/runtime/ReflectionUtils.scala
index 7b093e0e80..2685085326 100644
--- a/src/reflect/scala/reflect/runtime/ReflectionUtils.scala
+++ b/src/reflect/scala/reflect/runtime/ReflectionUtils.scala
@@ -28,9 +28,11 @@ private[scala] object ReflectionUtils {
case ex if pf isDefinedAt unwrapThrowable(ex) => pf(unwrapThrowable(ex))
}
- private def systemProperties: Iterator[(String, String)] = {
+ private def systemProperties: Map[String, String] = {
import scala.collection.JavaConverters._
- System.getProperties.asScala.iterator
+ // 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 = (