mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 10:48:51 +00:00
Fix a bug with initialization in JavaBean-style generated code.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@666371 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5245f40b3e
commit
87e9ac6382
@ -384,7 +384,15 @@ void t_java_generator::print_const_value(std::ofstream& out, string name, t_type
|
||||
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);
|
||||
indent(out) << name << "." << v_iter->first->get_string() << " = " << val << ";" << endl;
|
||||
indent(out) << name << ".";
|
||||
if (bean_style_) {
|
||||
std::string cap_name = v_iter->first->get_string();
|
||||
cap_name[0] = toupper(cap_name[0]);
|
||||
out << "set" << cap_name << "(" << val << ")";
|
||||
} else {
|
||||
out << v_iter->first->get_string() << " = " << val;
|
||||
}
|
||||
out << ";" << endl;
|
||||
indent(out) << name << ".__isset." << v_iter->first->get_string() << " = true;" << endl;
|
||||
}
|
||||
if (!in_static) {
|
||||
|
Loading…
Reference in New Issue
Block a user