Fixed bug in convenient constructors for Java/C#

Also fixed Go unit tests not being up to date with recent schema
changes.

Change-Id: I42e619f9c5ea05f6f937c68a5c8a92462c46bce3
Tested: on Linux and Windows.
This commit is contained in:
Wouter van Oortmerssen
2014-09-25 15:53:56 -07:00
parent 730c0cadde
commit 18cf19f876
12 changed files with 172 additions and 25 deletions

View File

@@ -463,7 +463,7 @@ static void GenStruct(const LanguageParameters &lang, const Parser &parser,
if (has_no_struct_fields && num_fields) {
// Generate a table constructor of the form:
// public static void createName(FlatBufferBuilder builder, args...)
code += " public static void " + FunctionStart(lang, 'C') + "reate";
code += " public static int " + FunctionStart(lang, 'C') + "reate";
code += struct_def.name;
code += "(FlatBufferBuilder builder";
for (auto it = struct_def.fields.vec.begin();
@@ -495,8 +495,9 @@ static void GenStruct(const LanguageParameters &lang, const Parser &parser,
}
}
}
code += " builder.";
code += FunctionStart(lang, 'E') + "ndObject();\n }\n\n";
code += " return " + struct_def.name + ".";
code += FunctionStart(lang, 'E') + "nd" + struct_def.name;
code += "(builder);\n }\n\n";
}
// Generate a set of static methods that allow table construction,
// of the form: