diff options
author | Paul Phillips <paulp@improving.org> | 2010-02-26 17:03:22 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-02-26 17:03:22 +0000 |
commit | 2b1513b35e3172a9045946f2621167a7310a1855 (patch) | |
tree | e23e7dd6b975bd84ac4359d1a4557fc090a53dbc /src/library | |
parent | cda9718a21ca02d7d13efe7b07f4d4e0c5697171 (diff) | |
download | scala-2b1513b35e3172a9045946f2621167a7310a1855.tar.gz scala-2b1513b35e3172a9045946f2621167a7310a1855.tar.bz2 scala-2b1513b35e3172a9045946f2621167a7310a1855.zip |
Undid my awful code which had broken the thread...
Undid my awful code which had broken the thread scheduler selection.
Further unbroke it beyond that unbreaking hopefully to the point where
java 1.6 on OSX is recognized as such. Review by haller.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/util/Properties.scala | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/library/scala/util/Properties.scala b/src/library/scala/util/Properties.scala index d61a834555..afd83eb187 100644 --- a/src/library/scala/util/Properties.scala +++ b/src/library/scala/util/Properties.scala @@ -105,10 +105,18 @@ private[scala] trait PropertiesTrait def scalacCmd = if (isWin) "scalac.bat" else "scalac" /** Can the java version be determined to be at least as high as the argument? + * Hard to properly future proof this but at the rate 1.7 is going we can leave + * the issue for our cyborg grandchildren to solve. */ - def isJavaAtLeast(version: Double) = - try javaVersion.toDouble >= version - catch { case _: NumberFormatException => false } + def isJavaAtLeast(version: String) = { + val okVersions = version match { + case "1.5" => List("1.5", "1.6", "1.7") + case "1.6" => List("1.6", "1.7") + case "1.7" => List("1.7") + case _ => Nil + } + okVersions exists (javaVersion startsWith _) + } // provide a main method so version info can be obtained by running this def main(args: Array[String]) { |