You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ct...@apache.org on 2022/04/12 03:58:34 UTC

[thrift] branch master updated: THRIFT-5552 apply clang-format to java generator

This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new 2f6ddc914 THRIFT-5552 apply clang-format to java generator
2f6ddc914 is described below

commit 2f6ddc91456aaa18e017ba1aa95dbd5f98525fce
Author: Jiayu Liu <Ji...@users.noreply.github.com>
AuthorDate: Tue Apr 12 11:58:27 2022 +0800

    THRIFT-5552 apply clang-format to java generator
    
    Format only: `clang-format -i compiler/cpp/src/thrift/generate/t_java_generator.cc`
    This is a subset of `make style` for this one file only
    This closes PR #2560
---
 .../cpp/src/thrift/generate/t_java_generator.cc    | 666 ++++++++++++---------
 1 file changed, 373 insertions(+), 293 deletions(-)

diff --git a/compiler/cpp/src/thrift/generate/t_java_generator.cc b/compiler/cpp/src/thrift/generate/t_java_generator.cc
index f43cf5f7b..87ec49079 100644
--- a/compiler/cpp/src/thrift/generate/t_java_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_java_generator.cc
@@ -20,20 +20,20 @@
 #include <cassert>
 #include <ctime>
 
-#include <sstream>
-#include <string>
+#include <cctype>
 #include <fstream>
 #include <iomanip>
 #include <iostream>
 #include <limits>
+#include <sstream>
+#include <string>
 #include <vector>
-#include <cctype>
 
-#include <sys/stat.h>
 #include <stdexcept>
+#include <sys/stat.h>
 
-#include "thrift/platform.h"
 #include "thrift/generate/t_oop_generator.h"
+#include "thrift/platform.h"
 
 using std::map;
 using std::ostream;
@@ -69,44 +69,46 @@ public:
     java5_ = false;
     reuse_objects_ = false;
     use_option_type_ = false;
-    undated_generated_annotations_  = false;
+    undated_generated_annotations_ = false;
     suppress_generated_annotations_ = false;
     rethrow_unhandled_exceptions_ = false;
     unsafe_binaries_ = false;
