switch to AbstractPartialFunction, see #2357
This commit is contained in:
parent
0f923c0978
commit
bf49b75d5e
2 changed files with 5 additions and 5 deletions
|
|
@ -729,12 +729,12 @@ trait DefaultTimeout { this: TestKit ⇒
|
|||
* This class is used internal to JavaTestKit and should not be extended
|
||||
* by client code directly.
|
||||
*/
|
||||
private[testkit] abstract class CachingPartialFunction[A, B <: AnyRef] extends scala.runtime.AbstractFunction1[A, B] with PartialFunction[A, B] {
|
||||
private[testkit] abstract class CachingPartialFunction[A, B <: AnyRef] extends scala.runtime.AbstractPartialFunction[A, B] {
|
||||
import akka.japi.JavaPartialFunction._
|
||||
|
||||
def `match`(x: A): B
|
||||
|
||||
var cache: B = _
|
||||
final def isDefinedAt(x: A): Boolean = try { cache = `match`(x); true } catch { case NoMatch ⇒ cache = null.asInstanceOf[B]; false }
|
||||
final def apply(x: A): B = cache
|
||||
final override def apply(x: A): B = cache
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue