diff options
author | Brian Duff <bduff@google.com> | 2013-06-28 17:23:51 -0700 |
---|---|---|
committer | Brian Duff <bduff@google.com> | 2013-07-08 22:29:51 -0700 |
commit | 19641419a381509bddfc2d0b5d60a411b67b105b (patch) | |
tree | b1d4efef398e24b38285455a65aa2648cfffc884 /src/google | |
parent | 0a1429cc5ee4865550bcdddfae681a30cef58a5a (diff) | |
download | external_protobuf-19641419a381509bddfc2d0b5d60a411b67b105b.zip external_protobuf-19641419a381509bddfc2d0b5d60a411b67b105b.tar.gz external_protobuf-19641419a381509bddfc2d0b5d60a411b67b105b.tar.bz2 |
Make it possible to use MessageNano.mergeFrom without casting.
You can now do:
MyMessage foo = MessageNano.mergeFrom(new MyMessage(), bytes);
without having to cast the message returned from mergeFrom.
Change-Id: Ibb2ad327f75855d45352ad304c7f054f20dd29c9
Diffstat (limited to 'src/google')
-rw-r--r-- | src/google/protobuf/compiler/javanano/javanano_message.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/google/protobuf/compiler/javanano/javanano_message.cc b/src/google/protobuf/compiler/javanano/javanano_message.cc index 2740779..11fb452 100644 --- a/src/google/protobuf/compiler/javanano/javanano_message.cc +++ b/src/google/protobuf/compiler/javanano/javanano_message.cc @@ -362,7 +362,7 @@ GenerateParseFromMethods(io::Printer* printer) { printer->Print( "public $static$ $classname$ parseFrom(byte[] data)\n" " throws com.google.protobuf.nano.InvalidProtocolBufferNanoException {\n" - " return ($classname$) com.google.protobuf.nano.MessageNano.mergeFrom(new $classname$(), data);\n" + " return com.google.protobuf.nano.MessageNano.mergeFrom(new $classname$(), data);\n" "}\n" "\n" "public $static$ $classname$ parseFrom(\n" |