From 9f996ddaf6ecda1ba270041a7c70a70121510647 Mon Sep 17 00:00:00 2001 From: Philipp Haller Date: Fri, 14 Sep 2007 09:36:17 +0000 Subject: Handle AccessControlException when initializing... Handle AccessControlException when initializing actor library. --- src/actors/scala/actors/FJTaskScheduler2.scala | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/actors/scala/actors/FJTaskScheduler2.scala b/src/actors/scala/actors/FJTaskScheduler2.scala index a724d8987c..0600f4d7b2 100644 --- a/src/actors/scala/actors/FJTaskScheduler2.scala +++ b/src/actors/scala/actors/FJTaskScheduler2.scala @@ -20,7 +20,7 @@ import scala.collection.mutable.{ArrayBuffer, Buffer, HashMap, Queue, Stack, Has /** * FJTaskScheduler2 * - * @version 0.9.9 + * @version 0.9.10 * @author Philipp Haller */ class FJTaskScheduler2 extends Thread with IScheduler { @@ -30,8 +30,19 @@ class FJTaskScheduler2 extends Thread with IScheduler { val printStats = false //val printStats = true - val coreProp = System.getProperty("actors.corePoolSize") - val maxProp = System.getProperty("actors.maxPoolSize") + val coreProp = try { + System.getProperty("actors.corePoolSize") + } catch { + case ace: java.security.AccessControlException => + null + } + val maxProp = + try { + System.getProperty("actors.maxPoolSize") + } catch { + case ace: java.security.AccessControlException => + null + } val initCoreSize = if (null ne coreProp) Integer.parseInt(coreProp) -- cgit v1.2.3