Scala 2.13.0 rc2 (#26967)

This commit is contained in:
Arnout Engelen 2019-05-24 08:11:50 +02:00 committed by Patrik Nordwall
parent 24a3bba135
commit 814cfa286c
168 changed files with 396 additions and 315 deletions

View file

@ -34,7 +34,7 @@ object AtLeastOnceDelivery {
* Java API
*/
def getUnconfirmedDeliveries: java.util.List[UnconfirmedDelivery] = {
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
unconfirmedDeliveries.asJava
}
@ -50,7 +50,7 @@ object AtLeastOnceDelivery {
* Java API
*/
def getUnconfirmedDeliveries: java.util.List[UnconfirmedDelivery] = {
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
unconfirmedDeliveries.asJava
}
}

View file

@ -482,6 +482,9 @@ abstract class AbstractPersistentFSM[S <: FSMState, D, E]
* Used for identifying domain events during recovery
*/
def domainEventClass: Class[E]
// workaround, possibly for https://github.com/scala/bug/issues/11512
override def receive: Receive = super.receive
}
/**
@ -490,6 +493,7 @@ abstract class AbstractPersistentFSM[S <: FSMState, D, E]
* Persistent Finite State Machine actor abstract base class with FSM Logging
*
*/
@silent
abstract class AbstractPersistentLoggingFSM[S <: FSMState, D, E]
extends AbstractPersistentFSM[S, D, E]
with LoggingPersistentFSM[S, D, E]

View file

@ -518,6 +518,7 @@ trait PersistentFSMBase[S, D, E] extends Actor with Listeners with ActorLogging
* so override that one if `onTermination` shall not be called during
* restart.
*/
@throws(classOf[Exception])
override def postStop(): Unit = {
/*
* setting this instances state to terminated does no harm during restart

View file

@ -162,14 +162,14 @@ private[akka] object EventAdapters {
.to(immutable.Seq)
private final def configToMap(config: Config, path: String): Map[String, String] = {
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
if (config.hasPath(path)) {
config.getConfig(path).root.unwrapped.asScala.toMap.map { case (k, v) => k -> v.toString }
} else Map.empty
}
private final def configToListMap(config: Config, path: String): Map[String, immutable.Seq[String]] = {
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
if (config.hasPath(path)) {
config.getConfig(path).root.unwrapped.asScala.toMap.map {
case (k, v: util.ArrayList[_]) if v.isInstanceOf[util.ArrayList[_]] => k -> v.asScala.map(_.toString).toList

View file

@ -4,7 +4,7 @@
package akka.persistence.journal
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
/**
* The journal may support tagging of events that are used by the

View file

@ -21,7 +21,7 @@ abstract class AsyncRecovery extends SAsyncReplay with AsyncRecoveryPlugin { thi
replayCallback: (PersistentRepr) => Unit) =
doAsyncReplayMessages(persistenceId, fromSequenceNr, toSequenceNr, max, new Consumer[PersistentRepr] {
def accept(p: PersistentRepr) = replayCallback(p)
}).map(Unit.unbox)
}).map(_ => ())
final def asyncReadHighestSequenceNr(persistenceId: String, fromSequenceNr: Long): Future[Long] =
doAsyncReadHighestSequenceNr(persistenceId, fromSequenceNr: Long).map(_.longValue)

View file

@ -5,7 +5,7 @@
package akka.persistence.journal.japi
import scala.collection.immutable
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
import akka.persistence._
import akka.persistence.journal.{ AsyncWriteJournal => SAsyncWriteJournal }
import akka.util.ccompat._
@ -32,5 +32,5 @@ abstract class AsyncWriteJournal extends AsyncRecovery with SAsyncWriteJournal w
}
final def asyncDeleteMessagesTo(persistenceId: String, toSequenceNr: Long) =
doAsyncDeleteMessagesTo(persistenceId, toSequenceNr).map(Unit.unbox)
doAsyncDeleteMessagesTo(persistenceId, toSequenceNr).map(_ => ())
}

View file

@ -14,7 +14,7 @@ import akka.serialization.SerializationExtension
import org.iq80.leveldb._
import scala.collection.immutable
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
import scala.util._
import scala.concurrent.Future
import scala.util.control.NonFatal
@ -52,8 +52,11 @@ private[persistence] trait LeveldbStore
override val compactionIntervals: Map[String, Long] =
LeveldbStore.toCompactionIntervalMap(config.getObject("compaction-intervals"))
import com.github.ghik.silencer.silent
@silent
private val persistenceIdSubscribers = new mutable.HashMap[String, mutable.Set[ActorRef]]
with mutable.MultiMap[String, ActorRef]
@silent
private val tagSubscribers = new mutable.HashMap[String, mutable.Set[ActorRef]]
with mutable.MultiMap[String, ActorRef]
private var allPersistenceIdsSubscribers = Set.empty[ActorRef]

View file

@ -113,7 +113,7 @@ class MessageSerializer(val system: ExtendedActorSystem) extends BaseSerializer
def atLeastOnceDeliverySnapshot(
atLeastOnceDeliverySnapshot: mf.AtLeastOnceDeliverySnapshot): AtLeastOnceDeliverySnapshot = {
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
val unconfirmedDeliveries = new VectorBuilder[UnconfirmedDelivery]()
atLeastOnceDeliverySnapshot.getUnconfirmedDeliveriesList().iterator().asScala.foreach { next =>
unconfirmedDeliveries += UnconfirmedDelivery(
@ -205,7 +205,7 @@ class MessageSerializer(val system: ExtendedActorSystem) extends BaseSerializer
}
private def atomicWrite(atomicWrite: mf.AtomicWrite): AtomicWrite = {
import scala.collection.JavaConverters._
import akka.util.ccompat.JavaConverters._
AtomicWrite(atomicWrite.getPayloadList.asScala.iterator.map(persistent).to(immutable.IndexedSeq))
}

View file

@ -22,7 +22,7 @@ abstract class SnapshotStore extends SSnapshotStore with SnapshotStorePlugin {
doLoadAsync(persistenceId, criteria).map(option)
override final def saveAsync(metadata: SnapshotMetadata, snapshot: Any): Future[Unit] =
doSaveAsync(metadata, snapshot).map(Unit.unbox)
doSaveAsync(metadata, snapshot).map(_ => ())
override final def deleteAsync(metadata: SnapshotMetadata): Future[Unit] =
doDeleteAsync(metadata).map(_ => ())