diff --git a/java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java b/java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java index 094bb6fe25479..2fe6c0060bc74 100644 --- a/java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java +++ b/java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java @@ -2095,7 +2095,7 @@ public void testStreamDecoderTryRefillBufferIterativeNoStackOverflow() throws Ex ByteArrayOutputStream baos = new ByteArrayOutputStream(); CodedOutputStream cos = CodedOutputStream.newInstance(baos); cos.writeTag(1, WireFormat.WIRETYPE_LENGTH_DELIMITED); - cos.writeRawVarint32(n); + cos.writeUInt32NoTag(n); cos.flush(); stringTagAndLength = baos.toByteArray(); } @@ -2103,7 +2103,7 @@ public void testStreamDecoderTryRefillBufferIterativeNoStackOverflow() throws Ex ByteArrayOutputStream unknownFieldBaos = new ByteArrayOutputStream(); CodedOutputStream unknownCos = CodedOutputStream.newInstance(unknownFieldBaos); unknownCos.writeTag(2, WireFormat.WIRETYPE_LENGTH_DELIMITED); - unknownCos.writeRawVarint32(n); + unknownCos.writeUInt32NoTag(n); unknownCos.flush(); int prefixLen = unknownFieldBaos.toByteArray().length; int padLength = n - stringTagAndLength.length - prefixLen; @@ -2111,7 +2111,7 @@ public void testStreamDecoderTryRefillBufferIterativeNoStackOverflow() throws Ex unknownFieldBaos.reset(); unknownCos = CodedOutputStream.newInstance(unknownFieldBaos); unknownCos.writeTag(2, WireFormat.WIRETYPE_LENGTH_DELIMITED); - unknownCos.writeRawVarint32(padLength); + unknownCos.writeUInt32NoTag(padLength); unknownCos.writeRawBytes(new byte[padLength]); unknownCos.writeRawBytes(stringTagAndLength); unknownCos.flush();