mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 20:15:34 +00:00
Fix LongEnum definitions (#7596)
The MyGame/Example/LongEnum.java class did not compile because Java expects an "L" suffix for literals of type long. This CL fixes the code generation to include such a suffix. Co-authored-by: Dominic Battre <battre@chromium.org>
This commit is contained in:
@@ -397,6 +397,10 @@ class JavaGenerator : public BaseGenerator {
|
||||
code += " ";
|
||||
code += namer_.Variant(ev) + " = ";
|
||||
code += enum_def.ToString(ev);
|
||||
if (enum_def.underlying_type.base_type == BASE_TYPE_LONG ||
|
||||
enum_def.underlying_type.base_type == BASE_TYPE_ULONG) {
|
||||
code += "L";
|
||||
}
|
||||
code += ";\n";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user