thrift-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dre...@apache.org
Subject svn commit: r762956 - /incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc
Date Tue, 07 Apr 2009 20:51:38 GMT
Author: dreiss
Date: Tue Apr  7 20:51:37 2009
New Revision: 762956

URL: http://svn.apache.org/viewvc?rev=762956&view=rev
Log:
THRIFT-427. java: Fix print_const_value

Simplify it a bit in the process, because the beans-style setters
are produced even in non-beans mode, and they handle isset internally.

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

Modified: incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc?rev=762956&r1=762955&r2=762956&view=diff
==============================================================================
--- incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc (original)
+++ incubator/thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc Tue Apr  7 20:51:37
2009
@@ -462,14 +462,8 @@
       }
       string val = render_const_value(out, name, field_type, v_iter->second);
       indent(out) << name << ".";
-      if (bean_style_) {
-        std::string cap_name = get_cap_name(v_iter->first->get_string());
-        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;
+      std::string cap_name = get_cap_name(v_iter->first->get_string());
+      out << "set" << cap_name << "(" << val << ");" <<
endl;
     }
     if (!in_static) {
       indent_down();



Mime
View raw message