When computing Group and Message size use getSerializedSize.
Bug: 6589939
Change-Id: I3050a99b08edf48301314163d41ea6f8080ffcdb
diff --git a/java/src/main/java/com/google/protobuf/micro/CodedOutputStreamMicro.java b/java/src/main/java/com/google/protobuf/micro/CodedOutputStreamMicro.java
index 0cb0774..dd722ba 100644
--- a/java/src/main/java/com/google/protobuf/micro/CodedOutputStreamMicro.java
+++ b/java/src/main/java/com/google/protobuf/micro/CodedOutputStreamMicro.java
@@ -674,7 +674,7 @@
* {@code group} field.
*/
public static int computeGroupSizeNoTag(final MessageMicro value) {
- return value.getCachedSize();
+ return value.getSerializedSize();
}
/**
@@ -682,7 +682,7 @@
* message field.
*/
public static int computeMessageSizeNoTag(final MessageMicro value) {
- final int size = value.getCachedSize();
+ final int size = value.getSerializedSize();
return computeRawVarint32Size(size) + size;
}