-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WiP building with 2.13.0-M4 #25267
WiP building with 2.13.0-M4 #25267
Changes from all commits
90ed975
32e3024
421ab59
acfc392
9986d73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,11 +140,11 @@ private[akka] class Deployer(val settings: ActorSystem.Settings, val dynamicAcce | |
case (key, value: String) ⇒ (key → value) | ||
}.toMap | ||
|
||
config.root.asScala flatMap { | ||
config.root.asScala.map { | ||
case ("default", _) ⇒ None | ||
case (key, value: ConfigObject) ⇒ parseConfig(key, value.toConfig) | ||
case _ ⇒ None | ||
} foreach deploy | ||
}.flatten.foreach(deploy(_)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That looks like a regression in 2.13. The previous code should compile without changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
def lookup(path: ActorPath): Option[Deploy] = lookup(path.elements.drop(1)) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,7 +115,7 @@ private[akka] trait DeathWatch { this: ActorCell ⇒ | |
// when all actor references have uid, i.e. actorFor is removed | ||
private def removeFromMap[T](subject: ActorRef, map: Map[ActorRef, T]): Map[ActorRef, T] = | ||
if (subject.path.uid != ActorCell.undefinedUid) (map - subject) - new UndefinedUidActorRef(subject) | ||
else map filterKeys (_.path != subject.path) | ||
else map filter { case (key, _) ⇒ key.path != subject.path } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another option would be to use |
||
|
||
private def updateWatching(ref: InternalActorRef, newMessage: Option[Any]): Unit = | ||
watching = watching.updated(ref, newMessage) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ import akka.actor._ | |
import akka.event.{ LogMarker, Logging, LoggingAdapter } | ||
import java.util.concurrent.ConcurrentHashMap | ||
|
||
import scala.collection.compat._ | ||
import scala.collection.mutable.ArrayBuffer | ||
import java.io.NotSerializableException | ||
|
||
|
@@ -400,7 +401,7 @@ class Serialization(val system: ExtendedActorSystem) extends Extension { | |
private val serializers: Map[String, Serializer] = { | ||
val fromConfig = for ((k: String, v: String) ← settings.Serializers) yield k → serializerOf(v).get | ||
val result = fromConfig ++ serializerDetails.map(d ⇒ d.alias → d.serializer) | ||
ensureOnlyAllowedSerializers(result.map { case (_, ser) ⇒ ser }(collection.breakOut)) | ||
ensureOnlyAllowedSerializers(result.map { case (_, ser) ⇒ ser }.iterator) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would suggest calling |
||
result | ||
} | ||
|
||
|
@@ -419,7 +420,7 @@ class Serialization(val system: ExtendedActorSystem) extends Extension { | |
} | ||
|
||
val result = sort(fromConfig ++ fromSettings) | ||
ensureOnlyAllowedSerializers(result.map { case (_, ser) ⇒ ser }(collection.breakOut)) | ||
ensureOnlyAllowedSerializers(result.map { case (_, ser) ⇒ ser }.iterator) | ||
result | ||
} | ||
|
||
|
@@ -447,7 +448,7 @@ class Serialization(val system: ExtendedActorSystem) extends Extension { | |
case x ⇒ buf insert (x, ca) | ||
} | ||
buf | ||
}).to[immutable.Seq] | ||
}).to(immutable.Seq) | ||
|
||
/** | ||
* serializerMap is a Map whose keys is the class that is serializable and values is the serializer | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import java.nio.{ ByteBuffer, ByteOrder } | |
|
||
import scala.annotation.tailrec | ||
import scala.collection.LinearSeq | ||
import scala.collection.compat._ | ||
import scala.collection.mutable.ListBuffer | ||
import scala.reflect.ClassTag | ||
|
||
|
@@ -33,7 +34,7 @@ object ByteIterator { | |
@inline final def head: Byte = array(from) | ||
|
||
final def next(): Byte = { | ||
if (!hasNext) Iterator.empty.next | ||
if (!hasNext) Iterator.empty.next() | ||
else { val i = from; from = from + 1; array(i) } | ||
} | ||
|
||
|
@@ -106,7 +107,7 @@ object ByteIterator { | |
if (n <= this.len) { | ||
Array.copy(this.array, this.from, xs, offset, n) | ||
this.drop(n) | ||
} else Iterator.empty.next | ||
} else Iterator.empty.next() | ||
} | ||
|
||
private def wrappedByteBuffer: ByteBuffer = ByteBuffer.wrap(array, from, len).asReadOnlyBuffer | ||
|
@@ -229,7 +230,7 @@ object ByteIterator { | |
} | ||
|
||
final override def clone: MultiByteArrayIterator = { | ||
val clonedIterators: List[ByteArrayIterator] = iterators.map(_.clone)(collection.breakOut) | ||
val clonedIterators: List[ByteArrayIterator] = iterators.iterator.map(_.clone).to(List) | ||
new MultiByteArrayIterator(clonedIterators) | ||
} | ||
|
||
|
@@ -443,9 +444,9 @@ abstract class ByteIterator extends BufferedIterator[Byte] { | |
if (found) index else -1 | ||
} | ||
|
||
def indexOf(elem: Byte): Int = indexWhere { _ == elem } | ||
def indexOf(elem: Byte): Int = indexWhere { (_: Byte) == elem } | ||
|
||
override def indexOf[B >: Byte](elem: B): Int = indexWhere { _ == elem } | ||
override def indexOf[B >: Byte](elem: B): Int = indexWhere { (_: Byte) == elem } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Weird that the explicit type was needed here, given the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’m fine with that. Being phased out anyway There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, more curious than a complaining. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @johanandren to satisfy your curiousity, this is because the indexOf function in 2.13 takes a default parameter. Morale of the story: Don't use default parameters. See scala/bug#10973 |
||
|
||
def toByteString: ByteString | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ import java.lang.{ Iterable ⇒ JIterable } | |
|
||
import scala.annotation.{ tailrec, varargs } | ||
import scala.collection.IndexedSeqOptimized | ||
import scala.collection.compat._ | ||
import scala.collection.mutable.{ Builder, WrappedArray } | ||
import scala.collection.immutable | ||
import scala.collection.immutable.{ IndexedSeq, VectorBuilder } | ||
|
@@ -145,8 +146,8 @@ object ByteString { | |
|
||
implicit val canBuildFrom: CanBuildFrom[TraversableOnce[Byte], Byte, ByteString] = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, we don't need separate sources for 2.13 and 2.12- here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes you do :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
new CanBuildFrom[TraversableOnce[Byte], Byte, ByteString] { | ||
def apply(ignore: TraversableOnce[Byte]): ByteStringBuilder = newBuilder | ||
def apply(): ByteStringBuilder = newBuilder | ||
def apply(ignore: TraversableOnce[Byte]): ByteStringBuilder = new ByteStringBuilder | ||
def apply(): ByteStringBuilder = new ByteStringBuilder | ||
} | ||
|
||
private[akka] object ByteString1C extends Companion { | ||
|
@@ -844,7 +845,7 @@ object CompactByteString { | |
*/ | ||
def apply[T](bytes: T*)(implicit num: Integral[T]): CompactByteString = { | ||
if (bytes.isEmpty) empty | ||
else ByteString.ByteString1C(bytes.map(x ⇒ num.toInt(x).toByte)(collection.breakOut)) | ||
else ByteString.ByteString1C(bytes.iterator.map(x ⇒ num.toInt(x).toByte).to(Array)) | ||
} | ||
|
||
/** | ||
|
@@ -997,14 +998,14 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] { | |
putByteArrayUnsafe(xs.array.clone) | ||
case seq: collection.IndexedSeq[Byte] if shouldResizeTempFor(seq.length) ⇒ | ||
val copied = new Array[Byte](seq.length) | ||
seq.copyToArray(copied) | ||
xs.copyToArray(copied, 0) | ||
|
||
clearTemp() | ||
_builder += ByteString.ByteString1(copied) | ||
_length += seq.length | ||
case seq: collection.IndexedSeq[_] ⇒ | ||
ensureTempSize(_tempLength + xs.size) | ||
xs.copyToArray(_temp, _tempLength) | ||
case seq: collection.IndexedSeq[Byte] ⇒ | ||
ensureTempSize(_tempLength + seq.size) | ||
seq.copyToArray(_temp, _tempLength) | ||
_tempLength += seq.length | ||
_length += seq.length | ||
case _ ⇒ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,13 +22,13 @@ resolverSettings | |
|
||
lazy val aggregatedProjects: Seq[ProjectReference] = Seq( | ||
actor, actorTests, | ||
agent, | ||
//agent, | ||
benchJmh, | ||
camel, | ||
cluster, clusterMetrics, clusterSharding, clusterTools, | ||
contrib, | ||
distributedData, | ||
docs, | ||
//docs, | ||
multiNodeTestkit, | ||
osgi, | ||
persistence, persistenceQuery, persistenceShared, persistenceTck, | ||
|
@@ -190,7 +190,7 @@ lazy val distributedData = akkaModule("akka-distributed-data") | |
|
||
lazy val docs = akkaModule("akka-docs") | ||
.dependsOn( | ||
actor, cluster, clusterMetrics, slf4j, agent, camel, osgi, persistenceTck, persistenceQuery, distributedData, stream, | ||
actor, cluster, clusterMetrics, slf4j, /*agent,*/ camel, osgi, persistenceTck, persistenceQuery, distributedData, stream, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we will need to deal with agent some how, jut not release it for 2.13+? |
||
clusterTools % "compile->compile;test->test", | ||
clusterSharding % "compile->compile;test->test", | ||
testkit % "compile->compile;test->test", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasn't the trick to use
elements.iterator
to avoid creating the "heavy" intermediate collection?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. if it were 2.13-only code you could use
.view
, but.iterator
is the cross-buildable solution