The Ruby exception constructor is modified to accept 0 arguments, which is
how Thrift library code creates exception objects. Without this fix, Thrift
Ruby clients that receive exception objects crash.
The call to super (resolving to ThriftStruct#initialize) is retained, but
is called with the default value (an empty hash) instead of passing the
message along.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665501
13f79535-47bb-0310-9956-
ffa450edef68
vector<t_field*>::const_iterator m_iter = members.begin();
if ((*m_iter)->get_type()->is_string()) {
- indent(out) << "def initialize(message)" << endl;
+ indent(out) << "def initialize(message=nil)" << endl;
indent_up();
- indent(out) << "super(message)" << endl;
+ indent(out) << "super()" << endl;
indent(out) << "self." << (*m_iter)->get_name() << " = message" << endl;
indent_down();
indent(out) << "end" << endl << endl;