fix byte order issue in DaemonMsgCreateSerializer, #22366

* We used the Array based toBinary but the ByteBuffer based fromBinary.
  and IntSerializer is only using the same format for those when the byte order
  is  LITTLE_ENDIAN, which we didn't get from protbuf's asReadOnlyByteBuffer
* We can use the Array based methods in DaemonMsgCreateSerializer,
  performance is not important here
* Added some more testing in PrimitivesSerializationSpec
This commit is contained in:
Patrik Nordwall 2017-02-22 13:41:24 +01:00
parent 94afbee179
commit 20e43ccd40
2 changed files with 35 additions and 53 deletions

View file

@ -110,10 +110,10 @@ private[akka] final class DaemonMsgCreateSerializer(val system: ExtendedActorSys
val manifest =
if (protoProps.getHasManifest(idx)) protoProps.getManifests(idx)
else ""
serialization.deserializeByteBuffer(
protoProps.getArgs(idx).asReadOnlyByteBuffer(),
serialization.deserialize(
protoProps.getArgs(idx).toByteArray(),
protoProps.getSerializerIds(idx),
manifest)
manifest).get
}
} else {
// message from an older node, which only provides data and class name