mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 12:05:50 +00:00
Make type conversions explicit. (#7595)
As Java does not support unsigned integer types, the value types are "rounded up" (an uint32 is represented as a long) but persisted correctly (an uint32 is persisted as 4 bytes). This CL makes a cast operation explicit so that the compiler does not throw warning messages. Co-authored-by: Dominic Battre <battre@chromium.org> Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
@@ -1893,6 +1893,7 @@ class JavaGenerator : public BaseGenerator {
|
||||
}
|
||||
} else {
|
||||
code += " " + name + " = ";
|
||||
code += SourceCast(field_type);
|
||||
code += "_o";
|
||||
for (size_t i = 0; i < array_lengths.size(); ++i) {
|
||||
code += "." + namer_.Method("get", array_lengths[i].name) + "()";
|
||||
|
||||
Reference in New Issue
Block a user