You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by br...@apache.org on 2009/05/05 20:50:26 UTC

svn commit: r771964 - /incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc

Author: bryanduxbury
Date: Tue May  5 18:50:26 2009
New Revision: 771964

URL: http://svn.apache.org/viewvc?rev=771964&view=rev
Log:
THRIFT-485. rb:  Generated validate methods that reference external thrift files' types are not referenced correctly

This patch fully qualifies type names in two spots.


Modified:
    incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc?rev=771964&r1=771963&r2=771964&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_rb_generator.cc Tue May  5 18:50:26 2009
@@ -364,7 +364,7 @@
   } else if (type->is_enum()) {
     indent(out) << value->get_integer();
   } else if (type->is_struct() || type->is_xception()) {
-    out << type->get_name() << ".new({" << endl;
+    out << full_type_name(type) << ".new({" << endl;
     indent_up();
     const vector<t_field*>& fields = ((t_struct*)type)->get_members();
     vector<t_field*>::const_iterator f_iter;
@@ -1081,7 +1081,7 @@
     t_field* field = (*f_iter);
         
     if (field->get_type()->is_enum()){      
-      indent(out) << "unless @" << field->get_name() << ".nil? || " << field->get_type()->get_name() << "::VALID_VALUES.include?(@" << field->get_name() << ")" << endl;      
+      indent(out) << "unless @" << field->get_name() << ".nil? || " << full_type_name(field->get_type()) << "::VALID_VALUES.include?(@" << field->get_name() << ")" << endl;
       indent_up();
       indent(out) << "raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field " << field->get_name() << "!')" << endl;  
       indent_down();