From d61d2c93d788fdf01ad2497b9c6bb69ab9d6a397 Mon Sep 17 00:00:00 2001 From: Antonio Cunei Date: Mon, 12 Apr 2010 16:37:39 +0000 Subject: Merged revisions 21467,21471-21482,21486-21487 ... Merged revisions 21467,21471-21482,21486-21487 via svnmerge from https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk ........ r21467 | plocinic | 2010-04-12 10:09:26 +0200 (Mon, 12 Apr 2010) | 1 line Closes #2757. No review. ........ r21471 | odersky | 2010-04-12 13:52:39 +0200 (Mon, 12 Apr 2010) | 1 line Closes #3224. Review by retronym. ........ r21472 | odersky | 2010-04-12 13:53:05 +0200 (Mon, 12 Apr 2010) | 1 line Cosmetic renamings. No review. ........ r21473 | phaller | 2010-04-12 13:59:29 +0200 (Mon, 12 Apr 2010) | 1 line actors.UncaughtException stores most recent sender. Default output for unhandled exceptions can be disabled using actors.Debug. Review by plocinic. ........ r21474 | phaller | 2010-04-12 14:00:10 +0200 (Mon, 12 Apr 2010) | 1 line Improved deprecation warnings in actors package object. No review. ........ r21475 | phaller | 2010-04-12 14:02:51 +0200 (Mon, 12 Apr 2010) | 1 line Another test for see #2017. No review. ........ r21476 | phaller | 2010-04-12 15:25:57 +0200 (Mon, 12 Apr 2010) | 1 line Attempting to unblock partest by handling AssertionErrors. No review. ........ r21477 | dubochet | 2010-04-12 15:29:05 +0200 (Mon, 12 Apr 2010) | 1 line [scaladoc] meta-documentation (attributes, definition classes, etc.) is available for members that do not have a comment. No review. ........ r21478 | dubochet | 2010-04-12 16:16:01 +0200 (Mon, 12 Apr 2010) | 1 line [scaladoc] Dangerous HTML (that can break Scaladoc) is stripped out of comments and replaced by corresponding wiki syntax when possible. No review. ........ r21479 | dubochet | 2010-04-12 16:29:47 +0200 (Mon, 12 Apr 2010) | 1 line [scaladoc] Not all 23 AbstractFunction classes are listed in the left list. No review. ........ r21480 | dubochet | 2010-04-12 16:38:16 +0200 (Mon, 12 Apr 2010) | 1 line [scaladoc] More mitigation code for dangerous HTML tags. No review. ........ r21481 | malayeri | 2010-04-12 16:52:39 +0200 (Mon, 12 Apr 2010) | 1 line Move constructors to beginning of scaladoc html page; show implicit modifier in main list. Review by dubochet. ........ r21482 | rytz | 2010-04-12 17:12:56 +0200 (Mon, 12 Apr 2010) | 1 line fixed LOAD_MODULE for companions of primitive types. fixes .net build. review by dragos. ........ r21486 | odersky | 2010-04-12 17:26:20 +0200 (Mon, 12 Apr 2010) | 1 line changed testfile, to satisfy new diff algo (which should be reverted IMO). review by extempore. ........ r21487 | extempore | 2010-04-12 18:11:36 +0200 (Mon, 12 Apr 2010) | 1 line Some modifications to partest to improve output. Review by phaller. ........ --- test/files/jvm/actor-uncaught-exception2.check | 2 ++ test/files/jvm/actor-uncaught-exception2.scala | 48 ++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 test/files/jvm/actor-uncaught-exception2.check create mode 100644 test/files/jvm/actor-uncaught-exception2.scala (limited to 'test/files/jvm') diff --git a/test/files/jvm/actor-uncaught-exception2.check b/test/files/jvm/actor-uncaught-exception2.check new file mode 100644 index 0000000000..870a5d32f9 --- /dev/null +++ b/test/files/jvm/actor-uncaught-exception2.check @@ -0,0 +1,2 @@ +UncaughtException(StartError,None,None,MyException: I don't want to run!) +UncaughtException(MessageError,Some('ping),Some(Supervisor),MyException: No message for me!) diff --git a/test/files/jvm/actor-uncaught-exception2.scala b/test/files/jvm/actor-uncaught-exception2.scala new file mode 100644 index 0000000000..973cfb370a --- /dev/null +++ b/test/files/jvm/actor-uncaught-exception2.scala @@ -0,0 +1,48 @@ +import scala.actors.{Actor, Exit, Debug} + +class MyException(msg: String) extends Exception(msg) { + override def fillInStackTrace() = this +} + +object Test { + + case object StartError extends Actor { + def act() { + throw new MyException("I don't want to run!") + } + } + + case object MessageError extends Actor { + def act() { + react { + case _ => throw new MyException("No message for me!") + } + } + } + + case object Supervisor extends Actor { + def act() { + trapExit = true + link(StartError) + link(MessageError) + StartError.start() + MessageError.start() + + Actor.loop { + react { + case Exit(actor, reason) => + println(reason) + if (actor == StartError) + MessageError ! 'ping + else + exit() + } + } + } + } + + def main(args: Array[String]) { + Debug.level = 1 // decrease level so that it does not print warnings + Supervisor.start() + } +} -- cgit v1.2.3