diff --git a/compiler/cpp/src/generate/t_as3_generator.cc b/compiler/cpp/src/generate/t_as3_generator.cc
index e84ab0d..aacc77d 100644
--- a/compiler/cpp/src/generate/t_as3_generator.cc
+++ b/compiler/cpp/src/generate/t_as3_generator.cc
@@ -53,10 +53,10 @@
   {
     (void) option_string;
     std::map<std::string, std::string>::const_iterator iter;
-    
+
     iter = parsed_options.find("bindable");
     bindable_ = (iter != parsed_options.end());
-    
+
     out_dir_base_ = "gen-as3";
   }
 
@@ -110,13 +110,13 @@
   std::string generate_isset_check(std::string field);
   void generate_isset_set(ofstream& out, t_field* field);
   //removed std::string isset_field_id(t_field* field);
-  
+
   void generate_service_interface (t_service* tservice);
   void generate_service_helpers   (t_service* tservice);
   void generate_service_client    (t_service* tservice);
   void generate_service_server    (t_service* tservice);
   void generate_process_function  (t_service* tservice, t_function* tfunction);
-  
+
   /**
    * Serialization constructs
    */
@@ -183,8 +183,8 @@
   std::string as3_package();
   std::string as3_type_imports();
   std::string as3_thrift_imports();
-  std::string as3_thrift_gen_imports(t_struct* tstruct, string& imports); 
-  std::string as3_thrift_gen_imports(t_service* tservice); 
+  std::string as3_thrift_gen_imports(t_struct* tstruct, string& imports);
+  std::string as3_thrift_gen_imports(t_service* tservice);
   std::string type_name(t_type* ttype, bool in_container=false, bool in_init=false);
   std::string base_type_name(t_base_type* tbase, bool in_container=false);
   std::string declare_field(t_field* tfield, bool init=false);
@@ -214,8 +214,8 @@
   std::string package_name_;
   std::ofstream f_service_;
   std::string package_dir_;
-  
-  bool bindable_; 
+
+  bool bindable_;
 };
 
 
@@ -306,7 +306,7 @@
       }
     }
   }
-  return imports;  
+  return imports;
 }
 
 
@@ -332,11 +332,11 @@
       }
     }
 
-    as3_thrift_gen_imports((*f_iter)->get_arglist(), imports);      
-    as3_thrift_gen_imports((*f_iter)->get_xceptions(), imports);      
+    as3_thrift_gen_imports((*f_iter)->get_arglist(), imports);
+    as3_thrift_gen_imports((*f_iter)->get_xceptions(), imports);
 
   }
- 
+
   return imports;
 
 }
@@ -372,13 +372,13 @@
   f_enum <<
     autogen_comment() <<
     as3_package() << endl;
-  
+
   scope_up(f_enum);
   // Add as3 imports
   f_enum << string() +
   "import org.apache.thrift.Set;" << endl <<
   "import flash.utils.Dictionary;" << endl;
-  
+
   indent(f_enum) <<
     "public class " << tenum->get_name() << " ";
   scope_up(f_enum);
@@ -391,10 +391,10 @@
       "public static const " << (*c_iter)->get_name() <<
       ":int = " << value << ";" << endl;
   }
-  
+
   // Create a static Set with all valid values for this enum
   f_enum << endl;
-  
+
   indent(f_enum) << "public static const VALID_VALUES:Set = new Set(";
   indent_up();
   bool firstValue = true;
@@ -413,13 +413,13 @@
     indent(f_enum) << "VALUES_TO_NAMES[" << (*c_iter)->get_name() << "] = \"" << (*c_iter)->get_name() << "\";" << endl;
   }
   f_enum << endl;
-  
+
   scope_down(f_enum);
 
   scope_down(f_enum); // end class
-  
+
   scope_down(f_enum); // end package
-  
+
   f_enum.close();
 }
 
@@ -438,14 +438,14 @@
   // Print header
   f_consts <<
     autogen_comment() << as3_package();
-  
+
   scope_up(f_consts);
   f_consts << endl;
-  
+
   f_consts << as3_type_imports();
 
- 
-  
+
+
   indent(f_consts) <<
     "public class " << program_name_ << "Constants {" << endl <<
     endl;
@@ -467,7 +467,7 @@
 
 void t_as3_generator::print_const_value(std::ofstream& out, string name, t_type* type, t_const_value* value, bool in_static, bool defval) {
   type = get_true_type(type);
-  
+
   indent(out);
   if (!defval) {
     out <<
@@ -587,7 +587,7 @@
   (void) name;
   type = get_true_type(type);
   std::ostringstream render;
-  
+
   if (type->is_base_type()) {
     t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
     switch (tbase) {
@@ -626,7 +626,7 @@
     print_const_value(out, t, type, value, true);
     render << t;
   }
-  
+
   return render.str();
 }
 
@@ -666,27 +666,27 @@
   f_struct <<
     autogen_comment() <<
   as3_package();
-  
+
   scope_up(f_struct);
   f_struct << endl;
-  
+
   string imports;
 
   f_struct <<
     as3_type_imports() <<
-    as3_thrift_imports() << 
+    as3_thrift_imports() <<
     as3_thrift_gen_imports(tstruct, imports) << endl;
-  
+
   if (bindable_ && ! is_exception) {
     f_struct << "import flash.events.Event;" << endl <<
     "import flash.events.EventDispatcher;" << endl <<
     "import mx.events.PropertyChangeEvent;" << endl;
   }
-  
+
   generate_as3_struct_definition(f_struct,
                                   tstruct,
                                   is_exception);
-  
+
   scope_down(f_struct); // end of package
   f_struct.close();
 }
@@ -747,9 +747,9 @@
 
     indent(out) << "public static const " << upcase_string((*m_iter)->get_name()) << ":int = " << (*m_iter)->get_key() << ";" << endl;
   }
-  
+
   out << endl;
-  
+
   // Inner Isset class
   if (members.size() > 0) {
     for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
@@ -759,11 +759,11 @@
         }
       }
   }
-  
+
   out << endl;
-  
+
   generate_as3_meta_data_map(out, tstruct);
-  
+
   // Static initializer to populate global class to struct metadata map
   indent(out) << "{" << endl;
   indent_up();
@@ -783,7 +783,7 @@
   }
   indent_down();
   indent(out) << "}" << endl << endl;
-  
+
   generate_as3_bean_boilerplate(out, tstruct, bindable);
   generate_generic_field_getters_setters(out, tstruct);
   generate_generic_isset_method(out, tstruct);
@@ -880,7 +880,7 @@
 
     out <<
       indent() << "iprot.readStructEnd();" << endl << endl;
-    
+
     // in non-beans style, check for required fields of primitive type
     // (which can be checked here but not in the general validate method)
     out << endl << indent() << "// check for required fields of primitive type, which can't be checked in the validate method" << endl;
@@ -907,11 +907,11 @@
 void t_as3_generator::generate_as3_validator(ofstream& out,
                                                    t_struct* tstruct){
   indent(out) << "public function validate():void {" << endl;
-  indent_up();  
-  
+  indent_up();
+
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
-  
+
   out << indent() << "// check for required fields" << endl;
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
@@ -924,7 +924,7 @@
       }
     }
   }
-  
+
   // check that fields of type enum have valid values
   out << indent() << "// check that fields of type enum have valid values" << endl;
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
@@ -937,9 +937,9 @@
       indent(out) << "throw new TProtocolError(TProtocolError.UNKNOWN, \"The field '" << field->get_name() << "' has been assigned the invalid value \" + " << field->get_name() << ");" << endl;
       indent_down();
       indent(out) << "}" << endl;
-    } 
-  }  
-  
+    }
+  }
+
   indent_down();
   indent(out) << "}" << endl << endl;
 }
@@ -1031,7 +1031,7 @@
     out << "(this." << generate_isset_check(*f_iter) << ") {" << endl;
 
     indent_up();
-    
+
     indent(out) << "oprot.writeFieldBegin(" << constant_name((*f_iter)->get_name()) << "_FIELD_DESC);" << endl;
 
     // Write field contents
@@ -1178,7 +1178,7 @@
     t_type* type = get_true_type(field->get_type());
     std::string field_name = field->get_name();
     std::string cap_name = get_cap_name(field_name);
-        
+
     // Simple getter
     generate_as3_doc(out, field);
     indent(out) << "public function get " << field_name << "():" <<
@@ -1187,7 +1187,7 @@
     indent(out) << "return this._" << field_name << ";" << endl;
     indent_down();
     indent(out) << "}" << endl << endl;
-    
+
     // Simple setter
     generate_as3_doc(out, field);
     std::string propName = tmp("thriftPropertyChange");
@@ -1200,21 +1200,21 @@
     indent(out) << "this._" << field_name << " = " << field_name << ";" <<
     endl;
     generate_isset_set(out, field);
-    
+
     if (bindable) {
       // We have to use a custom event rather than the default, because if you use the default,
       // the setter only gets called if the value has changed - this means calling foo.setIntValue(0)
       // will not cause foo.isIntValueSet() to return true since the value of foo._intValue wasn't changed
       // so the setter was never called.
       indent(out) << "dispatchEvent(new Event(\"" << propName << "\"));" << endl;
-      
+
       // However, if you just use a custom event, then collections won't be able to detect when elements
       // in the collections have changed since they listed for PropertyChangeEvents.  So, we dispatch both.
       indent(out) << "dispatchEvent(new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE));" << endl;
     }
     indent_down();
     indent(out) << "}" << endl << endl;
-    
+
     // Unsetter
     indent(out) << "public function unset" << cap_name << "():void {" << endl;
     indent_up();
@@ -1225,7 +1225,7 @@
     }
     indent_down();
     indent(out) << "}" << endl << endl;
-    
+
     // isSet method
     indent(out) << "// Returns true if field " << field_name << " is set (has been assigned a value) and false otherwise" << endl;
     indent(out) << "public function is" << get_cap_name("set") << cap_name << "():Boolean {" << endl;
@@ -1278,7 +1278,7 @@
       indent(out) << "} else {" << endl;
       indent_up();
     }
-    
+
     if (field->get_type()->is_base_type() && ((t_base_type*)(field->get_type()))->is_binary()) {
       indent(out) << "  ret += \"BINARY\";" << endl;
     } else if(field->get_type()->is_enum()) {
@@ -1294,7 +1294,7 @@
     } else {
       indent(out) << "ret += this." << (*f_iter)->get_name() << ";" << endl;
     }
-    
+
     if (can_be_null) {
       indent_down();
       indent(out) << "}" << endl;
@@ -1347,7 +1347,7 @@
         out << "TFieldRequirementType.DEFAULT, ";
       }
 
-      // Create value meta data    
+      // Create value meta data
       generate_field_value_meta_data(out, field->get_type());
       out  << ");" << endl;
     }
@@ -1355,7 +1355,7 @@
   }
 }
 
-/** 
+/**
  * Returns a string with the as3 representation of the given thrift type
  * (e.g. for the type struct it returns "TType.STRUCT")
  */
