diff options
author | Jisi Liu <jisi.liu@gmail.com> | 2015-02-17 21:15:20 -0800 |
---|---|---|
committer | Jisi Liu <jisi.liu@gmail.com> | 2015-02-19 16:43:07 -0800 |
commit | c72d3d51ff70944d7f9f5f8b1173920ca246d5b3 (patch) | |
tree | 5ff42e4eb7df0dc0316fdd0b0d946c90a0b8f0e3 /src/google/protobuf/compiler/javanano/javanano_field.cc | |
parent | 7794a98ff43776491d4f3434ea3ec32c8146970a (diff) |
Oneof message level elements (consts, case getter/clear) and messsage type field oneof support.
Diffstat (limited to 'src/google/protobuf/compiler/javanano/javanano_field.cc')
-rw-r--r-- | src/google/protobuf/compiler/javanano/javanano_field.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/google/protobuf/compiler/javanano/javanano_field.cc b/src/google/protobuf/compiler/javanano/javanano_field.cc index 2c7261f9..5565781c 100644 --- a/src/google/protobuf/compiler/javanano/javanano_field.cc +++ b/src/google/protobuf/compiler/javanano/javanano_field.cc @@ -159,11 +159,13 @@ void SetCommonOneofVariables(const FieldDescriptor* descriptor, (*variables)["oneof_index"] = SimpleItoa(descriptor->containing_oneof()->index()); (*variables)["set_oneof_case"] = - (*variables)["oneof_name"] + "Case_ = " + SimpleItoa(descriptor->number()); + "this." + (*variables)["oneof_name"] + + "Case_ = " + SimpleItoa(descriptor->number()); (*variables)["clear_oneof_case"] = - (*variables)["oneof_name"] + "Case_ = 0"; + "this." + (*variables)["oneof_name"] + "Case_ = 0"; (*variables)["has_oneof_case"] = - (*variables)["oneof_name"] + "Case_ == " + SimpleItoa(descriptor->number()); + "this." + (*variables)["oneof_name"] + "Case_ == " + + SimpleItoa(descriptor->number()); } } // namespace javanano |