summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-03-04 05:22:57 +0000
committerPaul Phillips <paulp@improving.org>2010-03-04 05:22:57 +0000
commit34b8e8fcbbb1b11ce81bf69b730abcb78b6699ec (patch)
treeb2ae69f2731acde0ec4b921cf2e1a73295ea3250 /src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
parent65520ac86f5362bfa438c0b9e1a84f1f558e2618 (diff)
downloadscala-34b8e8fcbbb1b11ce81bf69b730abcb78b6699ec.tar.gz
scala-34b8e8fcbbb1b11ce81bf69b730abcb78b6699ec.tar.bz2
scala-34b8e8fcbbb1b11ce81bf69b730abcb78b6699ec.zip
A few yards short of the goal posts attempt at ...
A few yards short of the goal posts attempt at making our usage of Throwable subclasses more consistent. This patch eliminates a lot of ad hoc Exception/Error/etc. creation and various arbitrary choices are rendered slightly less arbitrary. From now on let's try not to use the word "Exception" or "Error" in the names of Throwable subclasses unless they actually derive (and make sense to derive) from Exception or Error. Review by community.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interactive/CompilerControl.scala')
-rw-r--r--src/compiler/scala/tools/nsc/interactive/CompilerControl.scala18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala b/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
index ab02ae7460..5c16bb4465 100644
--- a/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
+++ b/src/compiler/scala/tools/nsc/interactive/CompilerControl.scala
@@ -2,7 +2,7 @@ package scala.tools.nsc
package interactive
import scala.concurrent.SyncVar
-import scala.util.control.ControlException
+import scala.util.control.ControlThrowable
import scala.tools.nsc.io.AbstractFile
import scala.tools.nsc.util.{SourceFile, Position, WorkScheduler}
import scala.tools.nsc.symtab._
@@ -124,23 +124,19 @@ trait CompilerControl { self: Global =>
}
/** Cancel currently pending high-priority jobs */
- def askCancel() =
- scheduler.raise(new CancelActionReq)
+ def askCancel() = scheduler raise CancelActionReq
/** Cancel current compiler run and start a fresh one where everything will be re-typechecked
* (but not re-loaded).
*/
- def askReset() =
- scheduler.raise(new FreshRunReq)
+ def askReset() = scheduler raise FreshRunReq
/** Tell the compile server to shutdown, and do not restart again */
- def askShutdown() =
- scheduler.raise(new ShutdownReq)
+ def askShutdown() = scheduler raise ShutdownReq
// ---------------- Interpreted exeptions -------------------
- class CancelActionReq extends Exception with ControlException
- class FreshRunReq extends Exception with ControlException
- class ShutdownReq extends Exception with ControlException
-
+ object CancelActionReq extends ControlThrowable
+ object FreshRunReq extends ControlThrowable
+ object ShutdownReq extends ControlThrowable
}