@@ -1398,12 +1398,12 @@
   } else if (type->is_container()){
     if (type->is_list()){
       indent(out) << "new ListMetaData(TType.LIST, ";
-      t_type* elem_type = ((t_list*)type)->get_elem_type();    
-      generate_field_value_meta_data(out, elem_type);   
+      t_type* elem_type = ((t_list*)type)->get_elem_type();
+      generate_field_value_meta_data(out, elem_type);
     } else if (type->is_set()){
       indent(out) << "new SetMetaData(TType.SET, ";
-      t_type* elem_type = ((t_list*)type)->get_elem_type();    
-      generate_field_value_meta_data(out, elem_type); 
+      t_type* elem_type = ((t_list*)type)->get_elem_type();
+      generate_field_value_meta_data(out, elem_type);
     } else{ // map
       indent(out) << "new MapMetaData(TType.MAP, ";
       t_type* key_type = ((t_map*)type)->get_key_type();
@@ -1436,9 +1436,9 @@
 
   f_service_ <<
     autogen_comment() << as3_package();
-  
+
   scope_up(f_service_);
-  
+
   f_service_ << endl <<
     as3_type_imports() <<
     as3_thrift_imports() <<
@@ -1458,16 +1458,16 @@
 
   scope_down(f_service_);
   f_service_.close();
-  
+
   // Now make the implementation/client file
   f_service_name = package_dir_+"/"+service_name_+"Impl.as";
   f_service_.open(f_service_name.c_str());
-  
+
   f_service_ <<
   autogen_comment() << as3_package();
-  
+
   scope_up(f_service_);
-  
+
   f_service_ << endl <<
   as3_type_imports() <<
   as3_thrift_imports() <<
@@ -1486,46 +1486,46 @@
 
   generate_service_client(tservice);
   scope_down(f_service_);
-  
+
   f_service_ << as3_type_imports();
   f_service_ << as3_thrift_imports();
   f_service_ << as3_thrift_gen_imports(tservice);
   if(!package_name_.empty()) {
     f_service_ << "import " << package_name_ << ".*;" << endl;
   }
-  
+
   generate_service_helpers(tservice);
-  
+
   f_service_.close();
-  
+
   // Now make the processor/server file
   f_service_name = package_dir_+"/"+service_name_+"Processor.as";
   f_service_.open(f_service_name.c_str());
-  
+
   f_service_ <<
   autogen_comment() << as3_package();
-  
+
   scope_up(f_service_);
-  
+
   f_service_ << endl <<
   as3_type_imports() <<
   as3_thrift_imports() <<
   as3_thrift_gen_imports(tservice) << endl;
-  
+
   generate_service_server(tservice);
   scope_down(f_service_);
-  
+
   f_service_ << as3_type_imports();
   f_service_ << as3_thrift_imports();
   f_service_ << as3_thrift_gen_imports(tservice) <<endl;
   if(!package_name_.empty()) {
     f_service_ << "import " << package_name_ << ".*;" << endl;
   }
-  
+
   generate_service_helpers(tservice);
-  
+
   f_service_.close();
-    
+
 }
 
 /**
@@ -1670,7 +1670,7 @@
 
     // Get the struct of function call params
     t_struct* arg_struct = (*f_iter)->get_arglist();
-    
+
     string argsname = (*f_iter)->get_name() + "_args";
     vector<t_field*>::const_iterator fld_iter;
     const vector<t_field*>& fields = arg_struct->get_members();
@@ -1690,7 +1690,7 @@
     f_service_ <<
       indent() << "args.write(oprot_);" << endl <<
     indent() << "oprot_.writeMessageEnd();" << endl;
-    
+
     if ((*f_iter)->is_oneway()) {
       f_service_ << indent() << "oprot_.getTransport().flush();" << endl;
     }
@@ -1742,7 +1742,7 @@
           indent() << "if (onSuccess != null) onSuccess();" << endl <<
           indent() << "return;" << endl;
       } else {
-        
+
         f_service_ <<
           indent() << "if (onError != null) onError(new TApplicationError(TApplicationError.MISSING_RESULT, \"" << (*f_iter)->get_name() << " failed: unknown result\"));" << endl;
       }
@@ -1750,8 +1750,8 @@
       f_service_ << indent() << "} catch (e:TError) {" << endl <<
         indent() << "  if (onError != null) onError(e);" << endl <<
         indent() << "}" << endl;
-      
-      
+
+
       indent_down();
       indent(f_service_) <<
       "});" << endl;
@@ -1948,7 +1948,7 @@
         first = false;
       } else {
         f_service_ << ", ";
-      } 
+      }
       f_service_ << "args." << (*f_iter)->get_name();
     }
     f_service_ << ");" << endl;
@@ -2344,7 +2344,7 @@
     indent(out) << "for (var " << iter << ":* in " << prefix << ") {" << endl;
     indent(out) << "  " << counter << +"++;" << endl;
     indent(out) << "}" << endl;
-    
+
     indent(out) <<
       "oprot.writeMapBegin(new TMap(" <<
       type_to_enum(((t_map*)ttype)->get_key_type()) << ", " <<
@@ -2567,7 +2567,7 @@
     arguments += "onError:Function, onSuccess:Function";
   }
 
-  std::string result = "function " + 
+  std::string result = "function " +
     prefix + tfunction->get_name() + "(" + arguments + "):void";
   return result;
 }
diff --git a/compiler/cpp/src/generate/t_c_glib_generator.cc b/compiler/cpp/src/generate/t_c_glib_generator.cc
index e143171..dbebedb 100644
--- a/compiler/cpp/src/generate/t_c_glib_generator.cc
+++ b/compiler/cpp/src/generate/t_c_glib_generator.cc
@@ -162,7 +162,7 @@
   void generate_deserialize_list_element(ofstream &out, t_list *tlist, string prefix, string index, int error_ret);
 
   string generate_new_hash_from_type(t_type * key, t_type * value);
-  string generate_new_array_from_type(t_type * ttype); 
+  string generate_new_array_from_type(t_type * ttype);
 
   string generate_free_func_from_type(t_type * ttype);
   string generate_hash_func_from_type(t_type * ttype);
@@ -194,7 +194,7 @@
   f_types_impl_ << autogen_comment();
 
   /* include inclusion guard */
-  f_types_ << 
+  f_types_ <<
     "#ifndef " << this->nspace_uc << program_name_uc << "_TYPES_H" << endl <<
     "#define " << this->nspace_uc << program_name_uc << "_TYPES_H" << endl <<
     endl;
@@ -239,7 +239,7 @@
   // include the types file
   f_types_impl_ <<
     endl <<
-    "#include \"" << this->nspace_lc << program_name_u << 
+    "#include \"" << this->nspace_lc << program_name_u <<
         "_types.h\"" << endl <<
     "#include <thrift/c_glib/thrift.h>" << endl <<
     endl;
@@ -252,7 +252,7 @@
  *  Finish up generation and close all file streams.
  */
 void t_c_glib_generator::close_generator() {
-  string program_name_uc = to_upper_case 
+  string program_name_uc = to_upper_case
     (initial_caps_to_underscores(program_name_));
 
   /* end the header inclusion guard */
@@ -266,11 +266,11 @@
 
 /**
  * Generates a Thrift typedef in C code.  For example:
- * 
- * Thrift: 
+ *
+ * Thrift:
  * typedef map<i32,i32> SomeMap
- * 
- * C: 
+ *
+ * C:
  * typedef GHashTable * ThriftSomeMap;
  */
 void t_c_glib_generator::generate_typedef(t_typedef* ttypedef) {
@@ -278,7 +278,7 @@
     indent() << "typedef " << type_name(ttypedef->get_type(), true) <<
         " " << this->nspace << ttypedef->get_symbolic() << ";" << endl <<
     endl;
-} 
+}
 
 /**
  * Generates a C enumeration.  For example:
@@ -846,7 +846,7 @@
     "gboolean " + this->nspace_lc + fname + " (" + this->nspace
     + service_name_ + "If * iface"
     + (has_return ? ", " + type_name(ttype) + "* _return" : "")
-    + (has_args ? "" : (", " + argument_list (arglist))) 
+    + (has_args ? "" : (", " + argument_list (arglist)))
     + (has_xceptions ? "" : (", " + xception_list (xlist)))
     + ", GError ** error)";
 }
@@ -1112,7 +1112,7 @@
       "  }" << endl <<
       "  return constant;" << endl <<
       "}" << endl <<
-    endl; 
+    endl;
   } else if (type->is_map()) {
     t_type *ktype = ((t_map *) type)->get_key_type();
     t_type *vtype = ((t_map *) type)->get_val_type();
@@ -1284,7 +1284,7 @@
                     + (has_args ? "" : (", " + argument_list (arglist)))
                     + (has_xceptions ? "" : (", " + xception_list (xlist)))
                     + ", GError **error)";
-                    
+
     indent(f_header_) << "gboolean (*" << funname << ") " << params << ";" <<
                           endl;
   }
@@ -1371,29 +1371,29 @@
 
   // Create all the GObject boilerplate
   f_header_ <<
-    "GType " << this->nspace_lc << service_name_lc << 
+    "GType " << this->nspace_lc << service_name_lc <<
         "_client_get_type (void);" << endl <<
     "#define " << this->nspace_uc << "TYPE_" << service_name_uc << "_CLIENT " <<
         "(" << this->nspace_lc << service_name_lc << "_client_get_type())" <<
         endl <<
     "#define " << this->nspace_uc << service_name_uc << "_CLIENT(obj) " <<
-        "(G_TYPE_CHECK_INSTANCE_CAST ((obj), " << 
-        this->nspace_uc << "TYPE_" << service_name_uc << "_CLIENT, " << 
+        "(G_TYPE_CHECK_INSTANCE_CAST ((obj), " <<
+        this->nspace_uc << "TYPE_" << service_name_uc << "_CLIENT, " <<
         this->nspace << service_name_ << "Client))" << endl <<
-    "#define " << this->nspace_uc << service_name_uc << "_CLIENT_CLASS(c) " << 
-        "(G_TYPE_CHECK_CLASS_CAST ((c), " << 
-        this->nspace_uc << "TYPE_" << service_name_uc << "_CLIENT, " << 
+    "#define " << this->nspace_uc << service_name_uc << "_CLIENT_CLASS(c) " <<
+        "(G_TYPE_CHECK_CLASS_CAST ((c), " <<
+        this->nspace_uc << "TYPE_" << service_name_uc << "_CLIENT, " <<
         this->nspace << service_name_ << "ClientClass))" << endl <<
     "#define " << this->nspace_uc << service_name_uc << "_IS_CLIENT(obj) " <<
-        "(G_TYPE_CHECK_INSTANCE_TYPE ((obj), " << 
-        this->nspace_uc << "TYPE_" << service_name_uc << "_CLIENT))" << endl << 
-    "#define " << this->nspace_uc << service_name_uc <<
-        "_IS_CLIENT_CLASS(c) " << "(G_TYPE_CHECK_CLASS_TYPE ((c), " << 
+        "(G_TYPE_CHECK_INSTANCE_TYPE ((obj), " <<
         this->nspace_uc << "TYPE_" << service_name_uc << "_CLIENT))" << endl <<
     "#define " << this->nspace_uc << service_name_uc <<
-        "_CLIENT_GET_CLASS(obj) " << "(G_TYPE_INSTANCE_GET_CLASS ((obj), " << 
+        "_IS_CLIENT_CLASS(c) " << "(G_TYPE_CHECK_CLASS_TYPE ((c), " <<
+        this->nspace_uc << "TYPE_" << service_name_uc << "_CLIENT))" << endl <<
+    "#define " << this->nspace_uc << service_name_uc <<
+        "_CLIENT_GET_CLASS(obj) " << "(G_TYPE_INSTANCE_GET_CLASS ((obj), " <<
         this->nspace_uc << "TYPE_" << service_name_uc << "_CLIENT, " <<
-        this->nspace << service_name_ << "ClientClass))" << endl << 
+        this->nspace << service_name_ << "ClientClass))" << endl <<
     endl;
 
   /* write out the function prototypes */
@@ -1418,7 +1418,7 @@
     if (!(*f_iter)->is_oneway()) {
       t_struct noargs (program_);
       t_function recv_function ((*f_iter)->get_returntype(),
-                                service_name_lc + string ("_client_recv_") 
+                                service_name_lc + string ("_client_recv_")
                                 + funname,
                                 &noargs,
                                 (*f_iter)->get_xceptions());
@@ -1456,7 +1456,7 @@
     const vector<t_field *>& fields = arglist->get_members();
     vector<t_field *>::const_iterator f_iter_field;
     for (f_iter_field = fields.begin(); f_iter_field != fields.end(); ++f_iter_field) {
-      params_without_type += (*f_iter_field)->get_name(); 
+      params_without_type += (*f_iter_field)->get_name();
       params_without_type += ", ";
     }
 
@@ -1471,7 +1471,7 @@
       "gboolean" << endl <<
       this->nspace_lc << service_name_lc << "_if_" << funname << " " <<
           params << endl <<
-      "{" << endl << 
+      "{" << endl <<
       "  return " << this->nspace_uc << service_name_uc <<
           "_IF_GET_INTERFACE (iface)->" << funname << " (" <<
           params_without_type << "error);" << endl <<
@@ -1621,7 +1621,7 @@
     // Serialize the request
     f_service_ <<
       indent() << "gint32 cseqid = 0;" << endl <<
-      indent() << "ThriftProtocol * protocol = " << 
+      indent() << "ThriftProtocol * protocol = " <<
         this->nspace_uc << base_service_name_uc <<
         "_CLIENT (iface)->output_protocol;" << endl <<
       endl <<
@@ -1648,7 +1648,7 @@
       indent() <<
         "  return FALSE;" << endl <<
       endl <<
-      indent() << 
+      indent() <<
         "return TRUE;" << endl;
 
     scope_down(f_service_);
@@ -1670,11 +1670,11 @@
         indent() << "gint32 rseqid;" << endl <<
         indent() << "gchar * fname = NULL;" << endl <<
         indent() << "ThriftMessageType mtype;" << endl <<
-        indent() << "ThriftProtocol * protocol = " << 
+        indent() << "ThriftProtocol * protocol = " <<
                       this->nspace_uc << base_service_name_uc <<
                       "_CLIENT (iface)->input_protocol;" << endl <<
         endl <<
-        indent() << "if (thrift_protocol_read_message_begin " << 
+        indent() << "if (thrift_protocol_read_message_begin " <<
                       "(protocol, &fname, &mtype, &rseqid, error) < 0)" <<
                       endl <<
         indent() << "{" << endl <<
@@ -1696,7 +1696,7 @@
         indent() << "  if (fname) g_free (fname);" << endl <<
         indent() << "  thrift_protocol_skip (protocol, T_STRUCT, NULL);" << endl <<
         indent() << "  thrift_protocol_read_message_end (protocol, NULL);" << endl <<
-        indent() << "  thrift_transport_read_end (protocol->transport, NULL);" << endl << 
+        indent() << "  thrift_transport_read_end (protocol->transport, NULL);" << endl <<
         indent() << "  g_set_error (error, THRIFT_APPLICATION_EXCEPTION_ERROR, THRIFT_APPLICATION_EXCEPTION_ERROR_INVALID_MESSAGE_TYPE, \"invalid message type %d, expected T_REPLY\", mtype);" << endl <<
         indent() << "  return FALSE;" << endl <<
         indent() << "} else if (strncmp (fname, \"" << name << "\", " << name.length() << ") != 0) {" << endl <<
@@ -1707,7 +1707,7 @@
         indent() << "  if (fname) g_free (fname);" << endl <<
         indent() << "  return FALSE;" << endl <<
         indent() << "}" << endl <<
-        indent() << "if (fname) g_free (fname);" << endl << 
+        indent() << "if (fname) g_free (fname);" << endl <<
         endl;
 
       t_struct* xs = (*f_iter)->get_xceptions();
@@ -1715,7 +1715,7 @@
       vector<t_field*>::const_iterator x_iter;
 
       {
-        t_struct result(program_, tservice->get_name() + "_" + 
+        t_struct result(program_, tservice->get_name() + "_" +
                         (*f_iter)->get_name() + "_result");
         t_field success((*f_iter)->get_returntype(), "*_return", 0);
         if (!(*f_iter)->get_returntype()->is_void()) {
@@ -1743,7 +1743,7 @@
 
       // copy over any throw exceptions and return failure
       for (x_iter = xceptions.begin(); x_iter != xceptions.end(); x_iter++) {
-        f_service_ << 
+        f_service_ <<
           indent() << "if (*" << (*x_iter)->get_name() << " != NULL)" << endl <<
           indent() << "{" << endl <<
           indent() << "    g_set_error (error, " << this->nspace_uc <<
@@ -1753,7 +1753,7 @@
               this->nspace_uc <<
               to_upper_case(initial_caps_to_underscores(
                                  (*x_iter)->get_type()->get_name())) <<
-              "_ERROR_CODE, \"" << (*x_iter)->get_type()->get_name() << 
+              "_ERROR_CODE, \"" << (*x_iter)->get_type()->get_name() <<
               "\");" << endl <<
           indent() << "    return FALSE;" << endl <<
           indent() << "}" << endl;
@@ -3061,7 +3061,7 @@
   // close the structure definition and create a typedef
   f_types_ <<
     "};" << endl <<
-    "typedef struct _" << this->nspace << name << " " << 
+    "typedef struct _" << this->nspace << name << " " <<
         this->nspace << name << ";" << endl <<
       endl;
 
@@ -3111,7 +3111,7 @@
   }
 
   // generate struct I/O methods
-  string this_get = this->nspace + name + " * this_object = " 
+  string this_get = this->nspace + name + " * this_object = "
                     + this->nspace_uc + name_uc + "(object);";
   generate_struct_reader (f_types_impl_, tstruct, "this_object->", this_get);
   generate_struct_writer (f_types_impl_, tstruct, "this_object->", this_get);
@@ -3501,7 +3501,7 @@
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_type* t = get_true_type ((*m_iter)->get_type());
-    if (t->is_container()) { 
+    if (t->is_container()) {
       string name = (*m_iter)->get_name();
       if (t->is_map() || t->is_set()) {
         f_types_impl_ << indent() << "if (tobject->" << name << " != NULL)" << endl;
@@ -3524,7 +3524,7 @@
             case t_base_type::TYPE_BOOL:
             case t_base_type::TYPE_BYTE:
             case t_base_type::TYPE_I16:
-            case t_base_type::TYPE_I32:           
+            case t_base_type::TYPE_I32:
             case t_base_type::TYPE_I64:
             case t_base_type::TYPE_DOUBLE:
               destructor_function = "g_array_unref";
@@ -3584,7 +3584,7 @@
     class_name_lc << "_class_init (" << class_name << "Class * cls)" << endl;
   scope_up(f_types_impl_);
 
-  f_types_impl_ <<   
+  f_types_impl_ <<
     indent() << "GObjectClass *gobject_class = G_OBJECT_CLASS (cls);" << endl <<
     indent() << "ThriftStructClass *struct_class = "  <<
     "THRIFT_STRUCT_CLASS (cls);" << endl <<
@@ -3869,7 +3869,7 @@
     if ((*f_iter)->get_req() == t_field::T_OPTIONAL) {
       indent(out) << "if (this_object->__isset_" << (*f_iter)->get_name() << " == TRUE) {" << endl;
       indent_up();
-    } 
+    }
 
     out <<
      indent() << "if ((ret = thrift_protocol_write_field_begin (protocol, " <<
@@ -4221,7 +4221,7 @@
     tval_ptr = tval->is_string() || !tval->is_base_type() ? "" : "*";
 
     out <<
-      indent() << "g_hash_table_foreach ((GHashTable *) " << prefix << 
+      indent() << "g_hash_table_foreach ((GHashTable *) " << prefix <<
                    ", thrift_hash_table_get_keys, &key_list);" << endl <<
       indent() << tkey_name << tkey_ptr <<
                    " keys[g_list_length (key_list)];" << endl <<
@@ -4356,7 +4356,7 @@
                 + index + ")";
 
   if (ttype->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type *) ttype)->get_base(); 
+    t_base_type::t_base tbase = ((t_base_type *) ttype)->get_base();
     switch (tbase) {
       case t_base_type::TYPE_VOID:
         throw "compiler error: cannot determine array type";
@@ -4585,7 +4585,7 @@
     generate_deserialize_map_element (out, (t_map *) ttype, prefix, error_ret);
     scope_down(out);
     out << endl;
-  
+
     // read map end
     out <<
       indent() << "/* read the map end marker */" << endl <<
@@ -4637,7 +4637,7 @@
     scope_down(out);
 
     out <<
-      indent() << "if ((ret = thrift_protocol_read_list_end (protocol, error)) < 0)" << endl << 
+      indent() << "if ((ret = thrift_protocol_read_list_end (protocol, error)) < 0)" << endl <<
       indent() << "  return " << error_ret << ";" << endl <<
       indent() << "xfer += ret;" << endl <<
       endl;
@@ -4980,7 +4980,7 @@
   ret += tolower (tmp[pos]);
   pos++;
   for (unsigned int i = pos; i < name.length(); i++) {
-    char lc = tolower (tmp[i]); 
+    char lc = tolower (tmp[i]);
     if (lc != tmp[i]) {
       ret += '_';
     }
diff --git a/compiler/cpp/src/generate/t_cocoa_generator.cc b/compiler/cpp/src/generate/t_cocoa_generator.cc
index f765f7d..cbed831 100644
--- a/compiler/cpp/src/generate/t_cocoa_generator.cc
+++ b/compiler/cpp/src/generate/t_cocoa_generator.cc
@@ -52,13 +52,13 @@
   {
     (void) option_string;
     std::map<std::string, std::string>::const_iterator iter;
-    
+
     iter = parsed_options.find("log_unexpected");
-    log_unexpected_ = (iter != parsed_options.end());    
-    
+    log_unexpected_ = (iter != parsed_options.end());
+
     iter = parsed_options.find("validate_required");
-    validate_required_ = (iter != parsed_options.end());    
-    
+    validate_required_ = (iter != parsed_options.end());
+
     out_dir_base_ = "gen-cocoa";
   }
 
@@ -408,7 +408,7 @@
   for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
     if ((*c_iter)->get_type()->is_container() ||
         (*c_iter)->get_type()->is_struct()) {
-      print_const_value(f_impl_, 
+      print_const_value(f_impl_,
            cocoa_prefix_+(*c_iter)->get_name(),
            (*c_iter)->get_type(),
            (*c_iter)->get_value(),
@@ -582,7 +582,7 @@
  */
 void t_cocoa_generator::generate_cocoa_struct_init_with_coder_method(ofstream &out,
                                                                      t_struct* tstruct,
-                                                                     bool is_exception) 
+                                                                     bool is_exception)
 {
   indent(out) << "- (id) initWithCoder: (NSCoder *) decoder" << endl;
   scope_up(out);
@@ -601,45 +601,45 @@
     out << indent() << "if ([decoder containsValueForKey: @\""<< (*m_iter)->get_name() <<"\"])" << endl;
     scope_up(out);
     out << indent() << "__" << (*m_iter)->get_name() << " = ";
-    if (type_can_be_null(t)) 
+    if (type_can_be_null(t))
     {
       out << "[[decoder decodeObjectForKey: @\"" << (*m_iter)->get_name() << "\"] retain_stub];" << endl;
     }
-    else if (t->is_enum()) 
+    else if (t->is_enum())
     {
-      out << "[decoder decodeIntForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;      
+      out << "[decoder decodeIntForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;
     }
-    else 
+    else
     {
       t_base_type::t_base tbase = ((t_base_type *) t)->get_base();
       switch (tbase)
       {
         case t_base_type::TYPE_BOOL:
-          out << "[decoder decodeBoolForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;      
+          out << "[decoder decodeBoolForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;
           break;
         case t_base_type::TYPE_BYTE:
-          out << "[decoder decodeIntForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;      
+          out << "[decoder decodeIntForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;
           break;
         case t_base_type::TYPE_I16:
-          out << "[decoder decodeIntForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;      
+          out << "[decoder decodeIntForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;
           break;
         case t_base_type::TYPE_I32:
-          out << "[decoder decodeInt32ForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;      
+          out << "[decoder decodeInt32ForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;
           break;
         case t_base_type::TYPE_I64:
-          out << "[decoder decodeInt64ForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;      
+          out << "[decoder decodeInt64ForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;
           break;
         case t_base_type::TYPE_DOUBLE:
-          out << "[decoder decodeDoubleForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;      
+          out << "[decoder decodeDoubleForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;
           break;
-        default:    
+        default:
           throw "compiler error: don't know how to decode thrift type: " + t_base_type::t_base_name(tbase);
       }
     }
     out << indent() << "__" << (*m_iter)->get_name() << "_isset = YES;" << endl;
     scope_down(out);
   }
-  
+
   out << indent() << "return self;" << endl;
   scope_down(out);
   out << endl;
@@ -652,7 +652,7 @@
  */
 void t_cocoa_generator::generate_cocoa_struct_encode_with_coder_method(ofstream &out,
                                                                        t_struct* tstruct,
-                                                                       bool is_exception) 
+                                                                       bool is_exception)
 {
   indent(out) << "- (void) encodeWithCoder: (NSCoder *) encoder" << endl;
   scope_up(out);
@@ -660,24 +660,24 @@
     // NSExceptions conform to NSCoding, so we can call super
     out << indent() << "[super encodeWithCoder: encoder];" << endl;
   }
-  
+
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
-  
+
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_type* t = get_true_type((*m_iter)->get_type());
     out << indent() << "if (__"<< (*m_iter)->get_name() <<"_isset)" << endl;
     scope_up(out);
     //out << indent() << "__" << (*m_iter)->get_name() << " = ";
-    if (type_can_be_null(t)) 
+    if (type_can_be_null(t))
     {
       out << indent() << "[encoder encodeObject: __" << (*m_iter)->get_name() << " forKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;
     }
-    else if (t->is_enum()) 
+    else if (t->is_enum())
     {
       out << indent() << "[encoder encodeInt: __" << (*m_iter)->get_name() << " forKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;
     }
-    else 
+    else
     {
       t_base_type::t_base tbase = ((t_base_type *) t)->get_base();
       switch (tbase)
@@ -700,13 +700,13 @@
         case t_base_type::TYPE_DOUBLE:
           out << indent() << "[encoder encodeDouble: __" << (*m_iter)->get_name() << " forKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;
           break;
-        default:    
+        default:
           throw "compiler error: don't know how to encode thrift type: " + t_base_type::t_base_name(tbase);
       }
     }
     scope_down(out);
   }
-  
+
   scope_down(out);
   out << endl;
 }
@@ -786,11 +786,11 @@
     scope_down(out);
     out << endl;
   }
-  
+
   // initWithCoder for NSCoding
   generate_cocoa_struct_init_with_coder_method(out, tstruct, is_exception);
   // encodeWithCoder for NSCoding
-  generate_cocoa_struct_encode_with_coder_method(out, tstruct, is_exception);  
+  generate_cocoa_struct_encode_with_coder_method(out, tstruct, is_exception);
 
   // dealloc
   if (!members.empty()) {
@@ -1077,7 +1077,7 @@
 
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
-    
+
   out << indent() << "// check for required fields" << endl;
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     t_field* field = (*f_iter);
@@ -1228,7 +1228,7 @@
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
     t_struct* ts = (*f_iter)->get_arglist();
     generate_cocoa_struct_interface(f_impl_, ts, false);
-    generate_cocoa_struct_implementation(f_impl_, ts, false, false);  
+    generate_cocoa_struct_implementation(f_impl_, ts, false, false);
     generate_function_helpers(*f_iter);
   }
 }
@@ -1274,7 +1274,7 @@
 
   // generate the result struct
   generate_cocoa_struct_interface(f_impl_, &result, false);
-  generate_cocoa_struct_implementation(f_impl_, &result, false, true);  
+  generate_cocoa_struct_implementation(f_impl_, &result, false, true);
 }
 
 
@@ -1334,12 +1334,12 @@
 void t_cocoa_generator::generate_cocoa_service_server_interface(ofstream& out,
                                                                 t_service* tservice) {
   out << "@interface " << cocoa_prefix_ << tservice->get_name() << "Processor : NSObject <TProcessor> ";
-  
+
   scope_up(out);
   out << indent() << "id <" << cocoa_prefix_ << tservice->get_name() <<"> mService;" << endl;
   out << indent() << "NSDictionary * mMethodMap;" << endl;
   scope_down(out);
-  
+
   out << "- (id) initWith" << tservice->get_name() << ": (id <" << cocoa_prefix_ << tservice->get_name() << ">) service;" << endl;
   out << "- (id<"<<cocoa_prefix_ << tservice->get_name() << ">) service;" << endl;
 
@@ -1557,7 +1557,7 @@
                                                                      t_service* tservice) {
   out << "@implementation " << cocoa_prefix_ << tservice->get_name() << "Processor" << endl;
   indent_up();
-  
+
   // initializer
   out << endl;
   out << "- (id) initWith" << tservice->get_name() << ": (id <" << cocoa_prefix_ << tservice->get_name() << ">) service" << endl;
@@ -1568,7 +1568,7 @@
   out << indent() << "}" << endl;
   out << indent() << "mService = [service retain_stub];" << endl;
   out << indent() << "mMethodMap = [[NSMutableDictionary dictionary] retain_stub];" << endl;
-  
+
   // generate method map for routing incoming calls
   vector<t_function*> functions = tservice->get_functions();
   vector<t_function*>::const_iterator f_iter;
@@ -1585,7 +1585,7 @@
   }
   out << indent() << "return self;" << endl;
   scope_down(out);
-  
+
   // implementation of the 'service' method which returns the service associated with this
   // processor
   out << endl;
@@ -1593,7 +1593,7 @@
   out << indent() << "{" << endl;
   out << indent() << "  return [[mService retain_stub] autorelease_stub];" << endl;
   out << indent() << "}" << endl;
-  
+
   // implementation of the TProcess method, which dispatches the incoming call using the method map
   out << endl;
   out << indent() << "- (BOOL) processOnInputProtocol: (id <TProtocol>) inProtocol" << endl;
@@ -1628,7 +1628,7 @@
   out << indent() << "  [i invoke];" << endl;
   out << indent() << "  return YES;" << endl;
   out << indent() << "}" << endl;
-  
+
   // generate a process_XXXX method for each service function, which reads args, calls the service, and writes results
   functions = tservice->get_functions();
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
@@ -1640,7 +1640,7 @@
     out << indent() << argstype << " * args = [[" << argstype << " alloc] init];" << endl;
     out << indent() << "[args read: inProtocol];" << endl;
     out << indent() << "[inProtocol readMessageEnd];" << endl;
-    
+
     // prepare the result if not oneway
     if (!(*f_iter)->is_oneway()) {
         string resulttype = cocoa_prefix_ + function_result_helper_struct_type(*f_iter);
@@ -1672,7 +1672,7 @@
       out << "]";
     }
     out << ";" << endl;
-    
+
     // write out the result if not oneway
     if (!(*f_iter)->is_oneway()) {
         out << indent() << "[outProtocol writeMessageBeginWithName: @\"" << funname << "\"" << endl;
@@ -1684,10 +1684,10 @@
         out << indent() << "[result release_stub];" << endl;
     }
     out << indent() << "[args release_stub];" << endl;
-    
+
     scope_down(out);
   }
-  
+
   // dealloc
   out << endl;
   out << "- (void) dealloc" << endl;
@@ -2380,7 +2380,7 @@
     t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
     switch (tbase) {
     case t_base_type::TYPE_STRING:
-      // We must handle binary constant but the syntax of IDL defines 
+      // We must handle binary constant but the syntax of IDL defines
       // nothing about binary constant.
       //   if ((t_base_type*)type)->is_binary())
       //      // binary code
@@ -2469,7 +2469,7 @@
       render << "[[" << type_name(type, true) << " alloc] init";
     bool first = true;
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      // FIXME The generated code does not match with initWithXXX 
+      // FIXME The generated code does not match with initWithXXX
       //       initializer and causes compile error.
       //       Try: test/DebugProtoTest.thrift and test/SmallTest.thrift
       t_type* field_type = NULL;
@@ -2579,7 +2579,7 @@
 
   if (type_can_be_null(tfield->get_type()))
     render << "retain, ";
-  
+
   render << "getter=" << decapitalize(tfield->get_name()) <<
     ", setter=set" << capitalize(tfield->get_name()) + ":) " <<
     type_name(tfield->get_type()) << " " << tfield->get_name() << ";";
diff --git a/compiler/cpp/src/generate/t_csharp_generator.cc b/compiler/cpp/src/generate/t_csharp_generator.cc
index 1d66cef..0b9ae2a 100644
--- a/compiler/cpp/src/generate/t_csharp_generator.cc
+++ b/compiler/cpp/src/generate/t_csharp_generator.cc
@@ -80,7 +80,7 @@
       if (serialize_) {
         wcf_namespace_ = iter->second;  // since there can be only one namespace
       }
-      
+
       iter = parsed_options.find("wcf");
       wcf_ = (iter != parsed_options.end());
       if (wcf_) {
@@ -163,7 +163,7 @@
     std::string type_to_enum(t_type* ttype);
     std::string prop_name(t_field* tfield, bool suppress_mapping = false);
     std::string get_enum_class_name(t_type* type);
-    
+
     bool field_has_default(t_field* tfield) {
       return tfield->get_value() != NULL;
     }
@@ -232,7 +232,7 @@
   namespace_dir_ = subdir;
   init_keywords();
   member_mapping_scope = NULL;
-  
+
   pverbose("C# options:\n");
   pverbose("- async ...... %s\n", (async_ ? "ON" : "off"));
   pverbose("- async_ctp .. %s\n", (async_ctp_ ? "ON" : "off"));
@@ -258,7 +258,7 @@
 
 void t_csharp_generator::init_keywords() {
   csharp_keywords.clear();
-  
+
   // C# keywords
   csharp_keywords["abstract"] = 1;
   csharp_keywords["as"]= 1;
@@ -652,13 +652,13 @@
   prepare_member_name_mapping( tstruct);
 
   indent(out) << "#if !SILVERLIGHT" << endl;
-  indent(out) << "[Serializable]" << endl; 
+  indent(out) << "[Serializable]" << endl;
   indent(out) << "#endif" << endl;
   if ((serialize_||wcf_) &&!is_exception) {
     indent(out) << "[DataContract(Namespace=\"" << wcf_namespace_ << "\")]" << endl; // do not make exception classes directly WCF serializable, we provide a seperate "fault" for that
   }
   bool is_final = (tstruct->annotations_.find("final") != tstruct->annotations_.end());
- 
+
   indent(out) << "public " << (is_final ? "sealed " : "") << "partial class " << normalize_name(tstruct->get_name()) << " : ";
 
   if (is_exception) {
@@ -730,7 +730,7 @@
       if (!is_required && (!nullable_ || has_default)) {
         if(serialize_||wcf_) {
           indent(out) << "[DataMember]" << endl;
-        } 
+        }
         indent(out) << "public bool " << normalize_name((*m_iter)->get_name()) << ";" << endl;
       }
     }
@@ -740,7 +740,7 @@
 
     if(generate_isset && (serialize_||wcf_)) {
       indent(out) << "#region XmlSerializer support" << endl << endl;
- 
+
       for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
         bool is_required = field_is_required((*m_iter));
         bool has_default = field_has_default((*m_iter));
@@ -760,7 +760,7 @@
       indent(out) << "#endregion XmlSerializer support" << endl << endl;
     }
   }
-  
+
   // We always want a default, no argument constructor for Reading
   indent(out) << "public " << normalize_name(tstruct->get_name()) << "() {" << endl;
   indent_up();
@@ -782,7 +782,7 @@
   }
   indent_down();
   indent(out) << "}" << endl << endl;
-  
+
   if (has_required_fields) {
     indent(out) << "public " << tstruct->get_name() << "(";
     bool first = true;
@@ -808,7 +808,7 @@
     indent_down();
     indent(out) << "}" << endl << endl;
   }
-  
+
   generate_csharp_struct_reader(out, tstruct);
   if (is_result) {
     generate_csharp_struct_result_writer(out, tstruct);
@@ -917,7 +917,7 @@
     if (is_required) {
       indent(out) << "isset_" << (*f_iter)->get_name() << " = true;" << endl;
     }
-    
+
     indent_down();
     out <<
       indent() << "} else { " << endl <<
@@ -1040,7 +1040,7 @@
       } else {
         out << " else if ";
       }
-      
+
       if (nullable_) {
         out << "(this." << prop_name((*f_iter)) << " != null) {" << endl;
       } else {
@@ -1142,8 +1142,8 @@
       indent(out) <<
         "__sb.Append(\", " << prop_name((*f_iter)) << ": \");" << endl;
     }
-        
-          
+
+
     t_type* ttype = (*f_iter)->get_type();
     if (ttype->is_xception() || ttype->is_struct()) {
       indent(out) <<
@@ -1152,7 +1152,7 @@
       indent(out) <<
         "__sb.Append(" << prop_name((*f_iter))  << ");" << endl;
     }
-        
+
     if (!is_required) {
       indent_down();
       indent(out) << "}" << endl;
@@ -1256,7 +1256,7 @@
   indent(out) << "field.Type = " << type_to_enum(tfield->get_type()) << ";" << endl;
   indent(out) << "field.ID = " << tfield->get_key() << ";" << endl;
   indent(out) << "oprot.WriteFieldBegin(field);" << endl;
-  
+
   generate_serialize_field(out, tfield, "_data", true, true);
 
   indent(out) << "oprot.WriteFieldEnd();" << endl;
@@ -1273,16 +1273,16 @@
 void t_csharp_generator::generate_csharp_struct_equals(ofstream& out, t_struct* tstruct) {
   indent(out) << "public override bool Equals(object that) {" << endl;
   indent_up();
-  
+
   indent(out) << "var other = that as " << type_name(tstruct) << ";" << endl;
   indent(out) << "if (other == null) return false;" << endl;
   indent(out) << "if (ReferenceEquals(this, other)) return true;" << endl;
-  
+
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
-  
+
   bool first = true;
-  
+
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if (first) {
       first = false;
@@ -1293,8 +1293,8 @@
       indent(out) << "&& ";
     }
     if (!field_is_required((*f_iter)) && !(nullable_ && !field_has_default((*f_iter)))) {
-      out << "((__isset." << normalize_name((*f_iter)->get_name()) 
-          << " == other.__isset." << normalize_name((*f_iter)->get_name()) 
+      out << "((__isset." << normalize_name((*f_iter)->get_name())
+          << " == other.__isset." << normalize_name((*f_iter)->get_name())
           << ") && ((!__isset." << normalize_name((*f_iter)->get_name()) << ") || (";
     }
     t_type* ttype = (*f_iter)->get_type();
@@ -1314,7 +1314,7 @@
     out << ";" << endl;
     indent_down();
   }
-  
+
   indent_down();
   indent(out) << "}" << endl << endl;
 }
@@ -1322,14 +1322,14 @@
 void t_csharp_generator::generate_csharp_struct_hashcode(ofstream& out, t_struct* tstruct) {
   indent(out) << "public override int GetHashCode() {" << endl;
   indent_up();
-  
+
   indent(out) << "int hashcode = 0;" << endl;
   indent(out) << "unchecked {" << endl;
   indent_up();
-  
+
   const vector<t_field*>& fields = tstruct->get_members();
   vector<t_field*>::const_iterator f_iter;
-  
+
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     t_type* ttype = (*f_iter)->get_type();
     indent(out) << "hashcode = (hashcode * 397) ^ ";
@@ -1351,11 +1351,11 @@
     }
     out << ");" << endl;
   }
-  
+
   indent_down();
   indent(out) << "}" << endl;
   indent(out) << "return hashcode;" << endl;
-  
+
   indent_down();
   indent(out) << "}" << endl << endl;
 }
@@ -1432,7 +1432,7 @@
     indent(f_service_) <<
       function_signature_async_begin(*f_iter, "Begin_") << ";" << endl;
     indent(f_service_) <<
-      function_signature_async_end(*f_iter, "End_") << ";" << endl;  
+      function_signature_async_end(*f_iter, "End_") << ";" << endl;
     if(async_||async_ctp_) {
       indent(f_service_) <<
         function_signature_async(*f_iter) << ";" << endl;
@@ -1511,7 +1511,7 @@
     indent(f_service_) << "get { return oprot_; }" << endl;
     scope_down(f_service_);
     f_service_ << endl << endl;
-    
+
     indent(f_service_) << "#region \" IDisposable Support \"" << endl;
     indent(f_service_) << "private bool _IsDisposed;" << endl << endl;
     indent(f_service_) << "// IDisposable" << endl;
@@ -1548,7 +1548,7 @@
     string funname = (*f_iter)->get_name();
 
     indent(f_service_) << endl;
-    
+
     if (!async_) {
       indent(f_service_) << "#if SILVERLIGHT" << endl;
     }
@@ -1560,7 +1560,7 @@
       "return " << "send_" << funname << "(callback, state";
 
     t_struct* arg_struct = (*f_iter)->get_arglist();
-    prepare_member_name_mapping( arg_struct); 
+    prepare_member_name_mapping( arg_struct);
 
     const vector<t_field*>& fields = arg_struct->get_members();
     vector<t_field*>::const_iterator fld_iter;
@@ -1571,7 +1571,7 @@
     f_service_ << ");" << endl;
     scope_down(f_service_);
     f_service_ << endl;
-        
+
     // End
     indent(f_service_) <<
       "public " << function_signature_async_end(*f_iter, "End_") << endl;
@@ -1595,7 +1595,7 @@
       indent(f_service_) <<
         "public async " << function_signature_async(*f_iter, "") << endl;
       scope_up(f_service_);
-      
+
       if (!(*f_iter)->get_returntype()->is_void()) {
         indent(f_service_) <<
           type_name( (*f_iter)->get_returntype()) << " retval;" << endl;
@@ -1615,7 +1615,7 @@
         f_service_ <<
           "return ";
       }
-      f_service_ << 
+      f_service_ <<
         funname << "(";
           first = true;
       for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
@@ -1628,16 +1628,16 @@
       }
       f_service_ << ");" << endl;
       indent_down();
-      indent(f_service_) << 
+      indent(f_service_) <<
         "});" << endl;
       if (!(*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << 
+        indent(f_service_) <<
           "return retval;"  << endl;
       }
           scope_down(f_service_);
       f_service_ << endl;
     }
-    
+
     if (!async_) {
       indent(f_service_) << "#endif" << endl << endl;
     }
@@ -1731,7 +1731,7 @@
     f_service_ <<
       indent() << "args.Write(oprot_);" << endl <<
       indent() << "oprot_.WriteMessageEnd();" << endl;;
-    
+
     if (!async_) {
       indent(f_service_) << "#if SILVERLIGHT" << endl;
     }
@@ -1742,7 +1742,7 @@
       indent(f_service_) << "#endif" << endl;
     }
 
-    cleanup_member_name_mapping( arg_struct); 
+    cleanup_member_name_mapping( arg_struct);
     scope_down(f_service_);
     f_service_ << endl;
 
@@ -1757,7 +1757,7 @@
       indent(f_service_) <<
         "public " << function_signature(&recv_function) << endl;
       scope_up(f_service_);
-      prepare_member_name_mapping( (*f_iter)->get_xceptions()); 
+      prepare_member_name_mapping( (*f_iter)->get_xceptions());
 
       f_service_ <<
         indent() << "TMessage msg = iprot_.ReadMessageBegin();" << endl <<
@@ -1821,7 +1821,7 @@
           indent() << "throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, \"" << (*f_iter)->get_name() << " failed: unknown result\");" << endl;
       }
 
-      cleanup_member_name_mapping( (*f_iter)->get_xceptions()); 
+      cleanup_member_name_mapping( (*f_iter)->get_xceptions());
       scope_down(f_service_);
       f_service_ << endl;
     }
@@ -1998,7 +1998,7 @@
   f_service_ <<
     "iface_." << normalize_name(tfunction->get_name()) << "(";
   bool first = true;
-  prepare_member_name_mapping(arg_struct); 
+  prepare_member_name_mapping(arg_struct);
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if (first) {
       first = false;
@@ -2010,13 +2010,13 @@
       f_service_ << ".Value";
     }
   }
-  cleanup_member_name_mapping(arg_struct); 
+  cleanup_member_name_mapping(arg_struct);
   f_service_ << ");" << endl;
 
   if (!tfunction->is_oneway() && xceptions.size() > 0) {
     indent_down();
     f_service_ << indent() << "}";
-    prepare_member_name_mapping( xs); 
+    prepare_member_name_mapping( xs);
     for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
       f_service_ << " catch (" << type_name((*x_iter)->get_type(), false, false) << " " << (*x_iter)->get_name() << ") {" << endl;
       if (!tfunction->is_oneway()) {
@@ -2029,7 +2029,7 @@
         f_service_ << "}";
       }
     }
-    cleanup_member_name_mapping( xs); 
+    cleanup_member_name_mapping( xs);
     f_service_ << endl;
   }
 
@@ -2083,7 +2083,7 @@
     indent(out) << type_name((*f_iter)->get_type()) << " temp;" << endl;
     generate_deserialize_field(out, (*f_iter), "temp", true);
     indent(out) << "retval = new " << (*f_iter)->get_name() << "(temp);" << endl;
-    
+
     indent_down();
     out <<
       indent() << "} else { " << endl <<
@@ -2308,7 +2308,7 @@
   }
 
   string name = prefix + (is_propertyless ? "" : prop_name(tfield));
-  
+
   if (type->is_void()) {
     throw "CANNOT GENERATE SERIALIZE CODE FOR void TYPE: " + name;
   }
@@ -2320,7 +2320,7 @@
   } else if (type->is_base_type() || type->is_enum()) {
     indent(out) <<
       "oprot.";
-    
+
     string nullable_name = nullable_ && !is_element && !field_is_required(tfield)
       ? name + ".Value"
       : name;
@@ -2518,7 +2518,7 @@
 
     // tests rely on this
     assert( ('A' < 'Z') && ('a' < 'z') && ('0' < '9'));
-    
+
     // if the first letter is a number, we add an additional underscore in front of it
     char c = str.at(0);
     if( ('0' <= c) && (c <= '9')) {
@@ -2527,10 +2527,10 @@
 
     // following chars: letter, number or underscore
     for( size_t i = 0;  i < str.size();  ++i) {
-        c = str.at(i);        
-        if( (('A' > c) || (c > 'Z')) && 
-            (('a' > c) || (c > 'z')) && 
-            (('0' > c) || (c > '9')) && 
+        c = str.at(i);
+        if( (('A' > c) || (c > 'Z')) &&
+            (('a' > c) || (c > 'z')) &&
+            (('0' > c) || (c > '9')) &&
             ('_' != c) ) {
             str.replace( i, 1, "_");
         }
@@ -2576,14 +2576,14 @@
 
   member_mapping_scope = scope;
   member_name_mapping.clear();
-  
+
   std::set<std::string> used_member_names;
   vector<t_field*>::const_iterator iter;
-  
-  // current C# generator policy: 
+
+  // current C# generator policy:
   // - prop names are always rendered with an Uppercase first letter
   // - struct names are used as given
-  
+
   for (iter = members.begin(); iter != members.end(); ++iter) {
     string oldname = (*iter)->get_name();
     string newname = prop_name(*iter, true);
@@ -2591,7 +2591,7 @@
       // name conflicts with struct (CS0542 error)
       if( structname.compare( newname) == 0) {
         pverbose("struct %s: member %s conflicts with struct (preventing CS0542)\n", structname.c_str(), newname.c_str());
-        newname += '_';      
+        newname += '_';
       }
 
       // new name conflicts with another member
@@ -2601,7 +2601,7 @@
         continue;
       }
 
-      // add always, this helps us to detect edge cases like 
+      // add always, this helps us to detect edge cases like
       // different spellings ("foo" and "Foo") within the same struct
       pverbose("struct %s: member mapping %s => %s\n", structname.c_str(), oldname.c_str(), newname.c_str());
       member_name_mapping[oldname] = newname;
@@ -2699,7 +2699,7 @@
           throw "NO T_VOID CONSTRUCT";
         case t_base_type::TYPE_STRING:
           result += " = null";
-          break; 
+          break;
         case t_base_type::TYPE_BOOL:
           result += " = false";
           break;
diff --git a/compiler/cpp/src/generate/t_d_generator.cc b/compiler/cpp/src/generate/t_d_generator.cc
index c23aa1f..622fb29 100644
--- a/compiler/cpp/src/generate/t_d_generator.cc
+++ b/compiler/cpp/src/generate/t_d_generator.cc
@@ -743,7 +743,7 @@
         ss << "Compiler error: Invalid requirement level " << req;
         throw ss.str();
       }
-    
+
     }
   }
 
diff --git a/compiler/cpp/src/generate/t_delphi_generator.cc b/compiler/cpp/src/generate/t_delphi_generator.cc
index 35b8da9..1012614 100644
--- a/compiler/cpp/src/generate/t_delphi_generator.cc
+++ b/compiler/cpp/src/generate/t_delphi_generator.cc
@@ -73,7 +73,7 @@
       events_ = (iter != parsed_options.end());
       iter = parsed_options.find("xmldoc");
       xmldoc_ = (iter != parsed_options.end());
-      
+
 
       out_dir_base_ = "gen-delphi";
       escape_.clear();
@@ -163,10 +163,10 @@
     std::string normalize_clsnm(std::string name, std::string prefix, bool b_no_check_keyword = false);
     std::string make_valid_delphi_identifier( std::string const & fromName);
     std::string input_arg_prefix( t_type* ttype);
-  
+
     std::string base_type_name(t_base_type* tbase);
     std::string declare_field(t_field* tfield, bool init=false, std::string prefix="", bool is_xception_class = false);
-    std::string function_signature(t_function* tfunction, std::string full_cls="", bool is_xception = false);  
+    std::string function_signature(t_function* tfunction, std::string full_cls="", bool is_xception = false);
     std::string argument_list(t_struct* tstruct);
     std::string constructor_argument_list(t_struct* tstruct, std::string current_indent);
     std::string type_to_enum(t_type* ttype);
@@ -265,7 +265,7 @@
 
 string t_delphi_generator::replace_all( string contents, string search, string repl) {
   string str( contents);
-  
+
   size_t slen = search.length();
   size_t rlen = repl.length();
   size_t incr = (rlen > 0) ? rlen : 1;
@@ -277,43 +277,43 @@
       found = str.find(search, found+incr);
     }
   }
-  
+
   return str;
 }
 
-// XML encoding 
+// XML encoding
 string t_delphi_generator::xml_encode( string contents) {
   string str( contents);
-  
+
   // escape the escape
   str = replace_all( str, "&", "&amp;");
-  
+
   // other standard XML entities
   str = replace_all( str, "<", "&lt;");
   str = replace_all( str, ">", "&gt;");
-  
+
   return str;
 }
 
-// XML attribute encoding 
+// XML attribute encoding
 string t_delphi_generator::xmlattrib_encode( string contents) {
   string str( xml_encode( contents));
-  
+
   // our attribs are enclosed in "
   str = replace_all( str, "\"", "\\\"");
-  
+
   return str;
 }
 
 // XML encoding for doc comments
 string t_delphi_generator::xmldoc_encode( string contents) {
   string str( xml_encode( contents));
-  
+
   // XMLDoc specific: convert linebreaks into <para>graphs</para>
   str = replace_all( str, "\r\n", "\r");
   str = replace_all( str, "\n",   "\r");
   str = replace_all( str, "\r",   "</para>\n<para>");
-  
+
   return str;
 }
 
@@ -329,8 +329,8 @@
 void t_delphi_generator::generate_delphi_doc(ostream &out, t_field* field) {
   if( xmldoc_) {
     if (field->get_type()->is_enum()) {
-      string combined_message = xmldoc_encode( field->get_doc()) 
-                              + "\n<seealso cref=\"" 
+      string combined_message = xmldoc_encode( field->get_doc())
+                              + "\n<seealso cref=\""
                               + xmldoc_encode( type_name(field->get_type()))
                               + "\"/>";
       generate_delphi_docstring_comment(out, combined_message);
@@ -578,7 +578,7 @@
   }
 
   init_known_types_list();
-  
+
   string unitname, nsname;
   const vector<t_program*>& includes = program_->get_includes();
   for (size_t i = 0; i < includes.size(); ++i) {
@@ -594,7 +594,7 @@
   MKDIR(get_out_dir().c_str());
 }
 
-void t_delphi_generator::close_generator() { 
+void t_delphi_generator::close_generator() {
   std::string unitname = program_name_;
   if( "" != namespace_name_) {
     unitname = namespace_name_;
@@ -666,8 +666,8 @@
   f_all  << s_struct_impl.str();
   f_all  << s_service_impl.str();
   f_all  << s_const_impl.str();
-  
-  
+
+
   if (register_types_)
   {
     f_all  << endl;
@@ -675,7 +675,7 @@
     f_all  << s_type_factory_funcs.str();
     f_all << "procedure RegisterTypeFactories;" << endl;
     f_all << "begin" << endl;
-    f_all << s_type_factory_registration.str();      
+    f_all << s_type_factory_registration.str();
     f_all << "end;" << endl;
   }
   f_all  << endl;
@@ -683,7 +683,7 @@
   string constants_class = make_constants_classname();
 
   f_all  << "initialization" << endl;
-  if ( has_const ) {    
+  if ( has_const ) {
     f_all  << "{$IF CompilerVersion < 21.0}  // D2010" << endl;
     f_all  << "  " << constants_class.c_str() << "_Initialize;" << endl;
     f_all  << "{$IFEND}" << endl;
@@ -694,16 +694,16 @@
   f_all  << endl;
 
   f_all  << "finalization" << endl;
-  if ( has_const ) {    
+  if ( has_const ) {
     f_all  << "{$IF CompilerVersion < 21.0}  // D2010" << endl;
     f_all  << "  " << constants_class.c_str() << "_Finalize;" << endl;
     f_all  << "{$IFEND}" << endl;
   }
   f_all  << endl << endl;
-  
+
   f_all  << "end." << endl;
   f_all.close();
-  
+
   if( ! typedefs_pending.empty()) {
     pwarning(0, "%d typedefs with unresolved type references left:\n", typedefs_pending.size());
     for( std::list<t_typedef*>::iterator iter = typedefs_pending.begin();  typedefs_pending.end() != iter;  ++iter) {
@@ -723,30 +723,30 @@
   // Forward declare struct def
   has_forward = true;
   pverbose("forward declaration of %s\n", type_name(tstruct).c_str());
-  
+
   string what = tstruct->is_xception() ? "class" : "interface";
 
   indent_up();
-  indent(s_forward_decr) << 
+  indent(s_forward_decr) <<
     type_name(tstruct,tstruct->is_xception(),true) << " = " << what << ";" << endl;
   indent_down();
-  
+
   add_defined_type(tstruct);
 }
 
 void t_delphi_generator::generate_typedef(t_typedef* ttypedef) {
   t_type* type = ttypedef->get_type();
 
-  // write now or save for later?  
+  // write now or save for later?
   if( ! is_fully_defined_type( type)) {
     pverbose("typedef %s: unresolved dependencies found\n", type_name(ttypedef).c_str());
-    typedefs_pending.push_back( ttypedef); 
+    typedefs_pending.push_back( ttypedef);
     return;
   }
 
   indent_up();
   generate_delphi_doc(s_struct, ttypedef);
-  indent(s_struct) << 
+  indent(s_struct) <<
     type_name(ttypedef) << " = ";
 
   // commented out: the benefit is not big enough to risk breaking existing code
@@ -757,7 +757,7 @@
   s_struct << type_name(ttypedef->get_type()) << ";" << endl <<
     endl;
   indent_down();
-  
+
   add_defined_type( ttypedef);
 }
 
@@ -773,7 +773,7 @@
   if (ttype->is_typedef()) {
     return (1 == types_known[ type_name(ttype)]);
   }
-  
+
   if (ttype->is_base_type()) {
     return (1 == types_known[ base_type_name((t_base_type*)ttype)]);
   } else if (ttype->is_enum()) {
@@ -796,19 +796,19 @@
 void t_delphi_generator::add_defined_type( t_type* ttype) {
   // mark as known type
   types_known[ type_name(ttype)] = 1;
-  
+
   // check all pending typedefs
   std::list<t_typedef*>::iterator  iter;
   bool more = true;
   while( more && (! typedefs_pending.empty()))
   {
     more = false;
-    
+
     for( iter = typedefs_pending.begin(); typedefs_pending.end() != iter; ++iter)
     {
       t_typedef* ttypedef = (*iter);
       if( is_fully_defined_type( ttypedef->get_type()))
-      {      
+      {
         pverbose("typedef %s: all pending references are now resolved\n", type_name(ttypedef).c_str());
         typedefs_pending.erase( iter);
         generate_typedef( ttypedef);
@@ -868,7 +868,7 @@
 
     // tests rely on this
     assert( ('A' < 'Z') && ('a' < 'z') && ('0' < '9'));
-    
+
     // if the first letter is a number, we add an additional underscore in front of it
     char c = str.at(0);
     if( ('0' <= c) && (c <= '9')) {
@@ -877,10 +877,10 @@
 
     // following chars: letter, number or underscore
     for( size_t i = 0;  i < str.size();  ++i) {
-        c = str.at(i);        
-        if( (('A' > c) || (c > 'Z')) && 
-            (('a' > c) || (c > 'z')) && 
-            (('0' > c) || (c > '9')) && 
+        c = str.at(i);
+        if( (('A' > c) || (c > 'Z')) &&
+            (('a' > c) || (c > 'z')) &&
+            (('0' > c) || (c > '9')) &&
             ('_' != c) ) {
             str.replace( i, 1, "_");
         }
@@ -894,7 +894,7 @@
   if( constprefix_) {
     return make_valid_delphi_identifier( "T" + program_name_ + "Constants");
   } else {
-    return "TConstants";  // compatibility 
+    return "TConstants";  // compatibility
   }
 }
 
@@ -924,7 +924,7 @@
   indent_up();
   for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
     generate_delphi_doc(s_const, *c_iter);
-    print_const_prop(s_const, normalize_name((*c_iter)->get_name()), 
+    print_const_prop(s_const, normalize_name((*c_iter)->get_name()),
       (*c_iter)->get_type(), (*c_iter)->get_value());
   }
   indent(s_const) << "{$IF CompilerVersion >= 21.0}" << endl;
@@ -1184,7 +1184,7 @@
   indent_up();
   generate_delphi_struct_definition(s_struct, tstruct, is_exception);
   indent_down();
-  
+
   add_defined_type( tstruct);
 
   generate_delphi_struct_impl(s_struct_impl, "", tstruct, is_exception);
@@ -1385,7 +1385,7 @@
   bool is_final = (tstruct->annotations_.find("final") != tstruct->annotations_.end());
   string struct_intf_name;
   string struct_name;
-  string isset_name; 
+  string isset_name;
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
 
@@ -1670,20 +1670,20 @@
   indent_impl(s_service_impl) <<  "constructor " << normalize_clsnm( service_name_, "T") << ".TClient.Create( prot: IProtocol);" << endl;
   indent_impl(s_service_impl) <<  "begin" << endl;
   indent_up_impl();
-  indent_impl(s_service_impl) << "Create( prot, prot );" << endl;    
+  indent_impl(s_service_impl) << "Create( prot, prot );" << endl;
   indent_down_impl();
   indent_impl(s_service_impl) <<  "end;" << endl << endl;
 
   indent(s_service) << "constructor Create( const iprot: IProtocol; const oprot: IProtocol); overload;" << endl;
 
-  indent_impl(s_service_impl) <<  
-    "constructor " << normalize_clsnm( service_name_, "T") << 
+  indent_impl(s_service_impl) <<
+    "constructor " << normalize_clsnm( service_name_, "T") <<
     ".TClient.Create( const iprot: IProtocol; const oprot: IProtocol);" << endl;
   indent_impl(s_service_impl) <<  "begin" << endl;
   indent_up_impl();
-  indent_impl(s_service_impl) << "inherited Create;" << endl;    
-  indent_impl(s_service_impl) << "iprot_ := iprot;" << endl;    
-  indent_impl(s_service_impl) << "oprot_ := oprot;" << endl;    
+  indent_impl(s_service_impl) << "inherited Create;" << endl;
+  indent_impl(s_service_impl) << "iprot_ := iprot;" << endl;
+  indent_impl(s_service_impl) << "oprot_ := oprot;" << endl;
   indent_down_impl();
   indent_impl(s_service_impl) <<  "end;" << endl << endl;
 
@@ -1878,7 +1878,7 @@
       }
 
       if (!(*f_iter)->get_returntype()->is_void()) {
-        indent_impl(s_service_impl) << 
+        indent_impl(s_service_impl) <<
           "raise TApplicationException.Create(TApplicationException.TExceptionType.MissingResult, '" << (*f_iter)->get_name() << " failed: unknown result');" << endl;
       }
 
@@ -1934,7 +1934,7 @@
   }
 
   for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    indent_impl(s_service_impl) << 
+    indent_impl(s_service_impl) <<
       "processMap_.AddOrSetValue( '" << (*f_iter)->get_name() << "', " << (*f_iter)->get_name() << "_Process);" << endl;
   }
   indent_down_impl();
@@ -2088,7 +2088,7 @@
 
   indent(s_service) <<
     "procedure " << funcname << "_Process( seqid: Integer; const iprot: IProtocol; const oprot: IProtocol" <<
-    (events_ ? "; const events : IRequestEvents" : "") << 
+    (events_ ? "; const events : IRequestEvents" : "") <<
     ");" << endl;
 
   if (tfunction->is_oneway()) {
@@ -2099,7 +2099,7 @@
 
   indent_impl(s_service_impl) <<
     "procedure " << full_cls << "." << funcname << "_Process( seqid: Integer; const iprot: IProtocol; const oprot: IProtocol" <<
-    (events_ ? "; const events : IRequestEvents" : "") << 
+    (events_ ? "; const events : IRequestEvents" : "") <<
     ");" << endl;
   indent_impl(s_service_impl) << "var" << endl;
   indent_up_impl();
@@ -2112,7 +2112,7 @@
   indent_down_impl();
   indent_impl(s_service_impl) << "begin" << endl;
   indent_up_impl();
-  
+
   if( events_) {
     indent_impl(s_service_impl) << "if events <> nil then events.PreRead;" << endl;
   }
@@ -2171,7 +2171,7 @@
       indent_up_impl();
       if (!tfunction->is_oneway()) {
         string factory_name = normalize_clsnm((*x_iter)->get_type()->get_name(),"",true) + "Factory";
-        indent_impl(s_service_impl) << 
+        indent_impl(s_service_impl) <<
           "ret." << prop_name(*x_iter) << " := E." << factory_name << ";" << endl;
       }
       indent_down_impl();
@@ -2334,7 +2334,7 @@
     indent_impl(out) << obj << " := iprot.ReadListBegin();" << endl;
   }
 
-  indent_impl(out) << 
+  indent_impl(out) <<
     "for " << counter << " := 0 to " << obj << ".Count - 1 do" << endl;
   indent_impl(out) <<  "begin" << endl;
   indent_up_impl();
@@ -2404,7 +2404,7 @@
   }
 
   string name = prefix + prop_name(tfield, is_xception);
-  
+
   if (type->is_void()) {
     throw "CANNOT GENERATE SERIALIZE CODE FOR void TYPE: " + name;
   }
@@ -2414,7 +2414,7 @@
   } else if (type->is_container()) {
     generate_serialize_container(out, is_xception, type, name, local_vars);
   } else if (type->is_base_type() || type->is_enum()) {
-    
+
     indent_impl(out) <<
       "oprot.";
 
@@ -2490,7 +2490,7 @@
   } else if (ttype->is_set()) {
     obj = tmp("set_");
     local_vars << "  " << obj << " : ISet;" << endl;
-    indent_impl(out) << obj << " := TSetImpl.Create("  << 
+    indent_impl(out) << obj << " := TSetImpl.Create("  <<
       type_to_enum(((t_set*)ttype)->get_elem_type()) << ", " <<
       prefix << ".Count);" << endl;
     indent_impl(out) <<
@@ -2498,7 +2498,7 @@
   } else if (ttype->is_list()) {
     obj = tmp("list_");
     local_vars << "  " << obj << " : IList;" << endl;
-    indent_impl(out) << obj << " := TListImpl.Create("  << 
+    indent_impl(out) << obj << " := TListImpl.Create("  <<
       type_to_enum(((t_list*)ttype)->get_elem_type()) << ", " <<
       prefix << ".Count);" << endl;
     indent_impl(out) <<
@@ -2604,9 +2604,9 @@
 
 string t_delphi_generator::type_name( t_type* ttype, bool b_cls, bool b_no_postfix, bool b_exception_factory, bool b_full_exception_factory) {
 
-  if (ttype->is_typedef()) {    
+  if (ttype->is_typedef()) {
     t_typedef* tdef = (t_typedef*)ttype;
-    if( tdef->is_forward_typedef()) {  // forward types according to THRIFT-2421 
+    if( tdef->is_forward_typedef()) {  // forward types according to THRIFT-2421
       if( tdef->get_type() != NULL)  {
         return type_name( tdef->get_type(), b_cls, b_no_postfix, b_exception_factory, b_full_exception_factory);
       } else {
@@ -2616,7 +2616,7 @@
       return normalize_name( "T"+tdef->get_symbolic());
     }
   }
-  
+
   string typ_nm;
 
   string s_factory;
@@ -2686,13 +2686,13 @@
   // base types
   if (ttype->is_base_type()) {
     switch (((t_base_type*)ttype)->get_base()) {
-  
+
       // these should be const'ed for optimal performamce
       case t_base_type::TYPE_STRING:  // refcounted pointer
       case t_base_type::TYPE_I64:   // larger than 32 bit
       case t_base_type::TYPE_DOUBLE:   // larger than 32 bit
         return "const ";
-  
+
       // all others don't need to be
       case t_base_type::TYPE_BYTE:
       case t_base_type::TYPE_I16:
@@ -2700,16 +2700,16 @@
       case t_base_type::TYPE_BOOL:
       case t_base_type::TYPE_VOID:
         return "";
-      
+
       // we better always report any unknown types
       default:
         throw "compiler error: no input_arg_prefix() for base type " + t_base_type::t_base_name(((t_base_type*)ttype)->get_base());
     }
-  
+
   // enums
   } else if (ttype->is_enum()) {
     return "";   // usually <= 32 bit
-  
+
   // containers
   } else if (ttype->is_map()) {
     return "const ";  // refcounted pointer
@@ -2721,7 +2721,7 @@
     return "const ";  // refcounted pointer
 
   }
-  
+
   // any other type, either TSomething or ISomething
   return "const ";  // possibly refcounted pointer
 }
@@ -3062,7 +3062,7 @@
   }
 
   indent_impl(out) << "Result.UpdateMessageProperty;" << endl;
- 
+
   indent_down_impl();
   indent_impl(out) << "end;" << endl << endl;
 }
@@ -3082,13 +3082,13 @@
   // local bools for required fields
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
-      indent_impl(local_vars) << 
+      indent_impl(local_vars) <<
         "_req_isset_" << prop_name(*f_iter, is_exception) << " : Boolean;" << endl;
-      indent_impl(code_block) << 
+      indent_impl(code_block) <<
         "_req_isset_" << prop_name(*f_iter, is_exception) << " := FALSE;" << endl;
     }
   }
-  
+
   indent_impl(code_block) << "struc := iprot.ReadStructBegin;" << endl;
 
   indent_impl(code_block) << "try" << endl;
@@ -3131,7 +3131,7 @@
 
     // required field?
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
-      indent_impl(code_block) << 
+      indent_impl(code_block) <<
         "_req_isset_" << prop_name(*f_iter, is_exception) << " := TRUE;" << endl;
     }
 
@@ -3176,17 +3176,17 @@
   indent_down_impl();
   indent_impl(code_block) << "end;" << endl;
 
-  // all required fields have been read?  
+  // all required fields have been read?
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
-      indent_impl(code_block) << 
+      indent_impl(code_block) <<
         "if not _req_isset_" << prop_name(*f_iter, is_exception) << endl;
-      indent_impl(code_block) << 
-        "then raise TProtocolException.Create( TProtocolException.INVALID_DATA, '" << 
+      indent_impl(code_block) <<
+        "then raise TProtocolException.Create( TProtocolException.INVALID_DATA, '" <<
         prop_name(*f_iter, is_exception) << "');" << endl;
     }
   }
-  
+
   indent_down_impl();
   indent_impl(code_block) << "end;" << endl << endl;
 
@@ -3295,10 +3295,10 @@
       indent_impl(code_block) <<
         "if (" << prop_name((*f_iter), is_exception) << " <> nil)";
       if (is_optional) {
-        code_block << 
+        code_block <<
           " and __isset_" << prop_name(*f_iter,is_exception);
       }
-      code_block << 
+      code_block <<
         " then" << endl;
       indent_impl(code_block) << "begin" << endl;
       indent_up_impl();
@@ -3390,9 +3390,9 @@
   if( useFirstFlag) {
     indent_impl(out) << tmp_first << " := TRUE;" << endl;
   }
-  
+
   bool had_required = false;  // set to true after first required field has been processed
-  
+
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     bool null_allowed = type_can_be_null((*f_iter)->get_type());
     bool is_optional  = ((*f_iter)->get_req() != t_field::T_REQUIRED);
@@ -3437,12 +3437,12 @@
       indent_impl(out) <<
         tmp_sb << ".Append(" << prop_name((*f_iter), is_exception)  << ");" << endl;
     }
-    
+
     if (null_allowed || is_optional) {
       indent_down_impl();
       indent_impl(out) << "end;" << endl;
-    } 
-    
+    }
+
     if (!is_optional) {
       had_required = true;  // now __first must be false, so we don't need to check it anymore
     }
@@ -3482,9 +3482,9 @@
   return false;
 }
 
-THRIFT_REGISTER_GENERATOR(delphi, "delphi", 
-"    ansistr_binary:  Use AnsiString for binary datatype (default is TBytes).\n" 
-"    register_types:  Enable TypeRegistry, allows for creation of struct, union\n" 
+THRIFT_REGISTER_GENERATOR(delphi, "delphi",
+"    ansistr_binary:  Use AnsiString for binary datatype (default is TBytes).\n"
+"    register_types:  Enable TypeRegistry, allows for creation of struct, union\n"
 "                     and container instances by interface or TypeInfo()\n"
 "    constprefix:     Name TConstants classes after IDL to reduce ambiguities\n"
 "    events:          Enable and use processing events in the generated code.\n"
diff --git a/compiler/cpp/src/generate/t_go_generator.cc b/compiler/cpp/src/generate/t_go_generator.cc
index ec45e40..0fdb519 100644
--- a/compiler/cpp/src/generate/t_go_generator.cc
+++ b/compiler/cpp/src/generate/t_go_generator.cc
@@ -1328,7 +1328,7 @@
     if( have_switch) {
         indent(out) << "switch fieldId {" << endl;
     }
-    
+
     // All the fields we know
     for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
         field_id = (*f_iter)->get_key();
@@ -1341,7 +1341,7 @@
             field_id *= -1;
         }
 
-        out << 
+        out <<
             indent() <<"case " << field_id << ":" << endl;
         indent_up();
         thriftFieldTypeId = type_to_enum((*f_iter)->get_type());
@@ -1357,13 +1357,13 @@
         indent_down();
     }
 
-    // Begin switch default case 
+    // Begin switch default case
     if( have_switch) {
         out <<
             indent() << "default:" << endl;
             indent_up();
     }
-            
+
     // Skip unknown fields in either case
     out <<
         indent() << "if err := iprot.Skip(fieldTypeId); err != nil {" << endl <<
@@ -1526,10 +1526,10 @@
 	string test_suffix("_test");
 	string filename = lowercase(service_name_);
 	string f_service_name;
-	
+
 	size_t fname_len = filename.length();
 	size_t suffix_len = test_suffix.length();
-	
+
 	if ((fname_len >= suffix_len) && (filename.compare(fname_len-suffix_len, suffix_len, test_suffix) == 0)) {
 		f_service_name = package_dir_ + "/" + filename + "_.go";
 	} else {
@@ -2538,7 +2538,7 @@
     }
 
     f_service_ << "); err2 != nil {" << endl;
-    
+
     t_struct* exceptions = tfunction->get_xceptions();
     const vector<t_field*>& x_fields = exceptions->get_members();
     if( ! x_fields.empty()) {
@@ -2551,14 +2551,14 @@
                         indent() << "  case " << type_to_go_type(((*xf_iter)->get_type())) << ":" << endl <<
                         indent() << "result." << publicize(variable_name_to_go_name((*xf_iter)->get_name())) << " = v" << endl;
         }
-        
+
         f_service_ <<
                    indent() << "  default:" << endl;
     }
 
     if (!tfunction->is_oneway()) {
         f_service_ <<
-                   indent() << "  x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, \"Internal error processing " << 
+                   indent() << "  x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, \"Internal error processing " <<
                                escape_string(tfunction->get_name()) << ": \" + err2.Error())" << endl <<
                    indent() << "  oprot.WriteMessageBegin(\"" << escape_string(tfunction->get_name()) << "\", thrift.EXCEPTION, seqId)" << endl <<
                    indent() << "  x.Write(oprot)" << endl <<
@@ -2581,12 +2581,12 @@
         if (!tfunction->get_returntype()->is_void()) {
             f_service_ << " else {" << endl; // make sure we set Success retval only on success
             indent_up();
-            f_service_ << 
+            f_service_ <<
                 indent() << "result.Success = ";
             if(need_reference) {
                 f_service_ << "&";
             }
-            f_service_ << 
+            f_service_ <<
                 "retval" << endl;
             indent_down();
             f_service_ << "}"  << endl;
@@ -2594,7 +2594,7 @@
             f_service_ << endl;
         }
         f_service_ <<
-                   indent() << "if err2 = oprot.WriteMessageBegin(\"" << escape_string(tfunction->get_name()) << 
+                   indent() << "if err2 = oprot.WriteMessageBegin(\"" << escape_string(tfunction->get_name()) <<
                                "\", thrift.REPLY, seqId); err2 != nil {" << endl <<
                    indent() << "  err = err2" << endl <<
                    indent() << "}" << endl <<
diff --git a/compiler/cpp/src/generate/t_gv_generator.cc b/compiler/cpp/src/generate/t_gv_generator.cc
index 46c9d38..a6ab53a 100644
--- a/compiler/cpp/src/generate/t_gv_generator.cc
+++ b/compiler/cpp/src/generate/t_gv_generator.cc
@@ -275,7 +275,7 @@
             print_const_value( ((t_list*)type)->get_elem_type(), *list_iter);
           } else {
             print_const_value( ((t_set*)type)->get_elem_type(), *list_iter);
-          } 
+          }
         }
         f_out_ << " \\}";
       }
diff --git a/compiler/cpp/src/generate/t_hs_generator.cc b/compiler/cpp/src/generate/t_hs_generator.cc
index e9c769a..c969619 100644
--- a/compiler/cpp/src/generate/t_hs_generator.cc
+++ b/compiler/cpp/src/generate/t_hs_generator.cc
@@ -271,7 +271,7 @@
       "import qualified Control.Exception as X\n"
       "import qualified Control.Monad as M ( liftM, ap, when )\n"
       "import Data.Functor ( (<$>) )\n"
-      "import qualified Data.ByteString.Lazy as LBS\n" 
+      "import qualified Data.ByteString.Lazy as LBS\n"
       "import qualified Data.Hashable as H\n"
       "import qualified Data.Int as I\n"
       "import qualified Data.Maybe as M (catMaybes)\n"
@@ -1149,7 +1149,7 @@
     }
     f_client_ << "})" << endl;
     indent(f_client_) << "T.writeMessageEnd op" << endl;
-    
+
     // Write to the stream
     indent(f_client_) << "T.tFlush (T.getTransport op)" << endl;
     indent_down();
@@ -1187,7 +1187,7 @@
         indent(f_client_) << "P.return $ " << field_name(resultname, "success") << " res" << endl;
       else
         indent(f_client_) << "P.return ()" << endl;
- 
+
       // Close function
       indent_down();
     }
