Additional feedback, thanks.

This commit is contained in:
Patrik Nordwall 2011-12-20 10:08:53 +01:00
parent fb510d5018
commit d87d9e2e80
2 changed files with 4 additions and 3 deletions

View file

@ -389,8 +389,8 @@ class CustomMailboxType(mailboxFQN: String) extends MailboxType {
override def create(receiver: ActorContext): Mailbox = { override def create(receiver: ActorContext): Mailbox = {
val constructorSignature = Array[Class[_]](classOf[ActorContext]) val constructorSignature = Array[Class[_]](classOf[ActorContext])
ReflectiveAccess.createInstance[AnyRef](mailboxFQN, constructorSignature, Array[AnyRef](receiver)) match { ReflectiveAccess.createInstance[Mailbox](mailboxFQN, constructorSignature, Array[AnyRef](receiver)) match {
case Right(instance) instance.asInstanceOf[Mailbox] case Right(instance) instance
case Left(exception) case Left(exception)
throw new IllegalArgumentException("Cannot instantiate mailbox [%s] due to: %s". throw new IllegalArgumentException("Cannot instantiate mailbox [%s] due to: %s".
format(mailboxFQN, exception.toString)) format(mailboxFQN, exception.toString))

View file

@ -100,7 +100,8 @@ object ReflectiveAccess {
* Unwraps `InvocationTargetException` if its getTargetException is an `Exception`. * Unwraps `InvocationTargetException` if its getTargetException is an `Exception`.
* Other `Throwable`, such as `Error` is thrown. * Other `Throwable`, such as `Error` is thrown.
*/ */
private def withErrorHandling[T](body: Either[Exception, T]): Either[Exception, T] = { @inline
private final def withErrorHandling[T](body: Either[Exception, T]): Either[Exception, T] = {
try { try {
body body
} catch { } catch {