Skip to content

Commit

Permalink
Update generated array style
Browse files Browse the repository at this point in the history
C-style array declarations (e.g. `Foo foos[]`) is discouraged by the JLS. Java style (e.g., `Foo[] foos`) should be preferred.
  • Loading branch information
kluever authored Dec 29, 2024
1 parent 0825ca3 commit 5e7e61d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/cpp/src/thrift/generate/t_java_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,7 @@ void t_java_generator::generate_java_struct_definition(ostream& out,
}

if (optionals > 0) {
std::string output_string = "private static final _Fields optionals[] = {";
std::string output_string = "private static final _Fields[] optionals = {";
for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
if ((*m_iter)->get_req() == t_field::T_OPTIONAL) {
output_string = output_string + "_Fields." + constant_name((*m_iter)->get_name()) + ",";
Expand Down

0 comments on commit 5e7e61d

Please sign in to comment.