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
diff --git a/compiler/cpp/src/generate/t_cpp_generator.cc b/compiler/cpp/src/generate/t_cpp_generator.cc
index 6fe3397..115dc89 100644
--- a/compiler/cpp/src/generate/t_cpp_generator.cc
+++ b/compiler/cpp/src/generate/t_cpp_generator.cc
@@ -290,8 +290,6 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
/**
* 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 @@
// 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;
diff --git a/compiler/cpp/src/generate/t_java_generator.cc b/compiler/cpp/src/generate/t_java_generator.cc
index 0e25e60..376db02 100644
--- a/compiler/cpp/src/generate/t_java_generator.cc
+++ b/compiler/cpp/src/generate/t_java_generator.cc
@@ -83,7 +83,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
}
}
-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 @@
}
/**
- * 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 @@
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 @@
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 @@
}
/**
- * 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 65cab4f..e2834f8 100644
--- a/lib/csharp/src/Protocol/TJSONProtocol.cs
+++ b/lib/csharp/src/Protocol/TJSONProtocol.cs
@@ -380,7 +380,7 @@
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>
diff --git a/lib/csharp/src/Server/TThreadedServer.cs b/lib/csharp/src/Server/TThreadedServer.cs
index 75206f1..f2be073 100644
--- a/lib/csharp/src/Server/TThreadedServer.cs
+++ b/lib/csharp/src/Server/TThreadedServer.cs
@@ -85,7 +85,7 @@
}
/// <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()
{
diff --git a/lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java b/lib/java/src/org/apache/thrift/protocol/TJSONProtocol.java
index d00980e..10af5c7 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 @@
// 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 {