mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-15 16:57:29 +00:00
Fixed Java ByteBuffer accessors generated for non-scalar vectors.
Change-Id: I9787ab88e5bd4846d92995e2bb05d0c2121113ca Tested: on Linux.
This commit is contained in:
@@ -422,7 +422,9 @@ static void GenStruct(const LanguageParameters &lang, const Parser &parser,
|
||||
code += "Length(" + offset_prefix;
|
||||
code += "__vector_len(o) : 0; }\n";
|
||||
}
|
||||
if ((field.value.type.base_type == BASE_TYPE_VECTOR ||
|
||||
// Generate a ByteBuffer accessor for strings & vectors of scalars.
|
||||
if (((field.value.type.base_type == BASE_TYPE_VECTOR &&
|
||||
IsScalar(field.value.type.VectorType().base_type)) ||
|
||||
field.value.type.base_type == BASE_TYPE_STRING) &&
|
||||
lang.language == GeneratorOptions::kJava) {
|
||||
code += " public ByteBuffer ";
|
||||
|
||||
Reference in New Issue
Block a user