diff options
author | Philipp Haller <hallerp@gmail.com> | 2010-07-12 11:49:28 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2010-07-12 11:49:28 +0000 |
commit | a012c4c92010b640e3448593a948aa5bf3f37950 (patch) | |
tree | 82406dbe8734830a1fb11efd5fdab5d46d331589 /test | |
parent | b05c0fa47d2c895347c0600858e814707f169327 (diff) | |
download | scala-a012c4c92010b640e3448593a948aa5bf3f37950.tar.gz scala-a012c4c92010b640e3448593a948aa5bf3f37950.tar.bz2 scala-a012c4c92010b640e3448593a948aa5bf3f37950.zip |
Fixed buggy test case. Closes #3551. No review.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/jvm/actor-executor2.scala | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/files/jvm/actor-executor2.scala b/test/files/jvm/actor-executor2.scala index da64a7fc43..f8fcaef69f 100644 --- a/test/files/jvm/actor-executor2.scala +++ b/test/files/jvm/actor-executor2.scala @@ -1,6 +1,6 @@ import scala.actors.{Actor, SchedulerAdapter, Exit} import Actor._ -import java.util.concurrent.Executors +import java.util.concurrent.{Executors, RejectedExecutionException} object One extends AdaptedActor { def act() { @@ -57,9 +57,15 @@ object Test { val scheduler = new SchedulerAdapter { def execute(block: => Unit) { - executor.execute(new Runnable { + val task = new Runnable { def run() { block } - }) + } + try { + executor.execute(task) + } catch { + case ree: RejectedExecutionException => + task.run() // run task on current thread + } } } |