Commit b0f19488 authored by Jisi Liu's avatar Jisi Liu

Rename empty bytes in JavaNano.

parent cd99c12d
......@@ -352,13 +352,13 @@ public final class InternalNano {
}
return result;
}
private static final byte[] emptyBytes = new byte[0];
private static final byte[] EMPTY_BYTES = new byte[0];
private static Object primitiveDefaultValue(int type) {
switch (type) {
case TYPE_BOOL:
return Boolean.FALSE;
case TYPE_BYTES:
return emptyBytes;
return EMPTY_BYTES;
case TYPE_STRING:
return "";
case TYPE_FLOAT:
......@@ -443,7 +443,7 @@ public final class InternalNano {
}
if (value == null) {
// message type
// message type value will be initialized by code-gen.
value = (V) primitiveDefaultValue(valueType);
}
......
......@@ -3742,7 +3742,6 @@ public class NanoTest extends TestCase {
byte[] output = MessageNano.toByteArray(origin);
TestMap parsed = new TestMap();
MessageNano.mergeFrom(parsed, output);
// TODO(liujisi): Test missing key/value in parsing.
}
public void testMapSerializeRejectNull() throws Exception {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment