mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 02:45:22 +00:00
Thrift: Ruby cogeden not creating exception fields properly.
Summary: Generated ruby code did not give exception struct fields a class. This broke the result structs for all functions that threw exceptions. Reviewed by: mcslee Test plan: Yes Revert plan: yes git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665173 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e168d5e127
commit
5ced286cec
@ -334,26 +334,26 @@ void t_rb_generator::generate_field_data(std::ofstream& out, t_type* field_type,
|
||||
|
||||
if (!field_name.empty())
|
||||
out << ", :name => '" << field_name << "'";
|
||||
|
||||
if (! field_type->is_base_type()) {
|
||||
if (field_type->is_struct() || field_type->is_xception()) {
|
||||
out << ", :class => " << type_name(((t_struct*)field_type));
|
||||
} else if (field_type->is_list()) {
|
||||
out << ", :element => ";
|
||||
generate_field_data(out, ((t_list*)field_type)->get_elem_type());
|
||||
} else if (field_type->is_map()) {
|
||||
out << ", :key => ";
|
||||
generate_field_data(out, ((t_map*)field_type)->get_key_type());
|
||||
out << ", :value => ";
|
||||
generate_field_data(out, ((t_map*)field_type)->get_val_type());
|
||||
} else if (field_type->is_set()) {
|
||||
out << ", :element => ";
|
||||
generate_field_data(out, ((t_set*)field_type)->get_elem_type());
|
||||
}
|
||||
}
|
||||
|
||||
if (! field_type->is_base_type()) {
|
||||
if (field_type->is_struct()) {
|
||||
out << ", :class => " << type_name(((t_struct*)field_type));
|
||||
} else if (field_type->is_list()) {
|
||||
out << ", :element => ";
|
||||
generate_field_data(out, ((t_list*)field_type)->get_elem_type());
|
||||
} else if (field_type->is_map()) {
|
||||
out << ", :key => ";
|
||||
generate_field_data(out, ((t_map*)field_type)->get_key_type());
|
||||
out << ", :value => ";
|
||||
generate_field_data(out, ((t_map*)field_type)->get_val_type());
|
||||
} else if (field_type->is_set()) {
|
||||
out << ", :element => ";
|
||||
generate_field_data(out, ((t_set*)field_type)->get_elem_type());
|
||||
}
|
||||
}
|
||||
|
||||
// End of this field's defn
|
||||
out << "}";
|
||||
// End of this field's defn
|
||||
out << "}";
|
||||
}
|
||||
|
||||
void t_rb_generator::begin_namespace(std::ofstream& out, vector<std::string> modules) {
|
||||
|
Loading…
Reference in New Issue
Block a user