diff options
-rw-r--r-- | src/actors/scala/actors/scheduler/ThreadPoolConfig.scala | 3 | ||||
-rw-r--r-- | src/library/scala/util/Properties.scala | 14 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/actors/scala/actors/scheduler/ThreadPoolConfig.scala b/src/actors/scala/actors/scheduler/ThreadPoolConfig.scala index c96dd6d8d3..a1bf35e0e1 100644 --- a/src/actors/scala/actors/scheduler/ThreadPoolConfig.scala +++ b/src/actors/scala/actors/scheduler/ThreadPoolConfig.scala @@ -44,7 +44,8 @@ object ThreadPoolConfig { Debug.info(this+": java.vm.vendor = "+javaVmVendor) // on IBM J9 1.6 do not use ForkJoinPool - isJavaAtLeast(1.6) && (javaVmVendor contains "Sun") + // XXX this all needs to go into Properties. + isJavaAtLeast("1.6") && ((javaVmVendor contains "Sun") || (javaVmVendor contains "Apple")) } catch { case _: SecurityException => false 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]) { |