diff --git a/akka-core/src/test/scala/stm/RefSpec.scala b/akka-core/src/test/scala/stm/RefSpec.scala index f04c1a7c44..2a8d39a065 100644 --- a/akka-core/src/test/scala/stm/RefSpec.scala +++ b/akka-core/src/test/scala/stm/RefSpec.scala @@ -11,7 +11,7 @@ class RefSpec extends WordSpec with MustMatchers { "optionally accept an initial value" in { val emptyRef = Ref[Int] - val empty = atomic { emptyRef.getOption } + val empty = atomic { emptyRef.opt } empty must be(None) @@ -74,16 +74,6 @@ class RefSpec extends WordSpec with MustMatchers { value must be (3) } - "not be changeable using alter if no value has been set" in { - val ref = Ref[Int] - - def increment = atomic { - ref alter (_ + 1) - } - - evaluating { increment } must produce [RuntimeException] - } - "be able to be mapped" in { val ref1 = Ref(1) @@ -147,13 +137,13 @@ class RefSpec extends WordSpec with MustMatchers { for (value <- ref1 if value < 2) yield value } - val optLess2 = atomic { refLess2.getOption } + val optLess2 = atomic { refLess2.opt } val refGreater2 = atomic { for (value <- ref1 if value > 2) yield value } - val optGreater2 = atomic { refGreater2.getOption } + val optGreater2 = atomic { refGreater2.opt } optLess2 must be (Some(1)) optGreater2 must be (None) diff --git a/akka-persistence/akka-persistence-common/src/main/scala/Storage.scala b/akka-persistence/akka-persistence-common/src/main/scala/Storage.scala index a734d4d815..4519fc7ede 100644 --- a/akka-persistence/akka-persistence-common/src/main/scala/Storage.scala +++ b/akka-persistence/akka-persistence-common/src/main/scala/Storage.scala @@ -292,7 +292,7 @@ trait PersistentRef[T] extends Transactional with Committable with Abortable { ref.swap(elem) } - def get: Option[T] = if (ref.isDefined) ref.getOption else storage.getRefStorageFor(uuid) + def get: Option[T] = if (ref.isDefined) ref.opt else storage.getRefStorageFor(uuid) def isDefined: Boolean = ref.isDefined || storage.getRefStorageFor(uuid).isDefined diff --git a/akka-samples/akka-sample-ants/src/main/scala/Ants.scala b/akka-samples/akka-sample-ants/src/main/scala/Ants.scala index b1e5cee0b8..1fb0dea693 100644 --- a/akka-samples/akka-sample-ants/src/main/scala/Ants.scala +++ b/akka-samples/akka-sample-ants/src/main/scala/Ants.scala @@ -70,7 +70,7 @@ object World { private val snapshotFactory = TransactionFactory(readonly = true, familyName = "snapshot", hooks = false) - def snapshot = atomic(snapshotFactory) { Array.tabulate(Dim, Dim)(place(_, _).getOption) } + def snapshot = atomic(snapshotFactory) { Array.tabulate(Dim, Dim)(place(_, _).opt) } def place(loc: (Int, Int)) = places(loc._1)(loc._2)