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.
diff --git a/compiler/cpp/src/thrift/generate/t_java_generator.cc b/compiler/cpp/src/thrift/generate/t_java_generator.cc
index e81744e..d944e26 100644
--- a/compiler/cpp/src/thrift/generate/t_java_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_java_generator.cc
@@ -1629,7 +1629,7 @@
}
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()) + ",";