From e0cac988b6caa0a3a624951418ecae32c6ba9a5c Mon Sep 17 00:00:00 2001 From: Roger Meier Date: Thu, 16 Dec 2010 13:15:49 +0000 Subject: [PATCH] THRIFT-1022 Typo cleanup patch Patch: Anatol Pomozov git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1049968 13f79535-47bb-0310-9956-ffa450edef68 --- compiler/cpp/src/generate/t_cpp_generator.cc | 10 +++---- compiler/cpp/src/generate/t_java_generator.cc | 28 +++++++++---------- lib/csharp/src/Protocol/TJSONProtocol.cs | 2 +- lib/csharp/src/Server/TThreadedServer.cs | 2 +- .../apache/thrift/protocol/TJSONProtocol.java | 2 +- 5 files changed, 21 insertions(+), 23 deletions(-) diff --git a/compiler/cpp/src/generate/t_cpp_generator.cc b/compiler/cpp/src/generate/t_cpp_generator.cc index 6fe33979..115dc891 100644 --- a/compiler/cpp/src/generate/t_cpp_generator.cc +++ b/compiler/cpp/src/generate/t_cpp_generator.cc @@ -290,8 +290,6 @@ class t_cpp_generator : public t_oop_generator { /** * 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_list_element(ofstream& out, /** * 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(string ns) { /** * 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(string ns) { /** * 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_name(const char* prefix, t_type* ttype, // 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. + // you would get a symbol collision if they both defined list. // trlo = Thrift Reflection LOcal. string prog; string name; diff --git a/compiler/cpp/src/generate/t_java_generator.cc b/compiler/cpp/src/generate/t_java_generator.cc index 0e25e60b..376db026 100644 --- a/compiler/cpp/src/generate/t_java_generator.cc +++ b/compiler/cpp/src/generate/t_java_generator.cc @@ -83,7 +83,7 @@ class t_java_generator : public t_oop_generator { 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(std::ofstream& out, string name, t_type 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& fields = ((t_struct*)type)->get_members(); vector::const_iterator f_iter; @@ -513,7 +513,7 @@ void t_java_generator::print_const_value(std::ofstream& out, string name, t_type 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(std::ofstream& out, string name, t_type const map& val = value->get_map(); map::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(std::ofstream& out, string name, t_type const vector& val = value->get_list(); vector::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(std::ofstream& out, string name, t_type } } -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_type* ttype, bool in_container, bool in_ini } /** - * 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(t_base_type* type, 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_field* tfield, bool init) { 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_list(t_function* tfunct, t_struct* tstru } /** - * 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); diff --git a/lib/csharp/src/Protocol/TJSONProtocol.cs b/lib/csharp/src/Protocol/TJSONProtocol.cs index 65cab4f5..e2834f8c 100644 --- a/lib/csharp/src/Protocol/TJSONProtocol.cs +++ b/lib/csharp/src/Protocol/TJSONProtocol.cs @@ -380,7 +380,7 @@ namespace Thrift.Protocol private byte[] tempBuffer = 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 /// diff --git a/lib/csharp/src/Server/TThreadedServer.cs b/lib/csharp/src/Server/TThreadedServer.cs index 75206f15..f2be073b 100644 --- a/lib/csharp/src/Server/TThreadedServer.cs +++ b/lib/csharp/src/Server/TThreadedServer.cs @@ -85,7 +85,7 @@ namespace Thrift.Server } /// - /// Use new Thread for each new client connection. block until numConnections < maxTHreads + /// Use new Thread for each new client connection. block until numConnections < maxThreads /// public override void Serve() { diff --git a/lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java b/lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java index d00980e9..10af5c7b 100644 --- a/lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java +++ b/lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java @@ -313,7 +313,7 @@ public class TJSONProtocol extends TProtocol { // 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 { -- 2.17.1