From caf1ce3b35ea0c3d0b1221346100e0d345807b92 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Mon, 5 Dec 2022 08:14:42 -0800 Subject: [PATCH] ROLLBACK_OF: Stop serializing the Class within Google (for now) PiperOrigin-RevId: 493011985 --- .../main/java/com/google/protobuf/GeneratedMessageLite.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java b/java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java index 55d6dc9726..56a6fc3819 100644 --- a/java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java +++ b/java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java @@ -1430,6 +1430,7 @@ public abstract class GeneratedMessageLite< // since v3.6.1 private final Class messageClass; + // only included for backwards compatibility before messageClass was added private final String messageClassName; private final byte[] asBytes; @@ -1440,7 +1441,7 @@ public abstract class GeneratedMessageLite< */ SerializedForm(MessageLite regularForm) { messageClass = regularForm.getClass(); - messageClassName = regularForm.getClass().getName(); + messageClassName = messageClass.getName(); asBytes = regularForm.toByteArray(); }