Skip to content

Commit bb8cac5

Browse files
klueverJens-G
authored andcommitted
Update generated array style
C-style array declarations (e.g. `Foo foos[]`) is discouraged by the JLS. Java style (e.g., `Foo[] foos`) should be preferred.
1 parent 0825ca3 commit bb8cac5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/cpp/src/thrift/generate/t_java_generator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1629,7 +1629,7 @@ void t_java_generator::generate_java_struct_definition(ostream& out,
16291629
}
16301630

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

0 commit comments

Comments
 (0)