Commit a4dbe134 authored by Yuri Finkelstein's avatar Yuri Finkelstein Committed by Wouter van Oortmerssen

fixed java codegen bug documented in #4563 (#4565)

* grpc bindings generator for Java and a few minor supporting changes in improvements

* restored formatting before my previous changes for ease of review

* Fixed grpc java code generation bug resulting in duplicate extractor declarations in case the same is used in more than a single RPC method

* fixed previous merge issue

* removed extra space

* restored extra space

* restored extra space

* fixed java codegen bug documented in https://github.com/google/flatbuffers/issues/4563
parent 89711c9c
...@@ -1036,11 +1036,12 @@ class GeneralGenerator : public BaseGenerator { ...@@ -1036,11 +1036,12 @@ class GeneralGenerator : public BaseGenerator {
for (auto kit = fields.begin(); kit != fields.end(); ++kit) { for (auto kit = fields.begin(); kit != fields.end(); ++kit) {
auto &key_field = **kit; auto &key_field = **kit;
if (key_field.key) { if (key_field.key) {
code += " public " + sd.name + lang_.optional_suffix + " "; auto qualified_name = WrapInNameSpace(sd);
code += " public " + qualified_name + lang_.optional_suffix + " ";
code += MakeCamel(field.name, lang_.first_camel_upper) + "ByKey("; code += MakeCamel(field.name, lang_.first_camel_upper) + "ByKey(";
code += GenTypeNameDest(key_field.value.type) + " key)"; code += GenTypeNameDest(key_field.value.type) + " key)";
code += offset_prefix; code += offset_prefix;
code += sd.name + ".__lookup_by_key("; code += qualified_name + ".__lookup_by_key(";
code += lang_.accessor_prefix + "__vector(o), key, "; code += lang_.accessor_prefix + "__vector(o), key, ";
code += lang_.accessor_prefix + "bb) : null; "; code += lang_.accessor_prefix + "bb) : null; ";
code += "}\n"; code += "}\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment