You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ro...@apache.org on 2010/12/16 14:15:49 UTC

svn commit: r1049968 - in /thrift/trunk: compiler/cpp/src/generate/ lib/csharp/src/Protocol/ lib/csharp/src/Server/ lib/java/src/org/apache/thrift/protocol/

Author: roger
Date: Thu Dec 16 13:15:49 2010
New Revision: 1049968

URL: http://svn.apache.org/viewvc?rev=1049968&view=rev
Log:
THRIFT-1022 Typo cleanup patch

Patch: Anatol Pomozov

Modified:
    thrift/trunk/compiler/cpp/src/generate/t_cpp_generator.cc
    thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc
    thrift/trunk/lib/csharp/src/Protocol/TJSONProtocol.cs
    thrift/trunk/lib/csharp/src/Server/TThreadedServer.cs
    thrift/trunk/lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java

Modified: thrift/trunk/compiler/cpp/src/generate/t_cpp_generator.cc
URL: http://svn.apache.org/viewvc/thrift/trunk/compiler/cpp/src/generate/t_cpp_generator.cc?rev=1049968&r1=1049967&r2=1049968&view=diff
==============================================================================
--- thrift/trunk/compiler/cpp/src/generate/t_cpp_generator.cc (original)
+++ thrift/trunk/compiler/cpp/src/generate/t_cpp_generator.cc Thu Dec 16 13:15:49 2010
@@ -290,8 +290,6 @@ class t_cpp_generator : public t_oop_gen
 /**
  * Prepares for file generation by opening up the necessary file output
  * streams.
- *
- * @param tprogram The program to generate
  */
 void t_cpp_generator::init_generator() {
   // Make output directory
@@ -3703,7 +3701,7 @@ void t_cpp_generator::generate_serialize
 /**
  * Makes a :: prefix for a namespace
  *
- * @param ns The namepsace, w/ periods in it
+ * @param ns The namespace, w/ periods in it
  * @return Namespaces
  */
 string t_cpp_generator::namespace_prefix(string ns) {
@@ -3726,7 +3724,7 @@ string t_cpp_generator::namespace_prefix
 /**
  * Opens namespace.
  *
- * @param ns The namepsace, w/ periods in it
+ * @param ns The namespace, w/ periods in it
  * @return Namespaces
  */
 string t_cpp_generator::namespace_open(string ns) {
@@ -3753,7 +3751,7 @@ string t_cpp_generator::namespace_open(s
 /**
  * Closes namespace.
  *
- * @param ns The namepsace, w/ periods in it
+ * @param ns The namespace, w/ periods in it
  * @return Namespaces
  */
 string t_cpp_generator::namespace_close(string ns) {
@@ -4066,7 +4064,7 @@ string t_cpp_generator::local_reflection
 
   // We have to use the program name as part of the identifier because
   // if two thrift "programs" are compiled into one actual program
-  // you would get a symbol collison if they both defined list<i32>.
+  // you would get a symbol collision if they both defined list<i32>.
   // trlo = Thrift Reflection LOcal.
   string prog;
   string name;

Modified: thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc
URL: http://svn.apache.org/viewvc/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc?rev=1049968&r1=1049967&r2=1049968&view=diff
==============================================================================
--- thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc (original)
+++ thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc Thu Dec 16 13:15:49 2010
@@ -83,7 +83,7 @@ class t_java_generator : public t_oop_ge
   void generate_service (t_service*  tservice);
 
   void print_const_value(std::ofstream& out, std::string name, t_type* type, t_const_value* value, bool in_static, bool defval=false);
-  std::string render_const_value(std::ofstream& out, std::string name, t_type* type, t_const_value* value);
+  std::string render_const_value(std::ofstream& out, t_type* type, t_const_value* value);
 
   /**
    * Service-level generation functions
@@ -489,10 +489,10 @@ void t_java_generator::print_const_value
       type_name(type) << " ";
   }
   if (type->is_base_type()) {
-    string v2 = render_const_value(out, name, type, value);
+    string v2 = render_const_value(out, type, value);
     out << name << " = " << v2 << ";" << endl << endl;
   } else if (type->is_enum()) {
-    out << name << " = " << render_const_value(out, name, type, value) << ";" << endl << endl;
+    out << name << " = " << render_const_value(out, type, value) << ";" << endl << endl;
   } else if (type->is_struct() || type->is_xception()) {
     const vector<t_field*>& fields = ((t_struct*)type)->get_members();
     vector<t_field*>::const_iterator f_iter;
@@ -513,7 +513,7 @@ void t_java_generator::print_const_value
       if (field_type == NULL) {
         throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
       }
-      string val = render_const_value(out, name, field_type, v_iter->second);
+      string val = render_const_value(out, field_type, v_iter->second);
       indent(out) << name << ".";
       std::string cap_name = get_cap_name(v_iter->first->get_string());
       out << "set" << cap_name << "(" << val << ");" << endl;
@@ -534,8 +534,8 @@ void t_java_generator::print_const_value
     const map<t_const_value*, t_const_value*>& val = value->get_map();
     map<t_const_value*, t_const_value*>::const_iterator v_iter;
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string key = render_const_value(out, name, ktype, v_iter->first);
-      string val = render_const_value(out, name, vtype, v_iter->second);
+      string key = render_const_value(out, ktype, v_iter->first);
+      string val = render_const_value(out, vtype, v_iter->second);
       indent(out) << name << ".put(" << key << ", " << val << ");" << endl;
     }
     if (!in_static) {
@@ -558,7 +558,7 @@ void t_java_generator::print_const_value
     const vector<t_const_value*>& val = value->get_list();
     vector<t_const_value*>::const_iterator v_iter;
     for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string val = render_const_value(out, name, etype, *v_iter);
+      string val = render_const_value(out, etype, *v_iter);
       indent(out) << name << ".add(" << val << ");" << endl;
     }
     if (!in_static) {
@@ -571,8 +571,7 @@ void t_java_generator::print_const_value
   }
 }
 
-string t_java_generator::render_const_value(ofstream& out, string name, t_type* type, t_const_value* value) {
-  (void) name;
+string t_java_generator::render_const_value(ofstream& out, t_type* type, t_const_value* value) {
   type = get_true_type(type);
   std::ostringstream render;
 
@@ -3337,7 +3336,7 @@ string t_java_generator::type_name(t_typ
 }
 
 /**
- * Returns the C++ type that corresponds to the thrift type.
+ * Returns the Java type that corresponds to the thrift type.
  *
  * @param tbase The base type
  * @param container Is it going in a Java container?
@@ -3368,14 +3367,15 @@ string t_java_generator::base_type_name(
   case t_base_type::TYPE_DOUBLE:
     return (in_container ? "Double" : "double");
   default:
-    throw "compiler error: no C++ name for base type " + t_base_type::t_base_name(tbase);
+    throw "compiler error: no Java name for base type " + t_base_type::t_base_name(tbase);
   }
 }
 
 /**
  * Declares a field, which may include initialization as necessary.
  *
- * @param ttype The type
+ * @param tfield The field
+ * @param init Whether to initialize the field
  */
 string t_java_generator::declare_field(t_field* tfield, bool init) {
   // TODO(mcslee): do we ever need to initialize the field?
@@ -3384,7 +3384,7 @@ string t_java_generator::declare_field(t
     t_type* ttype = get_true_type(tfield->get_type());
     if (ttype->is_base_type() && tfield->get_value() != NULL) {
       ofstream dummy;
-      result += " = " + render_const_value(dummy, tfield->get_name(), ttype, tfield->get_value());
+      result += " = " + render_const_value(dummy, ttype, tfield->get_value());
     } else if (ttype->is_base_type()) {
       t_base_type::t_base tbase = ((t_base_type*)ttype)->get_base();
       switch (tbase) {
@@ -3529,7 +3529,7 @@ string t_java_generator::async_argument_
 }
 
 /**
- * Converts the parse type to a C++ enum string for the given type.
+ * Converts the parse type to a Java enum string for the given type.
  */
 string t_java_generator::type_to_enum(t_type* type) {
   type = get_true_type(type);

Modified: thrift/trunk/lib/csharp/src/Protocol/TJSONProtocol.cs
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/csharp/src/Protocol/TJSONProtocol.cs?rev=1049968&r1=1049967&r2=1049968&view=diff
==============================================================================
--- thrift/trunk/lib/csharp/src/Protocol/TJSONProtocol.cs (original)
+++ thrift/trunk/lib/csharp/src/Protocol/TJSONProtocol.cs Thu Dec 16 13:15:49 2010
@@ -380,7 +380,7 @@ namespace Thrift.Protocol
 		private byte[] tempBuffer = new byte[4];
 
 		///<summary>
-		/// Read a byte that must match b[0]; otherwise an excpetion is thrown.
+		/// Read a byte that must match b[0]; otherwise an exception is thrown.
 		/// Marked protected to avoid synthetic accessor in JSONListContext.Read
 		/// and JSONPairContext.Read
 		///</summary>

Modified: thrift/trunk/lib/csharp/src/Server/TThreadedServer.cs
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/csharp/src/Server/TThreadedServer.cs?rev=1049968&r1=1049967&r2=1049968&view=diff
==============================================================================
--- thrift/trunk/lib/csharp/src/Server/TThreadedServer.cs (original)
+++ thrift/trunk/lib/csharp/src/Server/TThreadedServer.cs Thu Dec 16 13:15:49 2010
@@ -85,7 +85,7 @@ namespace Thrift.Server
 		}
 
 		/// <summary>
-		/// Use new Thread for each new client connection. block until numConnections < maxTHreads
+		/// Use new Thread for each new client connection. block until numConnections < maxThreads
 		/// </summary>
 		public override void Serve()
 		{

Modified: thrift/trunk/lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java?rev=1049968&r1=1049967&r2=1049968&view=diff
==============================================================================
--- thrift/trunk/lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java (original)
+++ thrift/trunk/lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java Thu Dec 16 13:15:49 2010
@@ -313,7 +313,7 @@ public class TJSONProtocol extends TProt
   // Temporary buffer used by several methods
   private byte[] tmpbuf_ = new byte[4];
 
-  // Read a byte that must match b[0]; otherwise an excpetion is thrown.
+  // Read a byte that must match b[0]; otherwise an exception is thrown.
   // Marked protected to avoid synthetic accessor in JSONListContext.read
   // and JSONPairContext.read
   protected void readJSONSyntaxChar(byte[] b) throws TException {