summaryrefslogtreecommitdiff
path: root/src/library/scala/util/Properties.scala
diff options
context:
space:
mode:
authorSimon Ochsenreither <simon@ochsenreither.de>2013-05-18 22:57:12 +0200
committerSimon Ochsenreither <simon@ochsenreither.de>2013-05-23 21:08:27 +0200
commitd38e8ae5254c11fe2c1fd550b1f1366d637cf8e5 (patch)
tree3a51fcc0cd69f1dad05a32428a1f54bcc08392e6 /src/library/scala/util/Properties.scala
parentb45e2b7b30faaa4994740fbe063737934a187d4e (diff)
downloadscala-d38e8ae5254c11fe2c1fd550b1f1366d637cf8e5.tar.gz
scala-d38e8ae5254c11fe2c1fd550b1f1366d637cf8e5.tar.bz2
scala-d38e8ae5254c11fe2c1fd550b1f1366d637cf8e5.zip
SI-7497 Fix scala.util.Properties.isMac
It returned wrong values because it used the java.vendor property instead of os.name. See http://mail.openjdk.java.net/pipermail/macosx-port-dev/2012-November/005148.html for the reason why we don't follow developer.apple.com/library/mac/#technotes/tn2002/tn2110.
Diffstat (limited to 'src/library/scala/util/Properties.scala')
-rw-r--r--src/library/scala/util/Properties.scala16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/library/scala/util/Properties.scala b/src/library/scala/util/Properties.scala
index cc145134c4..3cd6eb8659 100644
--- a/src/library/scala/util/Properties.scala
+++ b/src/library/scala/util/Properties.scala
@@ -72,7 +72,7 @@ private[scala] trait PropertiesTrait {
* it is an RC, Beta, etc. or was built from source, or if the version
* cannot be read.
*/
- val releaseVersion =
+ val releaseVersion =
for {
v <- scalaPropOrNone("maven.version.number")
if !(v endsWith "-SNAPSHOT")
@@ -86,7 +86,7 @@ private[scala] trait PropertiesTrait {
* @return Some(version) if this is a non-final version, None if this
* is a final release or the version cannot be read.
*/
- val developmentVersion =
+ val developmentVersion =
for {
v <- scalaPropOrNone("maven.version.number")
if v endsWith "-SNAPSHOT"
@@ -119,8 +119,7 @@ private[scala] trait PropertiesTrait {
*/
def lineSeparator = propOrElse("line.separator", "\n")
- /** Various well-known properties.
- */
+ /* Various well-known properties. */
def javaClassPath = propOrEmpty("java.class.path")
def javaHome = propOrEmpty("java.home")
def javaVendor = propOrEmpty("java.vendor")
@@ -136,10 +135,13 @@ private[scala] trait PropertiesTrait {
def userHome = propOrEmpty("user.home")
def userName = propOrEmpty("user.name")
- /** Some derived values.
- */
+ /* Some derived values. */
+ /** Returns `true` iff the underlying operating system is a version of Microsoft Windows. */
def isWin = osName startsWith "Windows"
- def isMac = javaVendor startsWith "Apple"
+ // See http://mail.openjdk.java.net/pipermail/macosx-port-dev/2012-November/005148.html for
+ // the reason why we don't follow developer.apple.com/library/mac/#technotes/tn2002/tn2110.
+ /** Returns `true` iff the underlying operating system is a version of Apple Mac OSX. */
+ def isMac = osName startsWith "Mac OS X"
// This is looking for javac, tools.jar, etc.
// Tries JDK_HOME first, then the more common but likely jre JAVA_HOME,