@@ -1379,7 +1379,7 @@
     f_service_ << ") :: X.SomeException -> P.IO ()))" << endl;
     indent_down();
     indent_down();
-      
+
   }
   // Close function
   indent_down();
diff --git a/compiler/cpp/src/generate/t_html_generator.cc b/compiler/cpp/src/generate/t_html_generator.cc
index 8632721..5b368bb 100644
--- a/compiler/cpp/src/generate/t_html_generator.cc
+++ b/compiler/cpp/src/generate/t_html_generator.cc
@@ -56,14 +56,14 @@
     : t_generator(program)
   {
     (void) parsed_options;
-    (void) option_string;  
+    (void) option_string;
     out_dir_base_ = "gen-html";
     input_type_ = INPUT_UNKNOWN;
-    
+
     std::map<std::string, std::string>::const_iterator iter;
     iter = parsed_options.find("standalone");
     standalone_ = (iter != parsed_options.end());
-    
+
     escape_.clear();
     escape_['&']  = "&amp;";
     escape_['<']  = "&lt;";
@@ -89,7 +89,7 @@
   bool is_utf8_sequence(std::string const & str, size_t firstpos);
   void detect_input_encoding(std::string const & str, size_t firstpos);
   void init_allowed__markup();
-  
+
   /**
    * Program-level generation functions
    */
@@ -110,8 +110,8 @@
   std::ofstream f_out_;
   std::string  current_file_;
   input_type input_type_;
-  std::map<std::string, int> allowed_markup; 
-  bool standalone_; 
+  std::map<std::string, int> allowed_markup;
+  bool standalone_;
 };
 
 
@@ -321,7 +321,7 @@
 
   f_out_ << "</div></body></html>" << endl;
   f_out_.close();
-  
+
   generate_index();
   generate_css();
 }
@@ -372,7 +372,7 @@
 }
 
 /**
- * Generates the CSS tag. 
+ * Generates the CSS tag.
  * Depending on "standalone", either a CSS file link (default), or the entire CSS is embedded inline.
  */
 void t_html_generator::generate_style_tag() {
@@ -382,11 +382,11 @@
     f_out_ << "<style type=\"text/css\"/><!--" << endl;
     generate_css_content( f_out_);
     f_out_ << "--></style>" << endl;
-  } 
+  }
 }
 
 /**
- * Returns the target file for a <a href> link 
+ * Returns the target file for a <a href> link
  * The returned string is empty, whenever filename refers to the current file.
  */
 std::string t_html_generator::make_file_link( std::string filename) {
@@ -430,11 +430,11 @@
     if( (c & 0xC0) !=  0x80) {
       //pdebug("UTF-8 test: char '%c' (%d) is not a valid UTF-8 following byte", c, int(c));
       return false;  // no UTF-8
-    }    
+    }
     --count;
     ++pos;
   }
-  
+
   // true if the sequence is complete
   return (0 == count);
 }
@@ -447,7 +447,7 @@
     return;
   }
 
-  // fallback 
+  // fallback
   pwarning( 1, "Input is not UTF-8, treating as plain ANSI");
   input_type_ = INPUT_PLAIN;
 }
@@ -510,7 +510,7 @@
   allowed_markup["h6"] = 1;
   allowed_markup["/h6"] = 1;
 }
-  
+
 std::string t_html_generator::escape_html_tags(std::string const & str) {
   std::ostringstream result;
 
@@ -519,8 +519,8 @@
   size_t firstpos = 0;
   while( firstpos < str.length()) {
 
-    // look for non-ASCII char  
-    lastpos = firstpos;    
+    // look for non-ASCII char
+    lastpos = firstpos;
     while( lastpos < str.length()) {
       c = str.at(lastpos);
       if( ('<' == c) || ('>' == c)) {
@@ -528,13 +528,13 @@
       }
       ++lastpos;
     }
-    
-    // copy what we got so far    
+
+    // copy what we got so far
     if( lastpos > firstpos) {
       result << str.substr( firstpos, lastpos-firstpos);
       firstpos = lastpos;
     }
-    
+
     // reached the end?
     if( firstpos >= str.length()) {
       break;
@@ -572,13 +572,13 @@
       tag_key[i] = tolower(tag_key[i]);
     }
     if( allowed_markup.find(tag_key) != allowed_markup.end()) {
-      result << "<" << tag_content << ">"; 
+      result << "<" << tag_content << ">";
     } else {
-      result << "&lt;" << tagstream.str() << "&gt;"; 
+      result << "&lt;" << tagstream.str() << "&gt;";
       pverbose("illegal markup <%s> in doc-comment\n", tag_key.c_str());
     }
   }
-  
+
   return result.str();
 }
 
@@ -588,7 +588,7 @@
   if( input_type_ == INPUT_UTF8) {
     return escape_html_tags(str);
   }
-  
+
   // convert unsafe chars to their &#<num>; equivalent
   std::ostringstream result;
   unsigned char c = '?';
@@ -597,8 +597,8 @@
   size_t firstpos = 0;
   while( firstpos < str.length()) {
 
-    // look for non-ASCII char  
-    lastpos = firstpos;    
+    // look for non-ASCII char
+    lastpos = firstpos;
     while( lastpos < str.length()) {
       c = str.at(lastpos);
       ic = c;
@@ -607,8 +607,8 @@
       }
       ++lastpos;
     }
-    
-    // copy what we got so far    
+
+    // copy what we got so far
     if( lastpos > firstpos) {
       result << str.substr( firstpos, lastpos-firstpos);
       firstpos = lastpos;
@@ -624,8 +624,8 @@
     {
       switch( c)
       {
-        case '\r' :  
-        case '\n' :  
+        case '\r' :
+        case '\n' :
         case '\t' :
           result << c;
           break;
@@ -633,9 +633,9 @@
           break;
       }
       ++firstpos;
-      continue;        
+      continue;
     }
-    
+
     // reached the end?
     if( firstpos >= str.length()) {
       break;
@@ -650,18 +650,18 @@
         break;
       }
     }
-    
+
     // convert the character to something useful based on the detected encoding
     switch( input_type_) {
-      case INPUT_PLAIN: 
-        result << "&#" << ic << ";";  
+      case INPUT_PLAIN:
+        result << "&#" << ic << ";";
         ++firstpos;
         break;
       default:
         throw "Unexpected or unrecognized input encoding";
     }
   }
-  
+
   return escape_html_tags(result.str());
 }
 
@@ -727,12 +727,12 @@
     f_out_ << "<code><a href=\"" + make_file_link(fname) + "#Const_" + name +"\">" + name + "</a></code>";
     return;
   }
-  
+
   t_type* truetype = type;
   while (truetype->is_typedef()) {
     truetype = ((t_typedef*)truetype)->get_type();
   }
-  
+
   bool first = true;
   if (truetype->is_base_type()) {
     t_base_type::t_base tbase = ((t_base_type*)truetype)->get_base();
diff --git a/compiler/cpp/src/generate/t_java_generator.cc b/compiler/cpp/src/generate/t_java_generator.cc
index 11b4754..e22a4d9 100644
--- a/compiler/cpp/src/generate/t_java_generator.cc
+++ b/compiler/cpp/src/generate/t_java_generator.cc
@@ -282,7 +282,7 @@
 
   std::string make_valid_java_filename( std::string const & fromName);
   std::string make_valid_java_identifier( std::string const & fromName);
-  
+
   bool type_can_be_null(t_type* ttype) {
     ttype = get_true_type(ttype);
 
@@ -366,7 +366,7 @@
   string hash_builder;
   string tree_set_and_map;
   if (sorted_containers_) {
-    tree_set_and_map = string() + 
+    tree_set_and_map = string() +
       "import java.util.TreeSet;\n" +
       "import java.util.TreeMap;\n";
   }
@@ -392,7 +392,7 @@
     "import java.util.Set;\n" +
     "import java.util.HashSet;\n" +
     "import java.util.EnumSet;\n" +
-    tree_set_and_map + 
+    tree_set_and_map +
     "import java.util.Collections;\n" +
     "import java.util.BitSet;\n" +
     "import java.nio.ByteBuffer;\n"
@@ -440,7 +440,7 @@
 
   // Add java imports
   f_enum << string() +
-    "import java.util.Map;\n" + 
+    "import java.util.Map;\n" +
     "import java.util.HashMap;\n" +
     "import org.apache.thrift.TEnum;" << endl << endl;
 
@@ -498,7 +498,7 @@
   }
 
   indent(f_enum) << "default:" << endl;
-  indent(f_enum) << "  return null;" << endl;  
+  indent(f_enum) << "  return null;" << endl;
 
   indent_down();
 
@@ -695,7 +695,7 @@
 }
 
 /**
- * Generates a struct definition for a thrift data type. This will be a org.apache.thrift.TBase 
+ * Generates a struct definition for a thrift data type. This will be a org.apache.thrift.TBase
  * implementor.
  *
  * @param tstruct The struct definition
@@ -912,7 +912,7 @@
       indent(out) << "  if (getSetField() == _Fields." << constant_name(field->get_name()) << ") {" << endl;
       indent(out) << "    return (" << type_name(field->get_type(), true) << ")getFieldValue();" << endl;
       indent(out) << "  } else {" << endl;
-      indent(out) << "    throw new RuntimeException(\"Cannot get field '" << field->get_name() 
+      indent(out) << "    throw new RuntimeException(\"Cannot get field '" << field->get_name()
         << "' because union is currently set to \" + getFieldDesc(getSetField()).name);" << endl;
       indent(out) << "  }" << endl;
       indent(out) << "}" << endl;
@@ -999,8 +999,8 @@
     indent(out) << "  if (value instanceof " << type_name(field->get_type(), true, false, true) << ") {" << endl;
     indent(out) << "    break;" << endl;
     indent(out) << "  }" << endl;
-    indent(out) << "  throw new ClassCastException(\"Was expecting value of type " 
-      << type_name(field->get_type(), true, false) << " for field '" << field->get_name() 
+    indent(out) << "  throw new ClassCastException(\"Was expecting value of type "
+      << type_name(field->get_type(), true, false) << " for field '" << field->get_name()
       << "', but got \" + value.getClass().getSimpleName());" << endl;
     // do the real check here
   }
@@ -1056,7 +1056,7 @@
 
   indent_down();
   indent(out) << "} else {" << endl;
-  indent_up();  
+  indent_up();
   indent(out) << "org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);" << endl;
   indent(out) << "return null;" << endl;
   indent_down();
@@ -1083,7 +1083,7 @@
 
     indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
     indent_up();
-    indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name() 
+    indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name()
       << " = (" <<  type_name(field->get_type(), true, false) << ")value_;" << endl;
     generate_serialize_field(out, field, "");
     indent(out) << "return;" << endl;
@@ -1104,21 +1104,21 @@
 void t_java_generator::generate_tuple_scheme_read_value(ofstream& out, t_struct* tstruct) {
   indent(out) << "@Override" << endl;
   indent(out) << "protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException {" << endl;
-  
+
   indent_up();
-  
+
   indent(out) << "_Fields setField = _Fields.findByThriftId(fieldID);" << endl;
   indent(out) << "if (setField != null) {" << endl;
   indent_up();
   indent(out) << "switch (setField) {" << endl;
   indent_up();
-  
+
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
-  
+
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_field* field = (*m_iter);
-    
+
     indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
     indent_up();
     indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name() << ";" << endl;
@@ -1126,13 +1126,13 @@
     indent(out) << "return " << field->get_name() << ";" << endl;
     indent_down();
   }
-  
+
   indent(out) << "default:" << endl;
   indent(out) << "  throw new IllegalStateException(\"setField wasn't null, but didn't match any of the case statements!\");" << endl;
-  
+
   indent_down();
   indent(out) << "}" << endl;
-  
+
   indent_down();
   indent(out) << "} else {" << endl;
   indent_up();
@@ -1146,35 +1146,35 @@
 void t_java_generator::generate_tuple_scheme_write_value(ofstream& 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;
-  
+
   indent_up();
-  
+
   indent(out) << "switch (setField_) {" << endl;
   indent_up();
-  
+
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
-  
+
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_field* field = (*m_iter);
-    
+
     indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
     indent_up();
-    indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name() 
+    indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name()
     << " = (" <<  type_name(field->get_type(), true, false) << ")value_;" << endl;
     generate_serialize_field(out, field, "");
     indent(out) << "return;" << endl;
     indent_down();
   }
-  
+
   indent(out) << "default:" << endl;
   indent(out) << "  throw new IllegalStateException(\"Cannot write union with unknown field \" + setField_);" << endl;
-  
+
   indent_down();
   indent(out) << "}" << endl;
-  
+
   indent_down();
-  
+
   indent(out) << "}" << endl;
 }
 
@@ -1452,7 +1452,7 @@
     break;
   case ISSET_BITSET:
     indent(out) << "__isset_bit_vector.clear();" << endl;
-    indent(out) << "__isset_bit_vector.or(other.__isset_bit_vector);" << endl;    
+    indent(out) << "__isset_bit_vector.or(other.__isset_bit_vector);" << endl;
     break;
   }
 
@@ -1893,7 +1893,7 @@
   (void) tstruct;
   indent(out) << "public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {" << endl;
   indent_up();
-  indent(out) << "schemes.get(iprot.getScheme()).getScheme().read(iprot, this);" << endl; 
+  indent(out) << "schemes.get(iprot.getScheme()).getScheme().read(iprot, this);" << endl;
   indent_down();
   indent(out) << "}" << endl <<
   endl;
@@ -1973,7 +1973,7 @@
   indent(out) << "public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {" << endl;
   indent_up();
   indent(out) << "schemes.get(oprot.getScheme()).getScheme().write(oprot, this);" << endl;
-  
+
   indent_down();
   indent(out) << "  }" << endl << endl;
 }
@@ -2273,7 +2273,7 @@
       indent(out) << "__isset_bit_vector.set(" << isset_field_id(field) << ", value);" << endl;
     }
     indent_down();
-    indent(out) << "}" << endl << endl; 
+    indent(out) << "}" << endl << endl;
   }
 }
 
@@ -2387,7 +2387,7 @@
   indent(out) << "}" << endl << endl;
 }
 
-/** 
+/**
  * Returns a string with the java representation of the given thrift type
  * (e.g. for the type struct it returns "org.apache.thrift.protocol.TType.STRUCT")
  */