-    for( iter = parsed_options.begin(); iter != parsed_options.end(); ++iter) {
-      if( iter->first.compare("beans") == 0) {
+    for (iter = parsed_options.begin(); iter != parsed_options.end(); ++iter) {
+      if (iter->first.compare("beans") == 0) {
         bean_style_ = true;
-      } else if( iter->first.compare("android") == 0) {
+      } else if (iter->first.compare("android") == 0) {
         android_style_ = true;
-      } else if( iter->first.compare("private_members") == 0 || iter->first.compare("private-members") == 0) {
+      } else if (iter->first.compare("private_members") == 0
+                 || iter->first.compare("private-members") == 0) {
         // keep both private_members and private-members (legacy) for backwards compatibility
         private_members_ = true;
-      } else if( iter->first.compare("nocamel") == 0) {
+      } else if (iter->first.compare("nocamel") == 0) {
         nocamel_style_ = true;
-      } else if( iter->first.compare("fullcamel") == 0) {
+      } else if (iter->first.compare("fullcamel") == 0) {
         fullcamel_style_ = true;
-      } else if( iter->first.compare("android_legacy") == 0) {
+      } else if (iter->first.compare("android_legacy") == 0) {
         android_legacy_ = true;
-      } else if( iter->first.compare("sorted_containers") == 0) {
+      } else if (iter->first.compare("sorted_containers") == 0) {
         sorted_containers_ = true;
-      } else if( iter->first.compare("java5") == 0) {
+      } else if (iter->first.compare("java5") == 0) {
         java5_ = true;
-      } else if( iter->first.compare("reuse_objects") == 0 || iter->first.compare("reuse-objects") == 0) {
+      } else if (iter->first.compare("reuse_objects") == 0
+                 || iter->first.compare("reuse-objects") == 0) {
         // keep both reuse_objects and reuse-objects (legacy) for backwards compatibility
         reuse_objects_ = true;
-      } else if( iter->first.compare("option_type") == 0) {
+      } else if (iter->first.compare("option_type") == 0) {
         use_option_type_ = true;
-      } else if( iter->first.compare("rethrow_unhandled_exceptions") == 0) {
+      } else if (iter->first.compare("rethrow_unhandled_exceptions") == 0) {
         rethrow_unhandled_exceptions_ = true;
-      } else if( iter->first.compare("generated_annotations") == 0) {
-        if( iter->second.compare("undated") == 0) {
-          undated_generated_annotations_  = true;
-        } else if(iter->second.compare("suppress") == 0) {
+      } else if (iter->first.compare("generated_annotations") == 0) {
+        if (iter->second.compare("undated") == 0) {
+          undated_generated_annotations_ = true;
+        } else if (iter->second.compare("suppress") == 0) {
           suppress_generated_annotations_ = true;
         } else {
           throw "unknown option java:" + iter->first + "=" + iter->second;
         }
-      } else if( iter->first.compare("unsafe_binaries") == 0) {
+      } else if (iter->first.compare("unsafe_binaries") == 0) {
         unsafe_binaries_ = true;
       } else {
         throw "unknown option java:" + iter->first;
@@ -417,7 +419,6 @@ private:
   bool suppress_generated_annotations_;
   bool rethrow_unhandled_exceptions_;
   bool unsafe_binaries_;
-
 };
 
 /**
@@ -470,8 +471,7 @@ string t_java_generator::java_nullable_annotation() {
 /**
  * Nothing in Java
  */
-void t_java_generator::close_generator() {
-}
+void t_java_generator::close_generator() {}
 
 /**
  * Generates a typedef. This is not done in Java, since it does
@@ -589,8 +589,8 @@ void t_java_generator::generate_consts(std::vector<t_const*> consts) {
     return;
   }
 
-  string f_consts_name = package_dir_ + '/' + make_valid_java_filename(program_name_)
-                         + "Constants.java";
+  string f_consts_name
+      = package_dir_ + '/' + make_valid_java_filename(program_name_) + "Constants.java";
   ofstream_with_content_based_conditional_update f_consts;
   f_consts.open(f_consts_name.c_str());
 
@@ -603,18 +603,14 @@ void t_java_generator::generate_consts(std::vector<t_const*> consts) {
   vector<t_const*>::iterator c_iter;
   for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
     generate_java_doc(f_consts, (*c_iter));
-    print_const_value(f_consts,
-                      (*c_iter)->get_name(),
-                      (*c_iter)->get_type(),
-                      (*c_iter)->get_value(),
-                      false);
+    print_const_value(f_consts, (*c_iter)->get_name(), (*c_iter)->get_type(),
+                      (*c_iter)->get_value(), false);
   }
   indent_down();
   indent(f_consts) << "}" << endl;
   f_consts.close();
 }
 
-
 /**
  * Prints the value of a constant with the given type. Note that type checking
  * is NOT performed in this function as it is always run beforehand using the
@@ -674,7 +670,8 @@ void t_java_generator::print_const_value(std::ostream& out,
     if (is_enum_map(type)) {
       constructor_args = inner_enum_type_name(type);
     }
-    out << name << " = new " << type_name(type, false, true) << "(" << constructor_args << ");" << endl;
+    out << name << " = new " << type_name(type, false, true) << "(" << constructor_args << ");"
+        << endl;
     if (!in_static) {
       indent(out) << "static {" << endl;
       indent_up();
@@ -695,7 +692,8 @@ void t_java_generator::print_const_value(std::ostream& out,
     out << endl;
   } else if (type->is_list() || type->is_set()) {
     if (is_enum_set(type)) {
-      out << name << " = " << type_name(type, false, true, true) << ".noneOf(" << inner_enum_type_name(type) << ");" << endl;
+      out << name << " = " << type_name(type, false, true, true) << ".noneOf("
+          << inner_enum_type_name(type) << ");" << endl;
     } else {
       out << name << " = new " << type_name(type, false, true) << "();" << endl;
     }
@@ -809,8 +807,8 @@ void t_java_generator::generate_xception(t_struct* txception) {
  */
 void t_java_generator::generate_java_struct(t_struct* tstruct, bool is_exception) {
   // Make output file
-  string f_struct_name = package_dir_ + "/" + make_valid_java_filename(tstruct->get_name())
-                         + ".java";
+  string f_struct_name
+      = package_dir_ + "/" + make_valid_java_filename(tstruct->get_name()) + ".java";
   ofstream_with_content_based_conditional_update f_struct;
   f_struct.open(f_struct_name.c_str());
 
@@ -827,8 +825,8 @@ void t_java_generator::generate_java_struct(t_struct* tstruct, bool is_exception
  */
 void t_java_generator::generate_java_union(t_struct* tstruct) {
   // Make output file
-  string f_struct_name = package_dir_ + "/" + make_valid_java_filename(tstruct->get_name())
-                         + ".java";
+  string f_struct_name
+      = package_dir_ + "/" + make_valid_java_filename(tstruct->get_name()) + ".java";
   ofstream_with_content_based_conditional_update f_struct;
   f_struct.open(f_struct_name.c_str());
 
@@ -926,7 +924,8 @@ void t_java_generator::generate_union_constructor(ostream& out, t_struct* tstruc
   indent_down();
   indent(out) << "}" << endl << endl;
 
-  indent(out) << "public " << type_name(tstruct) << "(_Fields setField, java.lang.Object value) {" << endl;
+  indent(out) << "public " << type_name(tstruct) << "(_Fields setField, java.lang.Object value) {"
+              << endl;
   indent(out) << "  super(setField, value);" << endl;
   indent(out) << "}" << endl << endl;
 
@@ -955,9 +954,9 @@ void t_java_generator::generate_union_constructor(ostream& out, t_struct* tstruc
       indent(out) << "  " << type_name(tstruct) << " x = new " << type_name(tstruct) << "();"
                   << endl;
       indent(out) << "  x.set" << get_cap_name((*m_iter)->get_name());
-      if(unsafe_binaries_) {
+      if (unsafe_binaries_) {
         indent(out) << "(java.nio.ByteBuffer.wrap(value));" << endl;
-      }else{
+      } else {
         indent(out) << "(java.nio.ByteBuffer.wrap(value.clone()));" << endl;
       }
       indent(out) << "  return x;" << endl;
@@ -991,7 +990,8 @@ void t_java_generator::generate_union_getters_and_setters(ostream& out, t_struct
       indent(out) << "public byte[] get" << cap_name << "() {" << endl;
       indent(out) << "  set" << cap_name << "(org.apache.thrift.TBaseHelper.rightSize(buffer"
                   << get_cap_name("for") << cap_name << "()));" << endl;
-      indent(out) << "  java.nio.ByteBuffer b = buffer" << get_cap_name("for") << cap_name << "();" << endl;
+      indent(out) << "  java.nio.ByteBuffer b = buffer" << get_cap_name("for") << cap_name << "();"
+                  << endl;
       indent(out) << "  return b == null ? null : b.array();" << endl;
       indent(out) << "}" << endl;
 
@@ -1002,18 +1002,18 @@ void t_java_generator::generate_union_getters_and_setters(ostream& out, t_struct
       indent(out) << "  if (getSetField() == _Fields." << constant_name(field->get_name()) << ") {"
                   << endl;
 
-      if(unsafe_binaries_){
-        indent(out)
-          << "    return (java.nio.ByteBuffer)getFieldValue();"
-          << endl;
-      }else{
+      if (unsafe_binaries_) {
+        indent(out) << "    return (java.nio.ByteBuffer)getFieldValue();" << endl;
+      } else {
         indent(out)
-          << "    return org.apache.thrift.TBaseHelper.copyBinary((java.nio.ByteBuffer)getFieldValue());"
-          << endl;
+            << "    return "
+               "org.apache.thrift.TBaseHelper.copyBinary((java.nio.ByteBuffer)getFieldValue());"
+            << endl;
       }
 
       indent(out) << "  } else {" << endl;
-      indent(out) << "    throw new java.lang.RuntimeException(\"Cannot get field '" << field->get_name()
+      indent(out) << "    throw new java.lang.RuntimeException(\"Cannot get field '"
+                  << field->get_name()
                   << "' because union is currently set to \" + getFieldDesc(getSetField()).name);"
                   << endl;
       indent(out) << "  }" << endl;
@@ -1029,7 +1029,8 @@ void t_java_generator::generate_union_getters_and_setters(ostream& out, t_struct
       indent(out) << "    return (" << type_name(field->get_type(), true) << ")getFieldValue();"
                   << endl;
       indent(out) << "  } else {" << endl;
-      indent(out) << "    throw new java.lang.RuntimeException(\"Cannot get field '" << field->get_name()
+      indent(out) << "    throw new java.lang.RuntimeException(\"Cannot get field '"
+                  << field->get_name()
                   << "' because union is currently set to \" + getFieldDesc(getSetField()).name);"
                   << endl;
       indent(out) << "  }" << endl;
@@ -1047,9 +1048,9 @@ void t_java_generator::generate_union_getters_and_setters(ostream& out, t_struct
                   << endl;
       indent(out) << "  set" << get_cap_name(field->get_name());
 
-      if(unsafe_binaries_){
+      if (unsafe_binaries_) {
         indent(out) << "(java.nio.ByteBuffer.wrap(value));" << endl;
-      }else{
+      } else {
         indent(out) << "(java.nio.ByteBuffer.wrap(value.clone()));" << endl;
       }
 
@@ -1066,7 +1067,8 @@ void t_java_generator::generate_union_getters_and_setters(ostream& out, t_struct
     indent(out) << "  setField_ = _Fields." << constant_name(field->get_name()) << ";" << endl;
 
     if (type_can_be_null(field->get_type())) {
-      indent(out) << "  value_ = java.util.Objects.requireNonNull(value,\"" << "_Fields." << constant_name(field->get_name()) << "\");" << endl;
+      indent(out) << "  value_ = java.util.Objects.requireNonNull(value,\""
+                  << "_Fields." << constant_name(field->get_name()) << "\");" << endl;
     } else {
       indent(out) << "  value_ = value;" << endl;
     }
@@ -1121,9 +1123,9 @@ void t_java_generator::generate_union_abstract_methods(ostream& out, t_struct* t
 
 void t_java_generator::generate_check_type(ostream& out, t_struct* tstruct) {
   indent(out) << "@Override" << endl;
-  indent(out)
-      << "protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException {"
-      << endl;
+  indent(out) << "protected void checkType(_Fields setField, java.lang.Object value) throws "
+                 "java.lang.ClassCastException {"
+              << endl;
   indent_up();
 
   indent(out) << "switch (setField) {" << endl;
@@ -1147,7 +1149,8 @@ void t_java_generator::generate_check_type(ostream& out, t_struct* tstruct) {
   }
 
   indent(out) << "default:" << endl;
-  indent(out) << "  throw new java.lang.IllegalArgumentException(\"Unknown field id \" + setField);" << endl;
+  indent(out) << "  throw new java.lang.IllegalArgumentException(\"Unknown field id \" + setField);"
+              << endl;
 
   indent_down();
   indent(out) << "}" << endl;
@@ -1158,9 +1161,11 @@ void t_java_generator::generate_check_type(ostream& out, t_struct* tstruct) {
 
 void t_java_generator::generate_standard_scheme_read_value(ostream& out, t_struct* tstruct) {
   indent(out) << "@Override" << endl;
-  indent(out) << "protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol "
-                 "iprot, org.apache.thrift.protocol.TField field) throws "
-                 "org.apache.thrift.TException {" << endl;
+  indent(out)
+      << "protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol "
+         "iprot, org.apache.thrift.protocol.TField field) throws "
+         "org.apache.thrift.TException {"
+      << endl;
 
   indent_up();
 
@@ -1194,8 +1199,10 @@ void t_java_generator::generate_standard_scheme_read_value(ostream& out, t_struc
   }
 
   indent(out) << "default:" << endl;
-  indent(out) << "  throw new java.lang.IllegalStateException(\"setField wasn't null, but didn't match any "
-                 "of the case statements!\");" << endl;
+  indent(out)
+      << "  throw new java.lang.IllegalStateException(\"setField wasn't null, but didn't match any "
+         "of the case statements!\");"
+      << endl;
 
   indent_down();
   indent(out) << "}" << endl;
@@ -1215,7 +1222,8 @@ void t_java_generator::generate_standard_scheme_read_value(ostream& out, t_struc
 void t_java_generator::generate_standard_scheme_write_value(ostream& out, t_struct* tstruct) {
   indent(out) << "@Override" << endl;
   indent(out) << "protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol "
-                 "oprot) throws org.apache.thrift.TException {" << endl;
+                 "oprot) throws org.apache.thrift.TException {"
+              << endl;
 
   indent_up();
 
@@ -1238,8 +1246,10 @@ void t_java_generator::generate_standard_scheme_write_value(ostream& out, t_stru
   }
 
   indent(out) << "default:" << endl;
-  indent(out) << "  throw new java.lang.IllegalStateException(\"Cannot write union with unknown field \" + "
-                 "setField_);" << endl;
+  indent(out)
+      << "  throw new java.lang.IllegalStateException(\"Cannot write union with unknown field \" + "
+         "setField_);"
+      << endl;
 
   indent_down();
   indent(out) << "}" << endl;
@@ -1251,8 +1261,10 @@ void t_java_generator::generate_standard_scheme_write_value(ostream& out, t_stru
 
 void t_java_generator::generate_tuple_scheme_read_value(ostream& out, t_struct* tstruct) {
   indent(out) << "@Override" << endl;
-  indent(out) << "protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol "
-                 "iprot, short fieldID) throws org.apache.thrift.TException {" << endl;
+  indent(out)
+      << "protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol "
+         "iprot, short fieldID) throws org.apache.thrift.TException {"
+      << endl;
 
   indent_up();
 
@@ -1278,8 +1290,10 @@ void t_java_generator::generate_tuple_scheme_read_value(ostream& out, t_struct*
   }
 
   indent(out) << "default:" << endl;
-  indent(out) << "  throw new java.lang.IllegalStateException(\"setField wasn't null, but didn't match any "
-                 "of the case statements!\");" << endl;
+  indent(out)
+      << "  throw new java.lang.IllegalStateException(\"setField wasn't null, but didn't match any "
+         "of the case statements!\");"
+      << endl;
 
   indent_down();
   indent(out) << "}" << endl;
@@ -1287,7 +1301,8 @@ void t_java_generator::generate_tuple_scheme_read_value(ostream& out, t_struct*
   indent_down();
   indent(out) << "} else {" << endl;
   indent_up();
-  indent(out) << "throw new org.apache.thrift.protocol.TProtocolException(\"Couldn't find a field with field id \" + fieldID);"
+  indent(out) << "throw new org.apache.thrift.protocol.TProtocolException(\"Couldn't find a field "
+                 "with field id \" + fieldID);"
               << endl;
   indent_down();
   indent(out) << "}" << endl;
@@ -1298,7 +1313,8 @@ void t_java_generator::generate_tuple_scheme_read_value(ostream& out, t_struct*
 void t_java_generator::generate_tuple_scheme_write_value(ostream& out, t_struct* tstruct) {
   indent(out) << "@Override" << endl;
   indent(out) << "protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) "
-                 "throws org.apache.thrift.TException {" << endl;
+                 "throws org.apache.thrift.TException {"
+              << endl;
 
   indent_up();
 
@@ -1321,8 +1337,10 @@ void t_java_generator::generate_tuple_scheme_write_value(ostream& out, t_struct*
   }
 
   indent(out) << "default:" << endl;
-  indent(out) << "  throw new java.lang.IllegalStateException(\"Cannot write union with unknown field \" + "
-                 "setField_);" << endl;
+  indent(out)
+      << "  throw new java.lang.IllegalStateException(\"Cannot write union with unknown field \" + "
+         "setField_);"
+      << endl;
 
   indent_down();
   indent(out) << "}" << endl;
@@ -1351,7 +1369,8 @@ void t_java_generator::generate_get_field_desc(ostream& out, t_struct* tstruct)
   }
 
   indent(out) << "default:" << endl;
-  indent(out) << "  throw new java.lang.IllegalArgumentException(\"Unknown field id \" + setField);" << endl;
+  indent(out) << "  throw new java.lang.IllegalArgumentException(\"Unknown field id \" + setField);"
+              << endl;
 
   indent_down();
   indent(out) << "}" << endl;
@@ -1382,17 +1401,20 @@ void t_java_generator::generate_union_comparisons(ostream& out, t_struct* tstruc
 
   indent(out) << "public boolean equals(" << tstruct->get_name() << " other) {" << endl;
   indent(out) << "  return other != null && getSetField() == other.getSetField() && "
-                 "getFieldValue().equals(other.getFieldValue());" << endl;
+                 "getFieldValue().equals(other.getFieldValue());"
+              << endl;
   indent(out) << "}" << endl;
   out << endl;
 
   indent(out) << "@Override" << endl;
   indent(out) << "public int compareTo(" << type_name(tstruct) << " other) {" << endl;
   indent(out) << "  int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), "
-                 "other.getSetField());" << endl;
+                 "other.getSetField());"
+              << endl;
   indent(out) << "  if (lastComparison == 0) {" << endl;
   indent(out) << "    return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), "
-                 "other.getFieldValue());" << endl;
+                 "other.getFieldValue());"
+              << endl;
   indent(out) << "  }" << endl;
   indent(out) << "  return lastComparison;" << endl;
   indent(out) << "}" << endl;
@@ -1403,7 +1425,9 @@ void t_java_generator::generate_union_hashcode(ostream& out, t_struct* tstruct)
   (void)tstruct;
   indent(out) << "@Override" << endl;
   indent(out) << "public int hashCode() {" << endl;
-  indent(out) << "  java.util.List<java.lang.Object> list = new java.util.ArrayList<java.lang.Object>();" << endl;
+  indent(out)
+      << "  java.util.List<java.lang.Object> list = new java.util.ArrayList<java.lang.Object>();"
+      << endl;
   indent(out) << "  list.add(this.getClass().getName());" << endl;
   indent(out) << "  org.apache.thrift.TFieldIdEnum setField = getSetField();" << endl;
   indent(out) << "  if (setField != null) {" << endl;
@@ -1524,7 +1548,8 @@ void t_java_generator::generate_java_struct_definition(ostream& out,
       indent(out) << "private " << primitiveType << " __isset_bitfield = 0;" << endl;
       break;
     case ISSET_BITSET:
-      indent(out) << "private java.util.BitSet __isset_bit_vector = new java.util.BitSet(" << i << ");" << endl;
+      indent(out) << "private java.util.BitSet __isset_bit_vector = new java.util.BitSet(" << i
+                  << ");" << endl;
       break;
     }
 
@@ -1549,11 +1574,7 @@ void t_java_generator::generate_java_struct_definition(ostream& out,
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_type* t = get_true_type((*m_iter)->get_type());
     if ((*m_iter)->get_value() != nullptr) {
-      print_const_value(out,
-                        "this." + (*m_iter)->get_name(),
-                        t,
-                        (*m_iter)->get_value(),
-                        true,
+      print_const_value(out, "this." + (*m_iter)->get_name(), t, (*m_iter)->get_value(), true,
                         true);
     }
     if ((*m_iter)->get_req() != t_field::T_OPTIONAL) {
@@ -1586,11 +1607,10 @@ void t_java_generator::generate_java_struct_definition(ostream& out,
       if ((*m_iter)->get_req() != t_field::T_OPTIONAL) {
         t_type* type = get_true_type((*m_iter)->get_type());
         if (type->is_binary()) {
-          if(unsafe_binaries_){
-            indent(out) << "this." << (*m_iter)->get_name()
-                        << " = " << (*m_iter)->get_name()
-                        << ";" << endl;
-          }else{
+          if (unsafe_binaries_) {
+            indent(out) << "this." << (*m_iter)->get_name() << " = " << (*m_iter)->get_name() << ";"
+                        << endl;
+          } else {
             indent(out) << "this." << (*m_iter)->get_name()
                         << " = org.apache.thrift.TBaseHelper.copyBinary(" << (*m_iter)->get_name()
                         << ");" << endl;
@@ -1700,8 +1720,8 @@ void t_java_generator::generate_java_struct_parcelable(ostream& out, t_struct* t
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
 
-  out << indent() << "@Override" << endl << indent()
-      << "public void writeToParcel(android.os.Parcel out, int flags) {" << endl;
+  out << indent() << "@Override" << endl
+      << indent() << "public void writeToParcel(android.os.Parcel out, int flags) {" << endl;
   indent_up();
   string bitsetPrimitiveType = "";
   switch (needs_isset(tstruct, &bitsetPrimitiveType)) {
@@ -1735,7 +1755,8 @@ void t_java_generator::generate_java_struct_parcelable(ostream& out, t_struct* t
     } else if (type_name(t) == "float") {
       indent(out) << "out.writeFloat(" << name << ");" << endl;
     } else if (t->is_enum()) {
-      indent(out) << "out.writeInt(" << name << " != null ? " << name << ".getValue() : -1);" << endl;
+      indent(out) << "out.writeInt(" << name << " != null ? " << name << ".getValue() : -1);"
+                  << endl;
     } else if (t->is_list()) {
       if (((t_list*)t)->get_elem_type()->get_true_type()->is_struct()) {
         indent(out) << "out.writeTypedList(" << name << ");" << endl;
@@ -1887,15 +1908,16 @@ void t_java_generator::generate_java_struct_parcelable(ostream& out, t_struct* t
               << "> CREATOR = new android.os.Parcelable.Creator<" << tname << ">() {" << endl;
   indent_up();
 
-  indent(out) << "@Override" << endl << indent() << "public " << tname << "[] newArray(int size) {"
-              << endl;
+  indent(out) << "@Override" << endl
+              << indent() << "public " << tname << "[] newArray(int size) {" << endl;
   indent_up();
   indent(out) << "return new " << tname << "[size];" << endl;
   scope_down(out);
   out << endl;
 
-  indent(out) << "@Override" << endl << indent() << "public " << tname
-              << " createFromParcel(android.os.Parcel in) {" << endl;
+  indent(out) << "@Override" << endl
+              << indent() << "public " << tname << " createFromParcel(android.os.Parcel in) {"
+              << endl;
   indent_up();
   indent(out) << "return new " << tname << "(in);" << endl;
   scope_down(out);
@@ -1911,19 +1933,21 @@ void t_java_generator::generate_java_struct_parcelable(ostream& out, t_struct* t
  * @param tstruct The struct definition
  */
 void t_java_generator::generate_java_struct_equality(ostream& out, t_struct* tstruct) {
-  out << indent() << "@Override" << endl << indent() << "public boolean equals(java.lang.Object that) {"
-      << endl;
+  out << indent() << "@Override" << endl
+      << indent() << "public boolean equals(java.lang.Object that) {" << endl;
   indent_up();
-  out << indent() << "if (that instanceof " << tstruct->get_name() << ")" << endl << indent()
-      << "  return this.equals((" << tstruct->get_name() << ")that);" << endl << indent()
-      << "return false;" << endl;
+  out << indent() << "if (that instanceof " << tstruct->get_name() << ")" << endl
+      << indent() << "  return this.equals((" << tstruct->get_name() << ")that);" << endl
+      << indent() << "return false;" << endl;
   scope_down(out);
   out << endl;
 
   out << indent() << "public boolean equals(" << tstruct->get_name() << " that) {" << endl;
   indent_up();
-  out << indent() << "if (that == null)" << endl << indent() << "  return false;" << endl
-      << indent() << "if (this == that)" << endl << indent() << "  return true;"  << endl;
+  out << indent() << "if (that == null)" << endl
+      << indent() << "  return false;" << endl
+      << indent() << "if (this == that)" << endl
+      << indent() << "  return true;" << endl;
 
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
@@ -1952,8 +1976,8 @@ void t_java_generator::generate_java_struct_equality(ostream& out, t_struct* tst
         << "this_present_" << name << " || that_present_" << name << ") {" << endl;
     indent_up();
     out << indent() << "if (!("
-        << "this_present_" << name << " && that_present_" << name << "))" << endl << indent()
-        << "  return false;" << endl;
+        << "this_present_" << name << " && that_present_" << name << "))" << endl
+        << indent() << "  return false;" << endl;
 
     if (t->is_binary()) {
       unequal = "!this." + name + ".equals(that." + name + ")";
@@ -2000,13 +2024,13 @@ void t_java_generator::generate_java_struct_equality(ostream& out, t_struct* tst
     if (t->is_enum()) {
       indent(out) << "hashCode = hashCode * " << MUL << " + " << name << ".getValue();" << endl;
     } else if (t->is_base_type()) {
-      switch(((t_base_type*)t)->get_base()) {
+      switch (((t_base_type*)t)->get_base()) {
       case t_base_type::TYPE_STRING:
         indent(out) << "hashCode = hashCode * " << MUL << " + " << name << ".hashCode();" << endl;
         break;
       case t_base_type::TYPE_BOOL:
-        indent(out) << "hashCode = hashCode * " << MUL << " + ((" << name << ") ? "
-                    << B_YES << " : " << B_NO << ");" << endl;
+        indent(out) << "hashCode = hashCode * " << MUL << " + ((" << name << ") ? " << B_YES
+                    << " : " << B_NO << ");" << endl;
         break;
       case t_base_type::TYPE_I8:
         indent(out) << "hashCode = hashCode * " << MUL << " + (int) (" << name << ");" << endl;
@@ -2017,13 +2041,14 @@ void t_java_generator::generate_java_struct_equality(ostream& out, t_struct* tst
         break;
       case t_base_type::TYPE_I64:
       case t_base_type::TYPE_DOUBLE:
-        indent(out) << "hashCode = hashCode * " << MUL << " + org.apache.thrift.TBaseHelper.hashCode(" << name << ");" << endl;
+        indent(out) << "hashCode = hashCode * " << MUL
+                    << " + org.apache.thrift.TBaseHelper.hashCode(" << name << ");" << endl;
         break;
       case t_base_type::TYPE_VOID:
         throw std::logic_error("compiler error: a struct field cannot be void");
       default:
-        throw std::logic_error("compiler error: the following base type has no hashcode generator: " +
-               t_base_type::t_base_name(((t_base_type*)t)->get_base()));
+        throw std::logic_error("compiler error: the following base type has no hashcode generator: "
+                               + t_base_type::t_base_name(((t_base_type*)t)->get_base()));
       }
     } else {
       indent(out) << "hashCode = hashCode * " << MUL << " + " << name << ".hashCode();" << endl;
@@ -2086,7 +2111,8 @@ void t_java_generator::generate_java_struct_compare_to(ostream& out, t_struct* t
 void t_java_generator::generate_java_struct_reader(ostream& out, t_struct* tstruct) {
   (void)tstruct;
   indent(out) << "public void read(org.apache.thrift.protocol.TProtocol iprot) throws "
-                 "org.apache.thrift.TException {" << endl;
+                 "org.apache.thrift.TException {"
+              << endl;
   indent_up();
   indent(out) << "scheme(iprot).read(iprot, this);" << endl;
   indent_down();
@@ -2106,10 +2132,12 @@ void t_java_generator::generate_java_validator(ostream& out, t_struct* tstruct)
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
       if (bean_style_) {
-        out << indent() << "if (!" << generate_isset_check(*f_iter) << ") {" << endl << indent()
+        out << indent() << "if (!" << generate_isset_check(*f_iter) << ") {" << endl
+            << indent()
             << "  throw new org.apache.thrift.protocol.TProtocolException(\"Required field '"
-            << (*f_iter)->get_name() << "' is unset! Struct:\" + toString());" << endl << indent()
-            << "}" << endl << endl;
+            << (*f_iter)->get_name() << "' is unset! Struct:\" + toString());" << endl
+            << indent() << "}" << endl
+            << endl;
       } else {
         if (type_can_be_null((*f_iter)->get_type())) {
           indent(out) << "if (" << (*f_iter)->get_name() << " == null) {" << endl;
@@ -2148,7 +2176,8 @@ void t_java_generator::generate_java_validator(ostream& out, t_struct* tstruct)
 void t_java_generator::generate_java_struct_writer(ostream& out, t_struct* tstruct) {
   (void)tstruct;
   indent(out) << "public void write(org.apache.thrift.protocol.TProtocol oprot) throws "
-                 "org.apache.thrift.TException {" << endl;
+                 "org.apache.thrift.TException {"
+              << endl;
   indent_up();
   indent(out) << "scheme(oprot).write(oprot, this);" << endl;
 
@@ -2167,7 +2196,8 @@ void t_java_generator::generate_java_struct_writer(ostream& out, t_struct* tstru
 void t_java_generator::generate_java_struct_result_writer(ostream& out, t_struct* tstruct) {
   (void)tstruct;
   indent(out) << "public void write(org.apache.thrift.protocol.TProtocol oprot) throws "
-                 "org.apache.thrift.TException {" << endl;
+                 "org.apache.thrift.TException {"
+              << endl;
   indent_up();
   indent(out) << "scheme(oprot).write(oprot, this);" << endl;
 
@@ -2268,7 +2298,8 @@ void t_java_generator::generate_generic_isset_method(std::ostream& out, t_struct
 
   // create the isSet method
   indent(out) << "/** Returns true if field corresponding to fieldID is set (has been assigned a "
-                 "value) and false otherwise */" << endl;
+                 "value) and false otherwise */"
+              << endl;
   indent(out) << "public boolean isSet(_Fields field) {" << endl;
   indent_up();
   indent(out) << "if (field == null) {" << endl;
@@ -2325,7 +2356,8 @@ void t_java_generator::generate_java_bean_boilerplate(ostream& out, t_struct* ts
         indent_down();
         indent(out) << "} else {" << endl;
         indent_up();
-        indent(out) << "return org.apache.thrift.Option.some(this." << field_name << ".size());" << endl;
+        indent(out) << "return org.apache.thrift.Option.some(this." << field_name << ".size());"
+                    << endl;
         indent_down();
         indent(out) << "}" << endl;
         indent_down();
@@ -2358,8 +2390,8 @@ void t_java_generator::generate_java_bean_boilerplate(ostream& out, t_struct* ts
         if (is_deprecated) {
           indent(out) << "@Deprecated" << endl;
         }
-        indent(out) << "public org.apache.thrift.Option<java.util.Iterator<" << type_name(element_type, true, false)
-                    << ">> get" << cap_name;
+        indent(out) << "public org.apache.thrift.Option<java.util.Iterator<"
+                    << type_name(element_type, true, false) << ">> get" << cap_name;
         out << get_cap_name("iterator() {") << endl;
 
         indent_up();
@@ -2369,7 +2401,8 @@ void t_java_generator::generate_java_bean_boilerplate(ostream& out, t_struct* ts
         indent_down();
         indent(out) << "} else {" << endl;
         indent_up();
-        indent(out) << "return org.apache.thrift.Option.some(this." << field_name << ".iterator());" << endl;
+        indent(out) << "return org.apache.thrift.Option.some(this." << field_name << ".iterator());"
+                    << endl;
         indent_down();
         indent(out) << "}" << endl;
         indent_down();
@@ -2402,7 +2435,8 @@ void t_java_generator::generate_java_bean_boilerplate(ostream& out, t_struct* ts
       indent_up();
       indent(out) << "this." << field_name;
       if (is_enum_set(type)) {
-        out << " = " << type_name(type, false, true, true) << ".noneOf(" << inner_enum_type_name(type) << ");" << endl;
+        out << " = " << type_name(type, false, true, true) << ".noneOf("
+            << inner_enum_type_name(type) << ");" << endl;
       } else {
         out << " = new " << type_name(type, false, true) << "();" << endl;
       }
@@ -2430,8 +2464,8 @@ void t_java_generator::generate_java_bean_boilerplate(ostream& out, t_struct* ts
       if (is_enum_map(type)) {
         constructor_args = inner_enum_type_name(type);
       }
-      indent(out) << "this." << field_name << " = new " << type_name(type, false, true) << "(" << constructor_args << ");"
-                  << endl;
+      indent(out) << "this." << field_name << " = new " << type_name(type, false, true) << "("
+                  << constructor_args << ");" << endl;
       indent_down();
       indent(out) << "}" << endl;
       indent(out) << "this." << field_name << ".put(key, val);" << endl;
@@ -2452,12 +2486,11 @@ void t_java_generator::generate_java_bean_boilerplate(ostream& out, t_struct* ts
                   << endl;
       indent(out) << "}" << endl << endl;
 
-      indent(out) << "public java.nio.ByteBuffer buffer" << get_cap_name("for") << cap_name << "() {"
-                  << endl;
-      if(unsafe_binaries_){
-        indent(out) << "  return " << field_name << ";"
-                    << endl;
-      }else {
+      indent(out) << "public java.nio.ByteBuffer buffer" << get_cap_name("for") << cap_name
+                  << "() {" << endl;
+      if (unsafe_binaries_) {
+        indent(out) << "  return " << field_name << ";" << endl;
+      } else {
         indent(out) << "  return org.apache.thrift.TBaseHelper.copyBinary(" << field_name << ");"
                     << endl;
       }
@@ -2521,11 +2554,12 @@ void t_java_generator::generate_java_bean_boilerplate(ostream& out, t_struct* ts
         out << type_name(tstruct);
       }
       out << " set" << cap_name << "(byte[] " << field_name << ") {" << endl;
-      indent(out) << "  this." << field_name << " = " << field_name << " == null ? (java.nio.ByteBuffer)null";
+      indent(out) << "  this." << field_name << " = " << field_name
+                  << " == null ? (java.nio.ByteBuffer)null";
 
-      if(unsafe_binaries_){
+      if (unsafe_binaries_) {
         indent(out) << " : java.nio.ByteBuffer.wrap(" << field_name << ");" << endl;
-      }else{
+      } else {
         indent(out) << " : java.nio.ByteBuffer.wrap(" << field_name << ".clone());" << endl;
       }
 
@@ -2543,8 +2577,9 @@ void t_java_generator::generate_java_bean_boilerplate(ostream& out, t_struct* ts
     } else {
       out << type_name(tstruct);
     }
-    out << " set" << cap_name << "(" << (type_can_be_null(type) ? (java_nullable_annotation() + " ") : "")
-        << type_name(type) << " " << field_name << ") {" << endl;
+    out << " set" << cap_name << "("
+        << (type_can_be_null(type) ? (java_nullable_annotation() + " ") : "") << type_name(type)
+        << " " << field_name << ") {" << endl;
     indent_up();
     indent(out) << "this." << field_name << " = ";
     if (type->is_binary() && !unsafe_binaries_) {
@@ -2570,8 +2605,9 @@ void t_java_generator::generate_java_bean_boilerplate(ostream& out, t_struct* ts
     if (type_can_be_null(type)) {
       indent(out) << "this." << field_name << " = null;" << endl;
     } else if (issetType == ISSET_PRIMITIVE) {
-      indent(out) << "__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, "
-                  << isset_field_id(field) << ");" << endl;
+      indent(out)
+          << "__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, "
+          << isset_field_id(field) << ");" << endl;
     } else {
       indent(out) << "__isset_bit_vector.clear(" << isset_field_id(field) << ");" << endl;
     }
@@ -2589,8 +2625,8 @@ void t_java_generator::generate_java_bean_boilerplate(ostream& out, t_struct* ts
     if (type_can_be_null(type)) {
       indent(out) << "return this." << field_name << " != null;" << endl;
     } else if (issetType == ISSET_PRIMITIVE) {
-      indent(out) << "return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, " << isset_field_id(field)
-                  << ");" << endl;
+      indent(out) << "return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, "
+                  << isset_field_id(field) << ");" << endl;
     } else {
       indent(out) << "return __isset_bit_vector.get(" << isset_field_id(field) << ");" << endl;
     }
@@ -2624,11 +2660,12 @@ void t_java_generator::generate_java_bean_boilerplate(ostream& out, t_struct* ts
  * @param tstruct The struct definition
  */
 void t_java_generator::generate_java_struct_tostring(ostream& out, t_struct* tstruct) {
-  out << indent() << "@Override" << endl << indent() << "public java.lang.String toString() {" << endl;
+  out << indent() << "@Override" << endl
+      << indent() << "public java.lang.String toString() {" << endl;
   indent_up();
 
-  out << indent() << "java.lang.StringBuilder sb = new java.lang.StringBuilder(\"" << tstruct->get_name() << "(\");"
-      << endl;
+  out << indent() << "java.lang.StringBuilder sb = new java.lang.StringBuilder(\""
+      << tstruct->get_name() << "(\");" << endl;
   out << indent() << "boolean first = true;" << endl << endl;
 
   const vector<t_field*>& fields = tstruct->get_members();
@@ -2699,15 +2736,16 @@ void t_java_generator::generate_java_meta_data_map(ostream& out, t_struct* tstru
   vector<t_field*>::const_iterator f_iter;
 
   // Static Map with fieldID -> org.apache.thrift.meta_data.FieldMetaData mappings
-  indent(out)
-      << "public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;"
-      << endl;
+  indent(out) << "public static final java.util.Map<_Fields, "
+                 "org.apache.thrift.meta_data.FieldMetaData> metaDataMap;"
+              << endl;
   indent(out) << "static {" << endl;
   indent_up();
 
-  indent(out) << "java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new "
-                 "java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);"
-              << endl;
+  indent(out)
+      << "java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new "
+         "java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);"
+      << endl;
 
   // Populate map
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
@@ -2802,7 +2840,8 @@ void t_java_generator::generate_field_value_meta_data(std::ostream& out, t_type*
   if (type->is_struct() || type->is_xception()) {
     indent(out) << "new "
                    "org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType."
-                   "STRUCT, " << type_name(type) << ".class";
+                   "STRUCT, "
+                << type_name(type) << ".class";
   } else if (type->is_container()) {
     if (type->is_list()) {
       indent(out)
@@ -2916,7 +2955,8 @@ void t_java_generator::generate_service_async_interface(t_service* tservice) {
   vector<t_function*>::iterator f_iter;
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     indent(f_service_) << "public " << function_signature_async(*f_iter, true)
-                       << " throws org.apache.thrift.TException;" << endl << endl;
+                       << " throws org.apache.thrift.TException;" << endl
+                       << endl;
   }
   indent_down();
   f_service_ << indent() << "}" << endl << endl;
@@ -2968,7 +3008,8 @@ void t_java_generator::generate_service_client(t_service* tservice) {
   indent_down();
   indent(f_service_) << "}" << endl;
   indent(f_service_) << "public Client getClient(org.apache.thrift.protocol.TProtocol iprot, "
-                        "org.apache.thrift.protocol.TProtocol oprot) {" << endl;
+                        "org.apache.thrift.protocol.TProtocol oprot) {"
+                     << endl;
   indent_up();
   indent(f_service_) << "return new Client(iprot, oprot);" << endl;
   indent_down();
@@ -2983,7 +3024,8 @@ void t_java_generator::generate_service_client(t_service* tservice) {
   f_service_ << endl;
 
   indent(f_service_) << "public Client(org.apache.thrift.protocol.TProtocol iprot, "
-                        "org.apache.thrift.protocol.TProtocol oprot) {" << endl;
+                        "org.apache.thrift.protocol.TProtocol oprot) {"
+                     << endl;
   indent(f_service_) << "  super(iprot, oprot);" << endl;
   indent(f_service_) << "}" << endl << endl;
 
@@ -3031,8 +3073,7 @@ void t_java_generator::generate_service_client(t_service* tservice) {
     scope_down(f_service_);
     f_service_ << endl;
 
-    t_function send_function(g_type_void,
-                             string("send") + sep + javaname,
+    t_function send_function(g_type_void, string("send") + sep + javaname,
                              (*f_iter)->get_arglist());
 
     string argsname = (*f_iter)->get_name() + "_args";
@@ -3059,10 +3100,8 @@ void t_java_generator::generate_service_client(t_service* tservice) {
       string resultname = (*f_iter)->get_name() + "_result";
 
       t_struct noargs(program_);
-      t_function recv_function((*f_iter)->get_returntype(),
-                               string("recv") + sep + javaname,
-                               &noargs,
-                               (*f_iter)->get_xceptions());
+      t_function recv_function((*f_iter)->get_returntype(), string("recv") + sep + javaname,
+                               &noargs, (*f_iter)->get_xceptions());
       // Open function
       indent(f_service_) << "public " << function_signature(&recv_function) << endl;
       scope_up(f_service_);
@@ -3073,7 +3112,8 @@ void t_java_generator::generate_service_client(t_service* tservice) {
       // Careful, only return _result if not a void function
       if (!(*f_iter)->get_returntype()->is_void()) {
         f_service_ << indent() << "if (result." << generate_isset_check("success") << ") {" << endl
-                   << indent() << "  return result.success;" << endl << indent() << "}" << endl;
+                   << indent() << "  return result.success;" << endl
+                   << indent() << "}" << endl;
       }
 
       t_struct* xs = (*f_iter)->get_xceptions();
@@ -3089,9 +3129,10 @@ void t_java_generator::generate_service_client(t_service* tservice) {
       if ((*f_iter)->get_returntype()->is_void()) {
         indent(f_service_) << "return;" << endl;
       } else {
-        f_service_ << indent() << "throw new "
-                                  "org.apache.thrift.TApplicationException(org.apache.thrift."
-                                  "TApplicationException.MISSING_RESULT, \""
+        f_service_ << indent()
+                   << "throw new "
+                      "org.apache.thrift.TApplicationException(org.apache.thrift."
+                      "TApplicationException.MISSING_RESULT, \""
                    << (*f_iter)->get_name() << " failed: unknown result\");" << endl;
       }
 
@@ -3118,20 +3159,23 @@ void t_java_generator::generate_service_async_client(t_service* tservice) {
 
   // Factory method
   indent(f_service_) << "public static class Factory implements "
-                        "org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {" << endl;
+                        "org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {"
+                     << endl;
   indent(f_service_) << "  private org.apache.thrift.async.TAsyncClientManager clientManager;"
                      << endl;
   indent(f_service_) << "  private org.apache.thrift.protocol.TProtocolFactory protocolFactory;"
                      << endl;
   indent(f_service_) << "  public Factory(org.apache.thrift.async.TAsyncClientManager "
                         "clientManager, org.apache.thrift.protocol.TProtocolFactory "
-                        "protocolFactory) {" << endl;
+                        "protocolFactory) {"
+                     << endl;
   indent(f_service_) << "    this.clientManager = clientManager;" << endl;
   indent(f_service_) << "    this.protocolFactory = protocolFactory;" << endl;
   indent(f_service_) << "  }" << endl;
   indent(f_service_) << "  public AsyncClient "
                         "getAsyncClient(org.apache.thrift.transport.TNonblockingTransport "
-                        "transport) {" << endl;
+                        "transport) {"
+                     << endl;
   indent(f_service_) << "    return new AsyncClient(protocolFactory, clientManager, transport);"
                      << endl;
   indent(f_service_) << "  }" << endl;
@@ -3140,7 +3184,8 @@ void t_java_generator::generate_service_async_client(t_service* tservice) {
   indent(f_service_) << "public AsyncClient(org.apache.thrift.protocol.TProtocolFactory "
                         "protocolFactory, org.apache.thrift.async.TAsyncClientManager "
                         "clientManager, org.apache.thrift.transport.TNonblockingTransport "
-                        "transport) {" << endl;
+                        "transport) {"
+                     << endl;
   indent(f_service_) << "  super(protocolFactory, clientManager, transport);" << endl;
   indent(f_service_) << "}" << endl << endl;
 
@@ -3179,14 +3224,16 @@ void t_java_generator::generate_service_async_client(t_service* tservice) {
 
     // TAsyncMethod object for this function call
     indent(f_service_) << "public static class " + funclassname
-                          + " extends org.apache.thrift.async.TAsyncMethodCall<"
-                          + type_name((*f_iter)->get_returntype(), true) + "> {" << endl;
+                              + " extends org.apache.thrift.async.TAsyncMethodCall<"
+                              + type_name((*f_iter)->get_returntype(), true) + "> {"
+                       << endl;
     indent_up();
 
     // Member variables
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       indent(f_service_) << "private " + type_name((*fld_iter)->get_type()) + " "
-                            + (*fld_iter)->get_name() + ";" << endl;
+                                + (*fld_iter)->get_name() + ";"
+                         << endl;
     }
 
     // NOTE since we use a new Client instance to deserialize, let's keep seqid to 0 for now
@@ -3194,24 +3241,27 @@ void t_java_generator::generate_service_async_client(t_service* tservice) {
 
     // Constructor
     indent(f_service_) << "public " + funclassname + "("
-                          + async_argument_list(*f_iter, arg_struct, ret_type, true)
+                              + async_argument_list(*f_iter, arg_struct, ret_type, true)
                        << ", org.apache.thrift.async.TAsyncClient client, "
                           "org.apache.thrift.protocol.TProtocolFactory protocolFactory, "
                           "org.apache.thrift.transport.TNonblockingTransport transport) throws "
-                          "org.apache.thrift.TException {" << endl;
+                          "org.apache.thrift.TException {"
+                       << endl;
     indent(f_service_) << "  super(client, protocolFactory, transport, resultHandler, "
                        << ((*f_iter)->is_oneway() ? "true" : "false") << ");" << endl;
 
     // Assign member variables
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       indent(f_service_) << "  this." + (*fld_iter)->get_name() + " = " + (*fld_iter)->get_name()
-                            + ";" << endl;
+                                + ";"
+                         << endl;
     }
 
     indent(f_service_) << "}" << endl << endl;
 
     indent(f_service_) << "public void write_args(org.apache.thrift.protocol.TProtocol prot) "
-                          "throws org.apache.thrift.TException {" << endl;
+                          "throws org.apache.thrift.TException {"
+                       << endl;
     indent_up();
 
     // Serialize request
@@ -3219,15 +3269,16 @@ void t_java_generator::generate_service_async_client(t_service* tservice) {
     f_service_ << indent() << "prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage(\""
                << funname << "\", org.apache.thrift.protocol."
                << ((*f_iter)->is_oneway() ? "TMessageType.ONEWAY" : "TMessageType.CALL") << ", 0));"
-               << endl << indent() << args_name << " args = new " << args_name << "();" << endl;
+               << endl
+               << indent() << args_name << " args = new " << args_name << "();" << endl;
 
     for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
       f_service_ << indent() << "args.set" << get_cap_name((*fld_iter)->get_name()) << "("
                  << (*fld_iter)->get_name() << ");" << endl;
     }
 
-    f_service_ << indent() << "args.write(prot);" << endl << indent() << "prot.writeMessageEnd();"
-               << endl;
+    f_service_ << indent() << "args.write(prot);" << endl
+               << indent() << "prot.writeMessageEnd();" << endl;
 
     indent_down();
     indent(f_service_) << "}" << endl << endl;
@@ -3244,12 +3295,18 @@ void t_java_generator::generate_service_async_client(t_service* tservice) {
     f_service_
         << indent()
         << "if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {"
-        << endl << indent() << "  throw new java.lang.IllegalStateException(\"Method call not finished!\");"
-        << endl << indent() << "}" << endl << indent()
+        << endl
+        << indent() << "  throw new java.lang.IllegalStateException(\"Method call not finished!\");"
+        << endl
+        << indent() << "}" << endl
+        << indent()
         << "org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new "
-           "org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());" << endl
-        << indent() << "org.apache.thrift.protocol.TProtocol prot = "
-                       "client.getProtocolFactory().getProtocol(memoryTransport);" << endl;
+           "org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());"
+        << endl
+        << indent()
+        << "org.apache.thrift.protocol.TProtocol prot = "
+           "client.getProtocolFactory().getProtocol(memoryTransport);"
+        << endl;
     indent(f_service_);
     if (ret_type->is_void()) { // NB: Includes oneways which always return void.
       if (!(*f_iter)->is_oneway()) {
@@ -3300,26 +3357,30 @@ void t_java_generator::generate_service_server(t_service* tservice) {
                      << extends_processor << " implements org.apache.thrift.TProcessor {" << endl;
   indent_up();
 
-  indent(f_service_)
-      << "private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(Processor.class.getName());"
-      << endl;
+  indent(f_service_) << "private static final org.slf4j.Logger _LOGGER = "
+                        "org.slf4j.LoggerFactory.getLogger(Processor.class.getName());"
+                     << endl;
 
   indent(f_service_) << "public Processor(I iface) {" << endl;
   indent(f_service_) << "  super(iface, getProcessMap(new java.util.HashMap<java.lang.String, "
                         "org.apache.thrift.ProcessFunction<I, ? extends "
-                        "org.apache.thrift.TBase>>()));" << endl;
+                        "org.apache.thrift.TBase>>()));"
+                     << endl;
   indent(f_service_) << "}" << endl << endl;
 
   indent(f_service_) << "protected Processor(I iface, java.util.Map<java.lang.String, "
                         "org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> "
-                        "processMap) {" << endl;
+                        "processMap) {"
+                     << endl;
   indent(f_service_) << "  super(iface, getProcessMap(processMap));" << endl;
   indent(f_service_) << "}" << endl << endl;
 
   indent(f_service_) << "private static <I extends Iface> java.util.Map<java.lang.String,  "
                         "org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> "
-                        "getProcessMap(java.util.Map<java.lang.String, org.apache.thrift.ProcessFunction<I, ? extends "
-                        " org.apache.thrift.TBase>> processMap) {" << endl;
+                        "getProcessMap(java.util.Map<java.lang.String, "
+                        "org.apache.thrift.ProcessFunction<I, ? extends "
+                        " org.apache.thrift.TBase>> processMap) {"
+                     << endl;
   indent_up();
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     indent(f_service_) << "processMap.put(\"" << (*f_iter)->get_name() << "\", new "
@@ -3364,25 +3425,30 @@ void t_java_generator::generate_service_async_server(t_service* tservice) {
   indent_up();
 
   indent(f_service_) << "private static final org.slf4j.Logger _LOGGER = "
-                        "org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName());" << endl;
+                        "org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName());"
+                     << endl;
 
   indent(f_service_) << "public AsyncProcessor(I iface) {" << endl;
   indent(f_service_) << "  super(iface, getProcessMap(new java.util.HashMap<java.lang.String, "
                         "org.apache.thrift.AsyncProcessFunction<I, ? extends "
-                        "org.apache.thrift.TBase, ?>>()));" << endl;
+                        "org.apache.thrift.TBase, ?>>()));"
+                     << endl;
   indent(f_service_) << "}" << endl << endl;
 
   indent(f_service_) << "protected AsyncProcessor(I iface, java.util.Map<java.lang.String,  "
                         "org.apache.thrift.AsyncProcessFunction<I, ? extends  "
-                        "org.apache.thrift.TBase, ?>> processMap) {" << endl;
+                        "org.apache.thrift.TBase, ?>> processMap) {"
+                     << endl;
   indent(f_service_) << "  super(iface, getProcessMap(processMap));" << endl;
   indent(f_service_) << "}" << endl << endl;
 
-  indent(f_service_) << "private static <I extends AsyncIface> java.util.Map<java.lang.String,  "
-                        "org.apache.thrift.AsyncProcessFunction<I, ? extends  "
-                        "org.apache.thrift.TBase,?>> getProcessMap(java.util.Map<java.lang.String,  "
-                        "org.apache.thrift.AsyncProcessFunction<I, ? extends  "
-                        "org.apache.thrift.TBase, ?>> processMap) {" << endl;
+  indent(f_service_)
+      << "private static <I extends AsyncIface> java.util.Map<java.lang.String,  "
+         "org.apache.thrift.AsyncProcessFunction<I, ? extends  "
+         "org.apache.thrift.TBase,?>> getProcessMap(java.util.Map<java.lang.String,  "
+         "org.apache.thrift.AsyncProcessFunction<I, ? extends  "
+         "org.apache.thrift.TBase, ?>> processMap) {"
+      << endl;
   indent_up();
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     indent(f_service_) << "processMap.put(\"" << (*f_iter)->get_name() << "\", new "
@@ -3458,7 +3524,10 @@ void t_java_generator::generate_process_async_function(t_service* tservice, t_fu
   indent(f_service_) << "}" << endl << endl;
 
   indent(f_service_) << "public org.apache.thrift.async.AsyncMethodCallback<" << resulttype
-                     << "> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {" << endl;
+                     << "> getResultHandler(final "
+                        "org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, "
+                        "final int seqid) {"
+                     << endl;
   indent_up();
   indent(f_service_) << "final org.apache.thrift.AsyncProcessFunction fcall = this;" << endl;
   indent(f_service_) << "return new org.apache.thrift.async.AsyncMethodCallback<" << resulttype
@@ -3564,9 +3633,10 @@ void t_java_generator::generate_process_async_function(t_service* tservice, t_fu
     indent_up();
     f_service_ << indent() << "_LOGGER.error(\"Exception inside handler\", e);" << endl
                << indent() << "msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;" << endl
-               << indent() << "msg = new "
-                              "org.apache.thrift.TApplicationException(org.apache.thrift."
-                              "TApplicationException.INTERNAL_ERROR, e.getMessage());"
+               << indent()
+               << "msg = new "
+                  "org.apache.thrift.TApplicationException(org.apache.thrift."
+                  "TApplicationException.INTERNAL_ERROR, e.getMessage());"
                << endl;
     indent_down();
     f_service_ << indent() << "}" << endl
@@ -3659,7 +3729,8 @@ void t_java_generator::generate_process_function(t_service* tservice, t_function
 
   indent(f_service_) << "@Override" << endl;
   indent(f_service_) << "protected boolean rethrowUnhandledExceptions() {" << endl;
-  indent(f_service_) << "  return " << ((rethrow_unhandled_exceptions_) ? "true" : "false") << ";" << endl;
+  indent(f_service_) << "  return " << ((rethrow_unhandled_exceptions_) ? "true" : "false") << ";"
+                     << endl;
   indent(f_service_) << "}" << endl << endl;
 
   indent(f_service_) << "public " << resultname << " getResult(I iface, " << argsname
@@ -3804,10 +3875,10 @@ void t_java_generator::generate_deserialize_field(ostream& out,
   } else if (type->is_enum()) {
     indent(out) << name << " = "
                 << type_name(tfield->get_type(), true, false, false, true)
-                   + ".findByValue(iprot.readI32());" << endl;
+                       + ".findByValue(iprot.readI32());"
+                << endl;
   } else {
-    printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
-           tfield->get_name().c_str(),
+    printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n", tfield->get_name().c_str(),
            type_name(type).c_str());
   }
 }
@@ -3815,9 +3886,7 @@ void t_java_generator::generate_deserialize_field(ostream& out,
 /**
  * Generates an unserializer for a struct, invokes read()
  */
-void t_java_generator::generate_deserialize_struct(ostream& out,
-                                                   t_struct* tstruct,
-                                                   string prefix) {
+void t_java_generator::generate_deserialize_struct(ostream& out, t_struct* tstruct, string prefix) {
 
   if (reuse_objects_) {
     indent(out) << "if (" << prefix << " == null) {" << endl;
@@ -3866,20 +3935,15 @@ void t_java_generator::generate_deserialize_container(ostream& out,
   } else {
     // Declare variables, read header
     if (ttype->is_map()) {
-      indent(out) << "org.apache.thrift.protocol.TMap " << obj
-                  << " = iprot.readMapBegin("
+      indent(out) << "org.apache.thrift.protocol.TMap " << obj << " = iprot.readMapBegin("
                   << type_to_enum(((t_map*)ttype)->get_key_type()) << ", "
-                  << type_to_enum(((t_map*)ttype)->get_val_type()) << "); "<< endl;
+                  << type_to_enum(((t_map*)ttype)->get_val_type()) << "); " << endl;
     } else if (ttype->is_set()) {
-      indent(out) << "org.apache.thrift.protocol.TSet " << obj
-                  << " = iprot.readSetBegin("
-                  << type_to_enum(((t_set*)ttype)->get_elem_type()) << ");"
-                  << endl;
+      indent(out) << "org.apache.thrift.protocol.TSet " << obj << " = iprot.readSetBegin("
+                  << type_to_enum(((t_set*)ttype)->get_elem_type()) << ");" << endl;
     } else if (ttype->is_list()) {
-      indent(out) << "org.apache.thrift.protocol.TList " << obj
-                  << " = iprot.readListBegin("
-                  << type_to_enum(((t_list*)ttype)->get_elem_type()) << ");"
-                  << endl;
+      indent(out) << "org.apache.thrift.protocol.TList " << obj << " = iprot.readListBegin("
+                  << type_to_enum(((t_list*)ttype)->get_elem_type()) << ");" << endl;
     }
   }
 
@@ -4122,10 +4186,8 @@ void t_java_generator::generate_serialize_field(ostream& out,
     }
     out << endl;
   } else {
-    printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s%s' TYPE '%s'\n",
-           prefix.c_str(),
-           tfield->get_name().c_str(),
-           type_name(type).c_str());
+    printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s%s' TYPE '%s'\n", prefix.c_str(),
+           tfield->get_name().c_str(), type_name(type).c_str());
   }
 }
 
@@ -4173,9 +4235,10 @@ void t_java_generator::generate_serialize_container(ostream& out,
 
   string iter = tmp("_iter");
   if (ttype->is_map()) {
-    indent(out) << "for (java.util.Map.Entry<" << type_name(((t_map*)ttype)->get_key_type(), true, false)
-                << ", " << type_name(((t_map*)ttype)->get_val_type(), true, false) << "> " << iter
-                << " : " << prefix << ".entrySet())";
+    indent(out) << "for (java.util.Map.Entry<"
+                << type_name(((t_map*)ttype)->get_key_type(), true, false) << ", "
+                << type_name(((t_map*)ttype)->get_val_type(), true, false) << "> " << iter << " : "
+                << prefix << ".entrySet())";
   } else if (ttype->is_set()) {
     indent(out) << "for (" << type_name(((t_set*)ttype)->get_elem_type()) << " " << iter << " : "
                 << prefix << ")";
@@ -4276,8 +4339,10 @@ string t_java_generator::type_name(t_type* ttype,
     } else {
       prefix = "java.util.Map";
     }
-    return prefix + (skip_generic ? "" : "<" + type_name(tmap->get_key_type(), true) + ","
-                                         + type_name(tmap->get_val_type(), true) + ">");
+    return prefix
+           + (skip_generic ? ""
+                           : "<" + type_name(tmap->get_key_type(), true) + ","
+                                 + type_name(tmap->get_val_type(), true) + ">");
   } else if (ttype->is_set()) {
     t_set* tset = (t_set*)ttype;
     if (in_init) {
@@ -4695,8 +4760,8 @@ void t_java_generator::generate_deep_copy_container(ostream& out,
   bool copy_construct_container;
   if (container->is_map()) {
     t_map* tmap = (t_map*)container;
-    copy_construct_container = tmap->get_key_type()->is_base_type()
-                               && tmap->get_val_type()->is_base_type();
+    copy_construct_container
+        = tmap->get_key_type()->is_base_type() && tmap->get_val_type()->is_base_type();
   } else {
     t_type* elem_type = container->is_list() ? ((t_list*)container)->get_elem_type()
                                              : ((t_set*)container)->get_elem_type();
@@ -4721,7 +4786,8 @@ void t_java_generator::generate_deep_copy_container(ostream& out,
 
   if (is_enum_set(container)) {
     indent(out) << type_name(type, true, false) << " " << result_name << " = "
-                << type_name(container, false, true, true) << ".noneOf(" << constructor_args << ");" << endl;
+                << type_name(container, false, true, true) << ".noneOf(" << constructor_args << ");"
+                << endl;
   } else {
     indent(out) << type_name(type, true, false) << " " << result_name << " = new "
                 << type_name(container, false, true) << "(" << constructor_args << ");" << endl;
@@ -4749,34 +4815,24 @@ void t_java_generator::generate_deep_copy_container(ostream& out,
     out << endl;
 
     if (key_type->is_container()) {
-      generate_deep_copy_container(out,
-                                   iterator_element_name + "_key",
-                                   "",
-                                   result_element_name + "_key",
-                                   key_type);
+      generate_deep_copy_container(out, iterator_element_name + "_key", "",
+                                   result_element_name + "_key", key_type);
     } else {
       indent(out) << type_name(key_type, true, false) << " " << result_element_name << "_key = ";
-      generate_deep_copy_non_container(out,
-                                       iterator_element_name + "_key",
-                                       result_element_name + "_key",
-                                       key_type);
+      generate_deep_copy_non_container(out, iterator_element_name + "_key",
+                                       result_element_name + "_key", key_type);
       out << ";" << endl;
     }
 
     out << endl;
 
     if (val_type->is_container()) {
-      generate_deep_copy_container(out,
-                                   iterator_element_name + "_value",
-                                   "",
-                                   result_element_name + "_value",
-                                   val_type);
+      generate_deep_copy_container(out, iterator_element_name + "_value", "",
+                                   result_element_name + "_value", val_type);
     } else {
       indent(out) << type_name(val_type, true, false) << " " << result_element_name << "_value = ";
-      generate_deep_copy_non_container(out,
-                                       iterator_element_name + "_value",
-                                       result_element_name + "_value",
-                                       val_type);
+      generate_deep_copy_non_container(out, iterator_element_name + "_value",
+                                       result_element_name + "_value", val_type);
       out << ";" << endl;
     }
 
@@ -4810,9 +4866,7 @@ void t_java_generator::generate_deep_copy_container(ostream& out,
       // iterative copy
       if (elem_type->is_binary()) {
         indent(out) << "java.nio.ByteBuffer temp_binary_element = ";
-        generate_deep_copy_non_container(out,
-                                         iterator_element_name,
-                                         "temp_binary_element",
+        generate_deep_copy_non_container(out, iterator_element_name, "temp_binary_element",
                                          elem_type);
         out << ";" << endl;
         indent(out) << result_name << ".add(temp_binary_element);" << endl;
@@ -4868,7 +4922,8 @@ void t_java_generator::generate_isset_set(ostream& out, t_field* field, string p
 
 void t_java_generator::generate_struct_desc(ostream& out, t_struct* tstruct) {
   indent(out) << "private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new "
-                 "org.apache.thrift.protocol.TStruct(\"" << tstruct->get_name() << "\");" << endl;
+                 "org.apache.thrift.protocol.TStruct(\""
+              << tstruct->get_name() << "\");" << endl;
 }
 
 void t_java_generator::generate_field_descs(ostream& out, t_struct* tstruct) {
@@ -4885,15 +4940,18 @@ void t_java_generator::generate_field_descs(ostream& out, t_struct* tstruct) {
 }
 
 void t_java_generator::generate_scheme_map(ostream& out, t_struct* tstruct) {
-  indent(out) << "private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new "
-      << tstruct->get_name() << "StandardSchemeFactory();" << endl;
-  indent(out) << "private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new "
+  indent(out) << "private static final org.apache.thrift.scheme.SchemeFactory "
+                 "STANDARD_SCHEME_FACTORY = new "
+              << tstruct->get_name() << "StandardSchemeFactory();" << endl;
+  indent(out)
+      << "private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new "
       << tstruct->get_name() << "TupleSchemeFactory();" << endl;
 }
 
 void t_java_generator::generate_field_name_constants(ostream& out, t_struct* tstruct) {
   indent(out) << "/** The set of fields this struct contains, along with convenience methods for "
-                 "finding and manipulating them. */" << endl;
+                 "finding and manipulating them. */"
+              << endl;
   indent(out) << "public enum _Fields implements org.apache.thrift.TFieldIdEnum {" << endl;
 
   indent_up();
@@ -4912,9 +4970,9 @@ void t_java_generator::generate_field_name_constants(ostream& out, t_struct* tst
 
   out << ";" << endl << endl;
 
-  indent(out)
-      << "private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();"
-      << endl;
+  indent(out) << "private static final java.util.Map<java.lang.String, _Fields> byName = new "
+                 "java.util.HashMap<java.lang.String, _Fields>();"
+              << endl;
   out << endl;
 
   indent(out) << "static {" << endl;
@@ -4954,8 +5012,10 @@ void t_java_generator::generate_field_name_constants(ostream& out, t_struct* tst
   indent(out) << " */" << endl;
   indent(out) << "public static _Fields findByThriftIdOrThrow(int fieldId) {" << endl;
   indent(out) << "  _Fields fields = findByThriftId(fieldId);" << endl;
-  indent(out) << "  if (fields == null) throw new java.lang.IllegalArgumentException(\"Field \" + fieldId + "
-                 "\" doesn't exist!\");" << endl;
+  indent(out) << "  if (fields == null) throw new java.lang.IllegalArgumentException(\"Field \" + "
+                 "fieldId + "
+                 "\" doesn't exist!\");"
+              << endl;
   indent(out) << "  return fields;" << endl;
   indent(out) << "}" << endl << endl;
 
@@ -5090,7 +5150,8 @@ void t_java_generator::generate_java_struct_write_object(ostream& out, t_struct*
       << endl;
   indent(out) << "  try {" << endl;
   indent(out) << "    write(new org.apache.thrift.protocol.TCompactProtocol(new "
-                 "org.apache.thrift.transport.TIOStreamTransport(out)));" << endl;
+                 "org.apache.thrift.transport.TIOStreamTransport(out)));"
+              << endl;
   indent(out) << "  } catch (org.apache.thrift.TException te) {" << endl;
   indent(out) << "    throw new java.io.IOException(te" << (android_legacy_ ? ".getMessage()" : "")
               << ");" << endl;
@@ -5101,7 +5162,8 @@ void t_java_generator::generate_java_struct_write_object(ostream& out, t_struct*
 // generates java method to serialize (in the Java sense) the object
 void t_java_generator::generate_java_struct_read_object(ostream& out, t_struct* tstruct) {
   indent(out) << "private void readObject(java.io.ObjectInputStream in) throws "
-                 "java.io.IOException, java.lang.ClassNotFoundException {" << endl;
+                 "java.io.IOException, java.lang.ClassNotFoundException {"
+              << endl;
   indent(out) << "  try {" << endl;
   if (!tstruct->is_union()) {
     switch (needs_isset(tstruct)) {
@@ -5109,18 +5171,21 @@ void t_java_generator::generate_java_struct_read_object(ostream& out, t_struct*
       break;
     case ISSET_PRIMITIVE:
       indent(out) << "    // it doesn't seem like you should have to do this, but java "
-                     "serialization is wacky, and doesn't call the default constructor." << endl;
+                     "serialization is wacky, and doesn't call the default constructor."
+                  << endl;
       indent(out) << "    __isset_bitfield = 0;" << endl;
       break;
     case ISSET_BITSET:
       indent(out) << "    // it doesn't seem like you should have to do this, but java "
-                     "serialization is wacky, and doesn't call the default constructor." << endl;
+                     "serialization is wacky, and doesn't call the default constructor."
+                  << endl;
       indent(out) << "    __isset_bit_vector = new java.util.BitSet(1);" << endl;
       break;
     }
   }
   indent(out) << "    read(new org.apache.thrift.protocol.TCompactProtocol(new "
-                 "org.apache.thrift.transport.TIOStreamTransport(in)));" << endl;
+                 "org.apache.thrift.transport.TIOStreamTransport(in)));"
+              << endl;
   indent(out) << "  } catch (org.apache.thrift.TException te) {" << endl;
   indent(out) << "    throw new java.io.IOException(te" << (android_legacy_ ? ".getMessage()" : "")
               << ");" << endl;
@@ -5137,8 +5202,8 @@ void t_java_generator::generate_standard_reader(ostream& out, t_struct* tstruct)
   vector<t_field*>::const_iterator f_iter;
 
   // Declare stack tmp variables and read struct header
-  out << indent() << "org.apache.thrift.protocol.TField schemeField;" << endl << indent()
-      << "iprot.readStructBegin();" << endl;
+  out << indent() << "org.apache.thrift.protocol.TField schemeField;" << endl
+      << indent() << "iprot.readStructBegin();" << endl;
 
   // Loop over reading in fields
   indent(out) << "while (true)" << endl;
@@ -5173,9 +5238,11 @@ void t_java_generator::generate_standard_reader(ostream& out, t_struct* tstruct)
                 << "set" << get_cap_name((*f_iter)->get_name()) << get_cap_name("isSet")
                 << "(true);" << endl;
     indent_down();
-    out << indent() << "} else { " << endl << indent()
-        << "  org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);" << endl
-        << indent() << "}" << endl << indent() << "break;" << endl;
+    out << indent() << "} else { " << endl
+        << indent() << "  org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);"
+        << endl
+        << indent() << "}" << endl
+        << indent() << "break;" << endl;
     indent_down();
   }
 
@@ -5197,16 +5264,19 @@ void t_java_generator::generate_standard_reader(ostream& out, t_struct* tstruct)
   // in non-beans style, check for required fields of primitive type
   // (which can be checked here but not in the general validate method)
   if (!bean_style_) {
-    out << endl << indent() << "// check for required fields of primitive type, which can't be "
-                               "checked in the validate method" << endl;
+    out << endl
+        << indent()
+        << "// check for required fields of primitive type, which can't be "
+           "checked in the validate method"
+        << endl;
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
       if ((*f_iter)->get_req() == t_field::T_REQUIRED && !type_can_be_null((*f_iter)->get_type())) {
         out << indent() << "if (!struct." << generate_isset_check(*f_iter) << ") {" << endl
             << indent()
             << "  throw new org.apache.thrift.protocol.TProtocolException(\"Required field '"
             << (*f_iter)->get_name()
-            << "' was not found in serialized data! Struct: \" + toString());" << endl << indent()
-            << "}" << endl;
+            << "' was not found in serialized data! Struct: \" + toString());" << endl
+            << indent() << "}" << endl;
       }
     }
   }
@@ -5263,8 +5333,8 @@ void t_java_generator::generate_standard_writer(ostream& out, t_struct* tstruct,
     }
   }
   // Write the struct map
-  out << indent() << "oprot.writeFieldStop();" << endl << indent() << "oprot.writeStructEnd();"
-      << endl;
+  out << indent() << "oprot.writeFieldStop();" << endl
+      << indent() << "oprot.writeStructEnd();" << endl;
 
   indent_down();
   out << indent() << "}" << endl << endl;
@@ -5275,7 +5345,8 @@ void t_java_generator::generate_java_struct_standard_scheme(ostream& out,
                                                             t_struct* tstruct,
                                                             bool is_result) {
   indent(out) << "private static class " << tstruct->get_name()
-              << "StandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {" << endl;
+              << "StandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {"
+              << endl;
   indent_up();
   indent(out) << "public " << tstruct->get_name() << "StandardScheme getScheme() {" << endl;
   indent_up();
@@ -5286,7 +5357,9 @@ void t_java_generator::generate_java_struct_standard_scheme(ostream& out,
   indent(out) << "}" << endl << endl;
 
   out << indent() << "private static class " << tstruct->get_name()
-      << "StandardScheme extends org.apache.thrift.scheme.StandardScheme<" << tstruct->get_name() << "> {" << endl << endl;
+      << "StandardScheme extends org.apache.thrift.scheme.StandardScheme<" << tstruct->get_name()
+      << "> {" << endl
+      << endl;
   indent_up();
   generate_standard_reader(out, tstruct);
   indent_down();
@@ -5301,7 +5374,9 @@ void t_java_generator::generate_java_struct_tuple_reader(ostream& out, t_struct*
   indent(out) << "public void read(org.apache.thrift.protocol.TProtocol prot, "
               << tstruct->get_name() << " struct) throws org.apache.thrift.TException {" << endl;
   indent_up();
-  indent(out) << "org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;" << endl;
+  indent(out) << "org.apache.thrift.protocol.TTupleProtocol iprot = "
+                 "(org.apache.thrift.protocol.TTupleProtocol) prot;"
+              << endl;
   int optional_count = 0;
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
@@ -5317,7 +5392,8 @@ void t_java_generator::generate_java_struct_tuple_reader(ostream& out, t_struct*
     }
   }
   if (optional_count > 0) {
-    indent(out) << "java.util.BitSet incoming = iprot.readBitSet(" << optional_count << ");" << endl;
+    indent(out) << "java.util.BitSet incoming = iprot.readBitSet(" << optional_count << ");"
+                << endl;
     int i = 0;
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
       if ((*f_iter)->get_req() == t_field::T_OPTIONAL
@@ -5342,7 +5418,9 @@ void t_java_generator::generate_java_struct_tuple_writer(ostream& out, t_struct*
   indent(out) << "public void write(org.apache.thrift.protocol.TProtocol prot, "
               << tstruct->get_name() << " struct) throws org.apache.thrift.TException {" << endl;
   indent_up();
-  indent(out) << "org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;" << endl;
+  indent(out) << "org.apache.thrift.protocol.TTupleProtocol oprot = "
+                 "(org.apache.thrift.protocol.TTupleProtocol) prot;"
+              << endl;
 
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
@@ -5403,7 +5481,9 @@ void t_java_generator::generate_java_struct_tuple_scheme(ostream& out, t_struct*
   indent_down();
   indent(out) << "}" << endl << endl;
   out << indent() << "private static class " << tstruct->get_name()
-      << "TupleScheme extends org.apache.thrift.scheme.TupleScheme<" << tstruct->get_name() << "> {" << endl << endl;
+      << "TupleScheme extends org.apache.thrift.scheme.TupleScheme<" << tstruct->get_name() << "> {"
+      << endl
+      << endl;
   indent_up();
   generate_java_struct_tuple_writer(out, tstruct);
   out << endl;
@@ -5414,12 +5494,12 @@ void t_java_generator::generate_java_struct_tuple_scheme(ostream& out, t_struct*
 
 void t_java_generator::generate_java_scheme_lookup(ostream& out) {
   indent(out) << "private static <S extends org.apache.thrift.scheme.IScheme> S scheme("
-      << "org.apache.thrift.protocol.TProtocol proto) {" << endl;
+              << "org.apache.thrift.protocol.TProtocol proto) {" << endl;
   indent_up();
   indent(out) << "return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) "
-      << "? STANDARD_SCHEME_FACTORY "
-      << ": TUPLE_SCHEME_FACTORY"
-      << ").getScheme();" << endl;
+              << "? STANDARD_SCHEME_FACTORY "
+              << ": TUPLE_SCHEME_FACTORY"
+              << ").getScheme();" << endl;
   indent_down();
   indent(out) << "}" << endl;
 }
@@ -5432,8 +5512,8 @@ void t_java_generator::generate_javax_generated_annotation(ostream& out) {
     out << ")" << endl;
   } else {
     indent(out) << ", date = \"" << (now->tm_year + 1900) << "-" << setfill('0') << setw(2)
-                << (now->tm_mon + 1) << "-" << setfill('0') << setw(2) << now->tm_mday
-                << "\")" << endl;
+                << (now->tm_mon + 1) << "-" << setfill('0') << setw(2) << now->tm_mday << "\")"
+                << endl;
   }
 }