From 48caed547f364d7253eafa07839397c762a8796f Mon Sep 17 00:00:00 2001 From: Brian McKenna Date: Sun, 21 Sep 2014 22:12:13 -0600 Subject: Make compiler.properties fall back to prefixed Previously, if we wanted to override the shell.prompt property, we had to modify compiler.properties in the jar. This change lets us do the following, instead: scala -Dscala.shell.prompt="$(echo -e "\npuffnfresh> ")" All properties previously loaded from compiler.properties now fall back to "scala." in the system properties when not found. --- src/library/scala/util/Properties.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/library') diff --git a/src/library/scala/util/Properties.scala b/src/library/scala/util/Properties.scala index 8835730d95..367488f116 100644 --- a/src/library/scala/util/Properties.scala +++ b/src/library/scala/util/Properties.scala @@ -62,10 +62,10 @@ private[scala] trait PropertiesTrait { def envOrSome(name: String, alt: Option[String]) = envOrNone(name) orElse alt - // for values based on propFilename - def scalaPropOrElse(name: String, alt: String): String = scalaProps.getProperty(name, alt) + // for values based on propFilename, falling back to System properties + def scalaPropOrElse(name: String, alt: String): String = scalaPropOrNone(name).getOrElse(alt) def scalaPropOrEmpty(name: String): String = scalaPropOrElse(name, "") - def scalaPropOrNone(name: String): Option[String] = Option(scalaProps.getProperty(name)) + def scalaPropOrNone(name: String): Option[String] = Option(scalaProps.getProperty(name)).orElse(propOrNone("scala." + name)) /** The numeric portion of the runtime Scala version, if this is a final * release. If for instance the versionString says "version 2.9.0.final", -- cgit v1.2.3