@@ -2435,12 +2435,12 @@
   } else if (type->is_container()){
     if (type->is_list()){
       indent(out) << "new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, ";
-      t_type* elem_type = ((t_list*)type)->get_elem_type();    
-      generate_field_value_meta_data(out, elem_type);   
+      t_type* elem_type = ((t_list*)type)->get_elem_type();
+      generate_field_value_meta_data(out, elem_type);
     } else if (type->is_set()){
       indent(out) << "new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, ";
-      t_type* elem_type = ((t_list*)type)->get_elem_type();    
-      generate_field_value_meta_data(out, elem_type); 
+      t_type* elem_type = ((t_list*)type)->get_elem_type();
+      generate_field_value_meta_data(out, elem_type);
     } else{ // map
       indent(out) << "new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, ";
       t_type* key_type = ((t_map*)type)->get_key_type();
@@ -2748,7 +2748,7 @@
   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;
-  indent(f_service_) << "    this.clientManager = clientManager;" << 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;
@@ -2780,7 +2780,7 @@
     string args_name = (*f_iter)->get_name() + "_args";
     string result_name = (*f_iter)->get_name() + "_result";
 
-    // Main method body   
+    // Main method body
     indent(f_service_) << "public " << function_signature_async(*f_iter, false) << " throws org.apache.thrift.TException {" << endl;
     indent(f_service_) << "  checkReady();" << endl;
     indent(f_service_) << "  " << funclassname << " method_call = new " + funclassname + "(" << async_argument_list(*f_iter, arg_struct, ret_type) << ", this, ___protocolFactory, ___transport);" << endl;
@@ -2818,7 +2818,7 @@
 
     // Serialize request
     // NOTE we are leaving seqid as 0, for now (see above)
-    f_service_ << 
+    f_service_ <<
       indent() << "prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage(\"" <<
       funname << "\", org.apache.thrift.protocol." <<
       ((*f_iter)->is_oneway() ? "TMessageType.ONEWAY" : "TMessageType.CALL") <<
@@ -2829,14 +2829,14 @@
       f_service_ << indent() << "args.set" << get_cap_name((*fld_iter)->get_name()) << "(" << (*fld_iter)->get_name() << ");" << endl;
     }
 
-    f_service_ << 
+    f_service_ <<
       indent() << "args.write(prot);" << endl <<
       indent() << "prot.writeMessageEnd();" << endl;
 
     indent_down();
     indent(f_service_) << "}" << endl << endl;
 
-    // Return method  
+    // Return method
     indent(f_service_) << "public " + type_name(ret_type) + " getResult() throws ";
     vector<t_field*>::const_iterator x_iter;
     for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
@@ -2854,7 +2854,7 @@
     if (!(*f_iter)->is_oneway()) {
       indent(f_service_);
       if (!ret_type->is_void()) {
-        f_service_ << "return "; 
+        f_service_ << "return ";
       }
       f_service_ << "(new Client(prot)).recv" + sep + javaname + "();" << endl;
     }
@@ -3386,13 +3386,13 @@
   } else {
     // Declare variables, read header
     if (ttype->is_map()) {
-      indent(out) << "org.apache.thrift.protocol.TMap " << obj << " = new org.apache.thrift.protocol.TMap(" << 
+      indent(out) << "org.apache.thrift.protocol.TMap " << obj << " = new org.apache.thrift.protocol.TMap(" <<
       type_to_enum(((t_map*)ttype)->get_key_type()) << ", " << type_to_enum(((t_map*)ttype)->get_val_type()) << ", " << "iprot.readI32());" << endl;
     } else if (ttype->is_set()) {
-      indent(out) << "org.apache.thrift.protocol.TSet " << obj << " = new org.apache.thrift.protocol.TSet(" << 
+      indent(out) << "org.apache.thrift.protocol.TSet " << obj << " = new org.apache.thrift.protocol.TSet(" <<
       type_to_enum(((t_set*)ttype)->get_elem_type()) << ", iprot.readI32());" << endl;
     } else if (ttype->is_list()) {
-      indent(out) << "org.apache.thrift.protocol.TList " << obj << " = new org.apache.thrift.protocol.TList(" << 
+      indent(out) << "org.apache.thrift.protocol.TList " << obj << " = new org.apache.thrift.protocol.TList(" <<
       type_to_enum(((t_set*)ttype)->get_elem_type()) << ", iprot.readI32());" << endl;
     }
   }
@@ -3402,8 +3402,8 @@
     indent_up();
   }
 
-  out << 
-      indent() << prefix << " = new " << type_name(ttype, false, true); 
+  out <<
+      indent() << prefix << " = new " << type_name(ttype, false, true);
 
   // size the collection correctly
   if (sorted_containers_ && (ttype->is_map() || ttype->is_set())) {
@@ -3450,7 +3450,7 @@
  */
 void t_java_generator::generate_deserialize_map_element(ofstream& out,
                                                         t_map* tmap,
-                                                        string prefix, 
+                                                        string prefix,
                                                         string obj, bool has_metadata) {
   string key = tmp("_key");
   string val = tmp("_val");
@@ -3466,7 +3466,7 @@
        "for (int " << i << " = 0; " <<
           i << " < " << obj << ".size" << "; " <<
           "++" << i << ")" << endl;
-  
+
   scope_up(out);
 
   generate_deserialize_field(out, &fkey, "", has_metadata);
@@ -3480,7 +3480,7 @@
  */
 void t_java_generator::generate_deserialize_set_element(ofstream& out,
                                                         t_set* tset,
-                                                        string prefix, 
+                                                        string prefix,
                                                         string obj, bool has_metadata) {
   string elem = tmp("_elem");
   t_field felem(tset->get_elem_type(), elem);
@@ -3494,7 +3494,7 @@
           i << " < " << obj << ".size" << "; " <<
           "++" << i << ")" << endl;
   scope_up(out);
-  
+
   generate_deserialize_field(out, &felem, "", has_metadata);
 
   indent(out) << prefix << ".add(" << elem << ");" << endl;
@@ -3506,7 +3506,7 @@
  */
 void t_java_generator::generate_deserialize_list_element(ofstream& out,
                                                          t_list* tlist,
-                                                         string prefix, 
+                                                         string prefix,
                                                          string obj, bool has_metadata) {
   string elem = tmp("_elem");
   t_field felem(tlist->get_elem_type(), elem);
@@ -3520,7 +3520,7 @@
           i << " < " << obj << ".size" << "; " <<
           "++" << i << ")" << endl;
   scope_up(out);
- 
+
   generate_deserialize_field(out, &felem, "", has_metadata);
 
   indent(out) << prefix << ".add(" << elem << ");" << endl;
@@ -3557,7 +3557,7 @@
     indent(out) << "oprot.";
 
     if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();  
+      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
       switch (tbase) {
         case t_base_type::TYPE_VOID:
           throw "compiler error: cannot serialize void field in a struct: " + name;
@@ -3763,7 +3763,7 @@
     if (in_init) {
       if (sorted_containers_) {
         prefix = "TreeSet";
-      } else { 
+      } else {
         prefix = "HashSet";
       }
     } else {
@@ -4058,7 +4058,7 @@
 
     // tests rely on this
     assert( ('A' < 'Z') && ('a' < 'z') && ('0' < '9'));
-    
+
     // if the first letter is a number, we add an additional underscore in front of it
     char c = str.at(0);
     if( ('0' <= c) && (c <= '9')) {
@@ -4067,10 +4067,10 @@
 
     // following chars: letter, number or underscore
     for( size_t i = 0;  i < str.size();  ++i) {
-        c = str.at(i);        
-        if( (('A' > c) || (c > 'Z')) && 
-            (('a' > c) || (c > 'z')) && 
-            (('0' > c) || (c > '9')) && 
+        c = str.at(i);
+        if( (('A' > c) || (c > 'Z')) &&
+            (('a' > c) || (c > 'z')) &&
+            (('0' > c) || (c > '9')) &&
             ('_' != c) ) {
             str.replace( i, 1, "_");
         }
@@ -4160,7 +4160,7 @@
     source_name = source_name_p1;
   else
     source_name = source_name_p1 + "." + source_name_p2;
-  
+
   bool copy_construct_container;
   if (container->is_map()) {
     t_map *tmap = (t_map *)container;
@@ -4319,8 +4319,8 @@
 void t_java_generator::generate_scheme_map(ofstream& out, t_struct* tstruct) {
   indent(out) << "private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();" << endl;
   indent(out) << "static {" << endl;
-  indent(out) << "  schemes.put(StandardScheme.class, new " << tstruct->get_name() << "StandardSchemeFactory());" << endl;  
-  indent(out) << "  schemes.put(TupleScheme.class, new " << tstruct->get_name() << "TupleSchemeFactory());" << endl;  
+  indent(out) << "  schemes.put(StandardScheme.class, new " << tstruct->get_name() << "StandardSchemeFactory());" << endl;
+  indent(out) << "  schemes.put(TupleScheme.class, new " << tstruct->get_name() << "TupleSchemeFactory());" << endl;
   indent(out) << "}" << endl;
 }
 
@@ -4620,7 +4620,7 @@
 void t_java_generator::generate_standard_writer(ofstream& out, t_struct* tstruct, bool is_result) {
   indent_up();
   out <<
-    indent() << "public void write(org.apache.thrift.protocol.TProtocol oprot, " << 
+    indent() << "public void write(org.apache.thrift.protocol.TProtocol oprot, " <<
     tstruct->get_name() << " struct) throws org.apache.thrift.TException {" << endl;
   indent_up();
   const vector<t_field*>& fields = tstruct->get_sorted_members();
@@ -4662,7 +4662,7 @@
     }
   }
   // Write the struct map
-  out << 
+  out <<
     indent() << "oprot.writeFieldStop();" << endl <<
     indent() << "oprot.writeStructEnd();" << endl;
 
@@ -4727,7 +4727,7 @@
     }
   }
   indent_down();
-  indent(out) << "}" << endl;  
+  indent(out) << "}" << endl;
 }
 
 void t_java_generator::generate_java_struct_tuple_writer(ofstream& out, t_struct* tstruct) {
diff --git a/compiler/cpp/src/generate/t_javame_generator.cc b/compiler/cpp/src/generate/t_javame_generator.cc
index c28571e..eb934ac 100644
--- a/compiler/cpp/src/generate/t_javame_generator.cc
+++ b/compiler/cpp/src/generate/t_javame_generator.cc
@@ -389,14 +389,14 @@
     indent(f_enum) << "case " << value << ":" << endl;
     indent(f_enum) << "  return " << (*c_iter)->get_name() << ";" << endl;
   }
-  
+
   indent(f_enum) << "default:" << endl;
-  indent(f_enum) << "  return null;" << endl;  
+  indent(f_enum) << "  return null;" << endl;
 
   indent_down();
 
   indent(f_enum) << "}" << endl;
-  
+
   indent_down();
 
   indent(f_enum) << "}" << endl;
@@ -617,7 +617,7 @@
 }
 
 /**
- * Generates a struct definition for a thrift data type. This will be a TBase 
+ * Generates a struct definition for a thrift data type. This will be a TBase
  * implementor.
  *
  * @param tstruct The struct definition
@@ -705,7 +705,7 @@
   f_struct << endl;
 
   generate_union_getters_and_setters(f_struct, tstruct);
-  
+
   f_struct << endl;
 
   generate_union_comparisons(f_struct, tstruct);
@@ -746,14 +746,14 @@
     indent(out) << "  " << type_name(tstruct) << " x = new " << type_name(tstruct) << "();" << endl;
     indent(out) << "  x.set" << get_cap_name((*m_iter)->get_name()) << "(value);" << endl;
     indent(out) << "  return x;" << endl;
-    indent(out) << "}" << endl << endl; 
+    indent(out) << "}" << endl << endl;
   }
 }
 
 void t_javame_generator::generate_union_getters_and_setters(ofstream& out, t_struct* tstruct) {
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
-  
+
   bool first = true;
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     if (first) {
@@ -769,11 +769,11 @@
     indent(out) << "  if (getSetField() == _Fields." << constant_name(field->get_name()) << ") {" << endl;
     indent(out) << "    return (" << type_name(field->get_type(), true) << ")getFieldValue();" << endl;
     indent(out) << "  } else {" << endl;
-    indent(out) << "    throw new RuntimeException(\"Cannot get field '" << field->get_name() 
+    indent(out) << "    throw new RuntimeException(\"Cannot get field '" << field->get_name()
       << "' because union is currently set to \" + getFieldDesc(getSetField()).name);" << endl;
     indent(out) << "  }" << endl;
     indent(out) << "}" << endl;
-    
+
     out << endl;
 
     generate_java_doc(out, field);
@@ -812,23 +812,23 @@
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_field* field = (*m_iter);
-    
+
     indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
     indent(out) << "  if (value instanceof " << type_name(field->get_type(), true, false, true) << ") {" << endl;
     indent(out) << "    break;" << endl;
     indent(out) << "  }" << endl;
-    indent(out) << "  throw new ClassCastException(\"Was expecting value of type " 
-      << type_name(field->get_type(), true, false) << " for field '" << field->get_name() 
+    indent(out) << "  throw new ClassCastException(\"Was expecting value of type "
+      << type_name(field->get_type(), true, false) << " for field '" << field->get_name()
       << "', but got \" + value.getClass().getSimpleName());" << endl;
     // do the real check here
   }
-  
+
   indent(out) << "default:" << endl;
   indent(out) << "  throw new IllegalArgumentException(\"Unknown field id \" + setField);" << endl;
 
   indent_down();
   indent(out) << "}" << endl;
-  
+
   indent_down();
   indent(out) << "}" << endl;
 }
@@ -849,7 +849,7 @@
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_field* field = (*m_iter);
-    
+
     indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
     indent_up();
     indent(out) << "if (field.type == " << constant_name(field->get_name()) << "_FIELD_DESC.type) {" << endl;
@@ -896,16 +896,16 @@
 
   for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
     t_field* field = (*m_iter);
-    
+
     indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
     indent_up();
-    indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name() 
+    indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name()
       << " = (" <<  type_name(field->get_type(), true, false) << ")value_;" << endl;
     generate_serialize_field(out, field, "");
     indent(out) << "return;" << endl;
     indent_down();
   }
-  
+
   indent(out) << "default:" << endl;
   indent(out) << "  throw new IllegalStateException(\"Cannot write union with unknown field \" + setField_);" << endl;
 
@@ -922,7 +922,7 @@
 void t_javame_generator::generate_get_field_desc(ofstream& out, t_struct* tstruct) {
   indent(out) << "protected TField getFieldDesc(_Fields setField) {" << endl;
   indent_up();
-  
+
   const vector<t_field*>& members = tstruct->get_members();
   vector<t_field*>::const_iterator m_iter;
 
@@ -1509,7 +1509,7 @@
     out << "(this." << generate_isset_check(*f_iter) << ") {" << endl;
 
     indent_up();
-    
+
     indent(out) << "oprot.writeFieldBegin(" << constant_name((*f_iter)->get_name()) << "_FIELD_DESC);" << endl;
 
     // Write field contents
@@ -1737,7 +1737,7 @@
       indent(out) << "__isset_vector[" << isset_field_id(field) << "] = value;" << endl;
     }
     indent_down();
-    indent(out) << "}" << endl << endl; 
+    indent(out) << "}" << endl << endl;
   }
 }
 
@@ -1778,13 +1778,13 @@
       indent(out) << "} else {" << endl;
       indent_up();
     }
-    
+
     if (field->get_type()->is_base_type() && ((t_base_type*)(field->get_type()))->is_binary()) {
       indent(out) << "TBaseHelper.toString(this." << field->get_name() << ", sb);" << endl;
     } else {
       indent(out) << "sb.append(this." << (*f_iter)->get_name() << ");" << endl;
     }
-    
+
     if (can_be_null) {
       indent_down();
       indent(out) << "}" << endl;
@@ -1806,7 +1806,7 @@
     endl;
 }
 
-/** 
+/**
  * Returns a string with the java representation of the given thrift type
  * (e.g. for the type struct it returns "TType.STRUCT")
  */
@@ -1849,12 +1849,12 @@
   } else if (type->is_container()){
     if (type->is_list()){
       indent(out) << "new ListMetaData(TType.LIST, ";
-      t_type* elem_type = ((t_list*)type)->get_elem_type();    
-      generate_field_value_meta_data(out, elem_type);   
+      t_type* elem_type = ((t_list*)type)->get_elem_type();
+      generate_field_value_meta_data(out, elem_type);
     } else if (type->is_set()){
       indent(out) << "new SetMetaData(TType.SET, ";
-      t_type* elem_type = ((t_list*)type)->get_elem_type();    
-      generate_field_value_meta_data(out, elem_type); 
+      t_type* elem_type = ((t_list*)type)->get_elem_type();
+      generate_field_value_meta_data(out, elem_type);
     } else{ // map
       indent(out) << "new MapMetaData(TType.MAP, ";
       t_type* key_type = ((t_map*)type)->get_key_type();
@@ -1930,7 +1930,7 @@
   if (tservice->get_extends() != NULL) {
     extends_iface = " extends " + type_name(tservice->get_extends()) + "Iface";
   }
-  
+
   f_iface <<
     autogen_comment() <<
     java_package() <<
@@ -2346,7 +2346,7 @@
   f_service_ <<
     indent() << "args.read(iprot);" << endl;
   indent_down();
-  f_service_ << 
+  f_service_ <<
     indent() << "} catch (TProtocolException e) {" << endl;
   indent_up();
   f_service_ <<
@@ -3238,7 +3238,7 @@
     }
 
     indent(out)
-      << "for (Enumeration " << enumeration_name << " = " << source_name << ".elements(); " 
+      << "for (Enumeration " << enumeration_name << " = " << source_name << ".elements(); "
       << enumeration_name << ".hasMoreElements(); ) {" << endl;
     indent_up();
     indent(out)
diff --git a/compiler/cpp/src/generate/t_js_generator.cc b/compiler/cpp/src/generate/t_js_generator.cc
index d330be9..d753bbb 100644
--- a/compiler/cpp/src/generate/t_js_generator.cc
+++ b/compiler/cpp/src/generate/t_js_generator.cc
@@ -66,8 +66,8 @@
      }
      else {
        gen_ts_ = false;
-     } 
-    
+     }
+
      if (gen_node_ && gen_jquery_) {
        throw "Invalid switch: [-gen js:node,jquery] options not compatible, try: [-gen js:node -gen js:jquery]";
      }
@@ -289,7 +289,7 @@
     if (tdoc->has_doc()) {
       std::stringstream doc(tdoc->get_doc());
       string item;
-      
+
       result += ts_indent() + "/**" + endl;
       while (std::getline(doc, item)) {
         result += ts_indent() + " * " + item + endl;
@@ -2178,7 +2178,7 @@
 
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     str += (*f_iter)->get_name() + ts_get_req(*f_iter) + ": " + ts_get_type((*f_iter)->get_type());
-    
+
     if (f_iter + 1 != fields.end()) {
       str += ", ";
     }
diff --git a/compiler/cpp/src/generate/t_perl_generator.cc b/compiler/cpp/src/generate/t_perl_generator.cc
index 6059ee8..5a5c080 100644
--- a/compiler/cpp/src/generate/t_perl_generator.cc
+++ b/compiler/cpp/src/generate/t_perl_generator.cc
@@ -1162,7 +1162,7 @@
     // Serialize the request header
     f_service_ <<
       indent() << "$self->{output}->writeMessageBegin('" << (*f_iter)->get_name() << "', " <<
-      ((*f_iter)->is_oneway() ? "TMessageType::ONEWAY" : "TMessageType::CALL") << 
+      ((*f_iter)->is_oneway() ? "TMessageType::ONEWAY" : "TMessageType::CALL") <<
       ", $self->{seqid});" << endl;
 
     f_service_ <<
diff --git a/compiler/cpp/src/generate/t_rb_generator.cc b/compiler/cpp/src/generate/t_rb_generator.cc
index 3cfc0b1..0a15500 100644
--- a/compiler/cpp/src/generate/t_rb_generator.cc
+++ b/compiler/cpp/src/generate/t_rb_generator.cc
@@ -186,7 +186,7 @@
                                           t_list*     tlist,
                                           std::string iter);
 
-  void generate_rdoc                     (t_rb_ofstream& out, 
+  void generate_rdoc                     (t_rb_ofstream& out,
                                           t_doc* tdoc);
 
   /**
@@ -383,7 +383,7 @@
     generate_rdoc(f_types_, *c_iter);
     f_types_.indent() << name << " = " << value << endl;
   }
-  
+
   // Create a hash mapping values back to their names (as strings) since ruby has no native enum type
   f_types_.indent() << "VALUE_MAP = {";
   for(c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
@@ -393,7 +393,7 @@
     f_types_ << value << " => \"" << capitalize((*c_iter)->get_name()) << "\"";
   }
   f_types_ << "}" << endl;
-  
+
   // Create a set with valid values for this enum
   f_types_.indent() << "VALID_VALUES = Set.new([";
   for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
@@ -615,7 +615,7 @@
     out.indent() << "  " << tstruct->get_name() << ".new(:" << field_name << ", val)" << endl;
     out.indent() << "end" << endl;
   }
-  
+
   out.indent_down();
   out.indent() << "end" << endl;
 
@@ -652,7 +652,7 @@
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     std::string field_name = (*f_iter)->get_name();
     std::string cap_field_name = upcase_string(field_name);
-    
+
     out.indent() << cap_field_name << " = " << (*f_iter)->get_key() << endl;
   }
   out << endl;
@@ -674,15 +674,15 @@
 
     out.indent() << upcase_string((*f_iter)->get_name()) << " => ";
 
-    generate_field_data(out, (*f_iter)->get_type(), (*f_iter)->get_name(), (*f_iter)->get_value(), 
+    generate_field_data(out, (*f_iter)->get_type(), (*f_iter)->get_name(), (*f_iter)->get_value(),
       (*f_iter)->get_req() == t_field::T_OPTIONAL);
   }
   out.indent_down();
   out << endl;
   out.indent() << "}" << endl << endl;
-  
+
   out.indent() << "def struct_fields; FIELDS; end" << endl << endl;
-  
+
 }
 
 void t_rb_generator::generate_field_data(t_rb_ofstream& out, t_type* field_type,
@@ -721,7 +721,7 @@
       out << ", :binary => true";
     }
   }
-  
+
   if(optional) {
     out << ", :optional => true";
   }
@@ -1191,7 +1191,7 @@
   }
 }
 
-void t_rb_generator::generate_rb_struct_required_validator(t_rb_ofstream& out, 
+void t_rb_generator::generate_rb_struct_required_validator(t_rb_ofstream& out,
                                                            t_struct* tstruct) {
   out.indent() << "def validate" << endl;
   out.indent_up();
@@ -1218,14 +1218,14 @@
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     t_field* field = (*f_iter);
 
-    if (field->get_type()->is_enum()){      
+    if (field->get_type()->is_enum()){
       out.indent() << "unless @" << field->get_name() << ".nil? || " <<
         full_type_name(field->get_type()) << "::VALID_VALUES.include?(@" <<
         field->get_name() << ")" << endl;
       out.indent_up();
       out.indent() <<
         "raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field " <<
-        field->get_name() << "!')" << endl;  
+        field->get_name() << "!')" << endl;
       out.indent_down();
       out.indent() << "end" << endl;
     }
@@ -1235,7 +1235,7 @@
   out.indent() << "end" << endl << endl;
 }
 
-void t_rb_generator::generate_rb_union_validator(t_rb_ofstream& out, 
+void t_rb_generator::generate_rb_union_validator(t_rb_ofstream& out,
                                                  t_struct* tstruct) {
   out.indent() << "def validate" << endl;
   out.indent_up();
@@ -1250,12 +1250,12 @@
   for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
     const t_field* field = (*f_iter);
 
-    if (field->get_type()->is_enum()){      
+    if (field->get_type()->is_enum()){
       out.indent() << "if get_set_field == :" << field->get_name() << endl;
       out.indent() <<
         "  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field " <<
         field->get_name() << "!') unless " << full_type_name(field->get_type()) <<
-        "::VALID_VALUES.include?(get_value)" << endl;  
+        "::VALID_VALUES.include?(get_value)" << endl;
       out.indent() << "end" << endl;
     }
   }
diff --git a/compiler/cpp/src/main.cc b/compiler/cpp/src/main.cc
index 9e92f1f..ed57596 100755
--- a/compiler/cpp/src/main.cc
+++ b/compiler/cpp/src/main.cc
@@ -146,7 +146,7 @@
  */
 int g_doctext_lineno;
 
-/** 
+/**
  * The First doctext comment
  */
 char* g_program_doctext_candidate;
@@ -414,10 +414,10 @@
  */
 void declare_valid_program_doctext() {
   if((g_program_doctext_candidate != NULL) && (g_program_doctext_status == STILL_CANDIDATE)) {
-    g_program_doctext_status = ABSOLUTELY_SURE;  
+    g_program_doctext_status = ABSOLUTELY_SURE;
     pdebug("%s","program doctext set to ABSOLUTELY_SURE");
   } else {
-    g_program_doctext_status = NO_PROGRAM_DOCTEXT;  
+    g_program_doctext_status = NO_PROGRAM_DOCTEXT;
     pdebug("%s","program doctext set to NO_PROGRAM_DOCTEXT");
   }
 }
@@ -908,11 +908,11 @@
     if( fgetc(f) == 0xBB) {
       if( fgetc(f) == 0xBF) {
         return true;
-      } 
-    } 
-  } 
-  
-  rewind(f); 
+      }
+    }
+  }
+
+  rewind(f);
   return false;
 }
 
