From b0f194885e79960210dab17c6bc68674b1eab764 Mon Sep 17 00:00:00 2001 From: Jisi Liu Date: Thu, 5 Feb 2015 17:38:07 -0800 Subject: Rename empty bytes in JavaNano. --- javanano/src/main/java/com/google/protobuf/nano/InternalNano.java | 6 +++--- javanano/src/test/java/com/google/protobuf/nano/NanoTest.java | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'javanano/src') diff --git a/javanano/src/main/java/com/google/protobuf/nano/InternalNano.java b/javanano/src/main/java/com/google/protobuf/nano/InternalNano.java index 8b2c57ad..a9a459dd 100644 --- a/javanano/src/main/java/com/google/protobuf/nano/InternalNano.java +++ b/javanano/src/main/java/com/google/protobuf/nano/InternalNano.java @@ -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); } diff --git a/javanano/src/test/java/com/google/protobuf/nano/NanoTest.java b/javanano/src/test/java/com/google/protobuf/nano/NanoTest.java index d7de331f..4159e662 100644 --- a/javanano/src/test/java/com/google/protobuf/nano/NanoTest.java +++ b/javanano/src/test/java/com/google/protobuf/nano/NanoTest.java @@ -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 { -- cgit v1.2.3