= #17342 Make 2.4 binary compatible with 2.3
(cherry picked from commit89af8bdb90) * remove final identifier in serializers i* revert/deprecate ProtobufSerializer.ARRAY_OF_BYTE_ARRAY * adding back compatible empty constructor in serializers * make FSM.State compatible * add back ActorPath.ElementRegex * revert SocketOption changes and add SocketOptionV2 seea6d3704ef6* problem filter for ActorSystem and ActorPath * problem filter for ByteString * problem filter for deprecated Timeout methods * BalancingPool companion * ask * problem filter for ActorDSL * event bus * exclude hasSubscriptions * exclude some problems in testkit * boundAddress and addressFromSocketAddress * Pool nrOfInstances * PromiseActorRef * check with 2.3.9 * migration guide note * explicit exclude of final class problems
This commit is contained in:
parent
412491d277
commit
b30e460be7
50 changed files with 1037 additions and 202 deletions
|
|
@ -39,6 +39,17 @@ object ProtobufSerializer {
|
|||
*/
|
||||
class ProtobufSerializer(val system: ExtendedActorSystem) extends BaseSerializer {
|
||||
|
||||
@deprecated("Use constructor with ExtendedActorSystem", "2.4")
|
||||
def this() = this(null)
|
||||
|
||||
// TODO remove this when deprecated this() is removed
|
||||
override val identifier: Int =
|
||||
if (system eq null) 2
|
||||
else identifierFromConfig
|
||||
|
||||
@deprecated("Will be removed without replacement", "2.4")
|
||||
val ARRAY_OF_BYTE_ARRAY = Array[Class[_]](classOf[Array[Byte]])
|
||||
|
||||
private val parsingMethodBindingRef = new AtomicReference[Map[Class[_], Method]](Map.empty)
|
||||
|
||||
override def includeManifest: Boolean = true
|
||||
|
|
@ -52,8 +63,9 @@ class ProtobufSerializer(val system: ExtendedActorSystem) extends BaseSerializer
|
|||
parsingMethodBinding.get(clazz) match {
|
||||
case Some(cachedParsingMethod) ⇒ cachedParsingMethod
|
||||
case None ⇒
|
||||
import ProtobufSerializer.ARRAY_OF_BYTE_ARRAY
|
||||
val unCachedParsingMethod = if (method eq null) clazz.getDeclaredMethod("parseFrom", ARRAY_OF_BYTE_ARRAY: _*) else method
|
||||
val unCachedParsingMethod =
|
||||
if (method eq null) clazz.getDeclaredMethod("parseFrom", ProtobufSerializer.ARRAY_OF_BYTE_ARRAY: _*)
|
||||
else method
|
||||
if (parsingMethodBindingRef.compareAndSet(parsingMethodBinding, parsingMethodBinding.updated(clazz, unCachedParsingMethod)))
|
||||
unCachedParsingMethod
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue