diff --git a/akka-actor/src/main/scala/akka/japi/JavaAPI.scala b/akka-actor/src/main/scala/akka/japi/JavaAPI.scala index b8baf5ffda..5ab556d82c 100644 --- a/akka-actor/src/main/scala/akka/japi/JavaAPI.scala +++ b/akka-actor/src/main/scala/akka/japi/JavaAPI.scala @@ -14,6 +14,7 @@ import scala.util.control.NoStackTrace * A Function interface. Used to create first-class-functions is Java. */ trait Function[T, R] { + @throws(classOf[Exception]) def apply(param: T): R } @@ -21,6 +22,7 @@ trait Function[T, R] { * A Function interface. Used to create 2-arg first-class-functions is Java. */ trait Function2[T1, T2, R] { + @throws(classOf[Exception]) def apply(arg1: T1, arg2: T2): R } @@ -28,6 +30,7 @@ trait Function2[T1, T2, R] { * A Procedure is like a Function, but it doesn't produce a return value. */ trait Procedure[T] { + @throws(classOf[Exception]) def apply(param: T): Unit } @@ -35,6 +38,7 @@ trait Procedure[T] { * An executable piece of code that takes no parameters and doesn't return any value. */ trait Effect { + @throws(classOf[Exception]) def apply(): Unit } @@ -45,6 +49,7 @@ trait Creator[T] { /** * This method must return a different instance upon every call. */ + @throws(classOf[Exception]) def create(): T } @@ -93,6 +98,7 @@ object PurePartialFunction { abstract class PurePartialFunction[A, B] extends scala.runtime.AbstractFunction1[A, B] with PartialFunction[A, B] { import PurePartialFunction._ + @throws(classOf[Exception]) def apply(x: A, isCheck: Boolean): B final def isDefinedAt(x: A): Boolean = try { apply(x, true); true } catch { case NoMatch ⇒ false }