aboutsummaryrefslogtreecommitdiffstats
path: root/src/google/protobuf/compiler/javanano/javanano_extension.cc
diff options
context:
space:
mode:
authorMax Cai <maxtroy@google.com>2013-10-14 16:28:08 +0100
committerMax Cai <maxtroy@google.com>2013-10-16 12:44:35 +0100
commit286271f75aa6ff1f3746379b77d6dc55415baa16 (patch)
treeee56a3bbe964262907ea8304307ba163baf589a5 /src/google/protobuf/compiler/javanano/javanano_extension.cc
parentafaf74ce55f4aff63dc30e7045a7cd6c1cf232dc (diff)
downloadexternal_protobuf-286271f75aa6ff1f3746379b77d6dc55415baa16.zip
external_protobuf-286271f75aa6ff1f3746379b77d6dc55415baa16.tar.gz
external_protobuf-286271f75aa6ff1f3746379b77d6dc55415baa16.tar.bz2
Make generated code more aligned with Google Java style.
- Blank line after opening a message class (but not an enum interface). - Let all code blocks insert blank lines before themselves. This applies to 'package' statement, all message classes, enum classes or constant groups, extensions, bitfields, proto fields (one block per field; i.e. accessors don't have blank lines among them), and basic MessageNano methods. In this case we don't need to guess what the next block is and create blank lines for it. - Fixed some newline/indent errors. - Only one SuppressWarnings("hiding") per file. Change-Id: I865f52ad4fb6ea3b3a98b97ac9d78d19fc46c858
Diffstat (limited to 'src/google/protobuf/compiler/javanano/javanano_extension.cc')
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_extension.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/google/protobuf/compiler/javanano/javanano_extension.cc b/src/google/protobuf/compiler/javanano/javanano_extension.cc
index a85645e..0bc9c9d 100644
--- a/src/google/protobuf/compiler/javanano/javanano_extension.cc
+++ b/src/google/protobuf/compiler/javanano/javanano_extension.cc
@@ -77,13 +77,15 @@ ExtensionGenerator::~ExtensionGenerator() {}
void ExtensionGenerator::Generate(io::Printer* printer) const {
if (descriptor_->is_repeated()) {
printer->Print(variables_,
- "// Extends $extends$\n"
+ "\n"
+ "// extends $extends$\n"
"public static final com.google.protobuf.nano.Extension<java.util.List<$type$>> $name$ = \n"
" com.google.protobuf.nano.Extension.createRepeated($number$,\n"
" new com.google.protobuf.nano.Extension.TypeLiteral<java.util.List<$type$>>(){});\n");
} else {
printer->Print(variables_,
- "// Extends $extends$\n"
+ "\n"
+ "// extends $extends$\n"
"public static final com.google.protobuf.nano.Extension<$type$> $name$ =\n"
" com.google.protobuf.nano.Extension.create($number$,\n"
" new com.google.protobuf.nano.Extension.TypeLiteral<$type$>(){});\n");