@@ -935,7 +935,7 @@
   }
   if( skip_utf8_bom( yyin))
     pverbose("Skipped UTF-8 BOM at %s\n", path.c_str());
-  
+
   // Create new scope and scan for includes
   pverbose("Scanning %s for includes\n", path.c_str());
   g_parse_mode = INCLUDES;
@@ -977,7 +977,7 @@
   }
   if( skip_utf8_bom( yyin))
     pverbose("Skipped UTF-8 BOM at %s\n", path.c_str());
-  
+
   pverbose("Parsing %s for types\n", path.c_str());
   yylineno = 1;
   try {
diff --git a/compiler/cpp/src/md5.h b/compiler/cpp/src/md5.h
index 698c995..3baa4dc 100644
--- a/compiler/cpp/src/md5.h
+++ b/compiler/cpp/src/md5.h
@@ -71,7 +71,7 @@
 } md5_state_t;
 
 #ifdef __cplusplus
-extern "C" 
+extern "C"
 {
 #endif
 
diff --git a/compiler/cpp/src/parse/t_program.h b/compiler/cpp/src/parse/t_program.h
index 1536f81..d18cc5d 100644
--- a/compiler/cpp/src/parse/t_program.h
+++ b/compiler/cpp/src/parse/t_program.h
@@ -77,10 +77,10 @@
   {
    if(scope_)
    {
-     delete scope_; 
-     scope_ = NULL; 
+     delete scope_;
+     scope_ = NULL;
    }
-  } 
+  }
 
   // Path accessor
   const std::string& get_path() const { return path_; }
diff --git a/compiler/cpp/src/parse/t_scope.h b/compiler/cpp/src/parse/t_scope.h
index 4617bf8..e73c0f3 100644
--- a/compiler/cpp/src/parse/t_scope.h
+++ b/compiler/cpp/src/parse/t_scope.h
@@ -65,7 +65,6 @@
     } else {
       constants_[name] = constant;
     }
-		   
   }
 
   t_const* get_constant(std::string name) {
diff --git a/compiler/cpp/src/parse/t_struct.h b/compiler/cpp/src/parse/t_struct.h
index 621f42e..8dd4c73 100644
--- a/compiler/cpp/src/parse/t_struct.h
+++ b/compiler/cpp/src/parse/t_struct.h
@@ -81,7 +81,7 @@
         }
       }
     }
-    
+
   }
 
   void validate_union_members() {
@@ -90,7 +90,7 @@
       for (m_iter = members_in_id_order_.begin(); m_iter != members_in_id_order_.end(); ++m_iter) {
         validate_union_member( *m_iter);
       }
-      members_validated = true;          
+      members_validated = true;
     }
   }
 
@@ -117,7 +117,7 @@
     }
     // returns false when there is a conflict of field names
     if (get_field_by_name(elem->get_name()) != NULL) {
-      return false; 
+      return false;
     }
     members_.push_back(elem);
     members_in_id_order_.insert(bounds.second, elem);
@@ -140,7 +140,7 @@
   bool is_xception() const {
     return is_xception_;
   }
-  
+
   bool is_union() const {
     return is_union_;
   }
@@ -153,7 +153,7 @@
     for (m_iter = members_in_id_order_.begin(); m_iter != members_in_id_order_.end(); ++m_iter) {
       rv += (*m_iter)->get_fingerprint_material();
       rv += ";";
-      
+
       if( do_reserve) {
         estimation = members_in_id_order_.size() * rv.size() + 16;
         rv.reserve( estimation);
diff --git a/compiler/cpp/src/parse/t_typedef.h b/compiler/cpp/src/parse/t_typedef.h
index 52a7567..57d8df5 100644
--- a/compiler/cpp/src/parse/t_typedef.h
+++ b/compiler/cpp/src/parse/t_typedef.h
@@ -73,7 +73,7 @@
       std::string ret = get_type()->get_fingerprint_material();
       seen_ = false;
       return ret;
-    } 
+    }
     return "";
   }
 
diff --git a/compiler/cpp/src/thrifty.yy b/compiler/cpp/src/thrifty.yy
index 1f7dc64..61d4231 100644
--- a/compiler/cpp/src/thrifty.yy
+++ b/compiler/cpp/src/thrifty.yy
@@ -300,7 +300,7 @@
 | tok_namespace tok_identifier tok_identifier
     {
       pdebug("Header -> tok_namespace tok_identifier tok_identifier");
-      declare_valid_program_doctext();  
+      declare_valid_program_doctext();
       if (g_parse_mode == PROGRAM) {
         g_program->set_namespace($2, $3);
       }
@@ -308,7 +308,7 @@
 | tok_namespace '*' tok_identifier
     {
       pdebug("Header -> tok_namespace * tok_identifier");
-      declare_valid_program_doctext();  
+      declare_valid_program_doctext();
       if (g_parse_mode == PROGRAM) {
         g_program->set_namespace("*", $3);
       }
@@ -318,7 +318,7 @@
     {
       pwarning(1, "'cpp_namespace' is deprecated. Use 'namespace cpp' instead");
       pdebug("Header -> tok_cpp_namespace tok_identifier");
-      declare_valid_program_doctext();  
+      declare_valid_program_doctext();
       if (g_parse_mode == PROGRAM) {
         g_program->set_namespace("cpp", $2);
       }
@@ -326,7 +326,7 @@
 | tok_cpp_include tok_literal
     {
       pdebug("Header -> tok_cpp_include tok_literal");
-      declare_valid_program_doctext();  
+      declare_valid_program_doctext();
       if (g_parse_mode == PROGRAM) {
         g_program->add_cpp_include($2);
       }
@@ -335,7 +335,7 @@
     {
       pwarning(1, "'php_namespace' is deprecated. Use 'namespace php' instead");
       pdebug("Header -> tok_php_namespace tok_identifier");
-      declare_valid_program_doctext();  
+      declare_valid_program_doctext();
       if (g_parse_mode == PROGRAM) {
         g_program->set_namespace("php", $2);
       }
@@ -345,7 +345,7 @@
     {
       pwarning(1, "'py_module' is deprecated. Use 'namespace py' instead");
       pdebug("Header -> tok_py_module tok_identifier");
-      declare_valid_program_doctext();  
+      declare_valid_program_doctext();
       if (g_parse_mode == PROGRAM) {
         g_program->set_namespace("py", $2);
       }
@@ -355,7 +355,7 @@
     {
       pwarning(1, "'perl_package' is deprecated. Use 'namespace perl' instead");
       pdebug("Header -> tok_perl_namespace tok_identifier");
-      declare_valid_program_doctext();  
+      declare_valid_program_doctext();
       if (g_parse_mode == PROGRAM) {
         g_program->set_namespace("perl", $2);
       }
@@ -365,7 +365,7 @@
     {
       pwarning(1, "'ruby_namespace' is deprecated. Use 'namespace rb' instead");
       pdebug("Header -> tok_ruby_namespace tok_identifier");
-      declare_valid_program_doctext();  
+      declare_valid_program_doctext();
       if (g_parse_mode == PROGRAM) {
         g_program->set_namespace("rb", $2);
       }
@@ -375,7 +375,7 @@
     {
       pwarning(1, "'smalltalk_category' is deprecated. Use 'namespace smalltalk.category' instead");
       pdebug("Header -> tok_smalltalk_category tok_st_identifier");
-      declare_valid_program_doctext();  
+      declare_valid_program_doctext();
       if (g_parse_mode == PROGRAM) {
         g_program->set_namespace("smalltalk.category", $2);
       }
@@ -385,7 +385,7 @@
     {
       pwarning(1, "'smalltalk_prefix' is deprecated. Use 'namespace smalltalk.prefix' instead");
       pdebug("Header -> tok_smalltalk_prefix tok_identifier");
-      declare_valid_program_doctext();  
+      declare_valid_program_doctext();
       if (g_parse_mode == PROGRAM) {
         g_program->set_namespace("smalltalk.prefix", $2);
       }
@@ -395,7 +395,7 @@
     {
       pwarning(1, "'java_package' is deprecated. Use 'namespace java' instead");
       pdebug("Header -> tok_java_package tok_identifier");
-      declare_valid_program_doctext();  
+      declare_valid_program_doctext();
       if (g_parse_mode == PROGRAM) {
         g_program->set_namespace("java", $2);
       }
@@ -405,7 +405,7 @@
     {
       pwarning(1, "'cocoa_prefix' is deprecated. Use 'namespace cocoa' instead");
       pdebug("Header -> tok_cocoa_prefix tok_identifier");
-      declare_valid_program_doctext();  
+      declare_valid_program_doctext();
       if (g_parse_mode == PROGRAM) {
         g_program->set_namespace("cocoa", $2);
       }
@@ -415,7 +415,7 @@
     {
       pwarning(1, "'xsd_namespace' is deprecated. Use 'namespace xsd' instead");
       pdebug("Header -> tok_xsd_namespace tok_literal");
-      declare_valid_program_doctext();  
+      declare_valid_program_doctext();
       if (g_parse_mode == PROGRAM) {
         g_program->set_namespace("cocoa", $2);
       }
@@ -425,7 +425,7 @@
    {
      pwarning(1, "'csharp_namespace' is deprecated. Use 'namespace csharp' instead");
      pdebug("Header -> tok_csharp_namespace tok_identifier");
-     declare_valid_program_doctext();  
+     declare_valid_program_doctext();
      if (g_parse_mode == PROGRAM) {
        g_program->set_namespace("csharp", $2);
      }
@@ -435,7 +435,7 @@
    {
      pwarning(1, "'delphi_namespace' is deprecated. Use 'namespace delphi' instead");
      pdebug("Header -> tok_delphi_namespace tok_identifier");
-     declare_valid_program_doctext();  
+     declare_valid_program_doctext();
      if (g_parse_mode == PROGRAM) {
        g_program->set_namespace("delphi", $2);
      }
@@ -445,7 +445,7 @@
   tok_include tok_literal
     {
       pdebug("Include -> tok_include tok_literal");
-      declare_valid_program_doctext();  
+      declare_valid_program_doctext();
       if (g_parse_mode == INCLUDES) {
         std::string path = include_file(std::string($2));
         if (!path.empty()) {
