aboutsummaryrefslogtreecommitdiffstats
path: root/src/google/protobuf/compiler/javanano/javanano_enum.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/compiler/javanano/javanano_enum.cc')
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_enum.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/google/protobuf/compiler/javanano/javanano_enum.cc b/src/google/protobuf/compiler/javanano/javanano_enum.cc
index 6ba25eb..66b671b 100644
--- a/src/google/protobuf/compiler/javanano/javanano_enum.cc
+++ b/src/google/protobuf/compiler/javanano/javanano_enum.cc
@@ -82,7 +82,7 @@ void EnumGenerator::Generate(io::Printer* printer) {
}
for (int i = 0; i < canonical_values_.size(); i++) {
map<string, string> vars;
- vars["name"] = canonical_values_[i]->name();
+ vars["name"] = RenameJavaKeywords(canonical_values_[i]->name());
vars["canonical_value"] = SimpleItoa(canonical_values_[i]->number());
printer->Print(vars,
"public static final int $name$ = $canonical_value$;\n");
@@ -92,7 +92,7 @@ void EnumGenerator::Generate(io::Printer* printer) {
for (int i = 0; i < aliases_.size(); i++) {
map<string, string> vars;
- vars["name"] = aliases_[i].value->name();
+ vars["name"] = RenameJavaKeywords(aliases_[i].value->name());
vars["canonical_name"] = aliases_[i].canonical_value->name();
printer->Print(vars,
"public static final int $name$ = $canonical_name$;\n");