commit | b342ddf00b9abc318c1075a8942928f1ef324f7f | [log] [tgz] |
---|---|---|
author | Bryan Duxbury <bryanduxbury@apache.org> | Tue Aug 02 23:10:32 2011 +0000 |
committer | Bryan Duxbury <bryanduxbury@apache.org> | Tue Aug 02 23:10:32 2011 +0000 |
tree | d02aff432758dec289343fc75e29df5b23698c73 | |
parent | 4e0192f660bfd83921842a9e59d04c681100156a [diff] |
THRIFT-1251. java: Generated java code should indicate which fields are required and which are optional Patch: Takashi Yonebayashi git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1153302 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/generate/t_java_generator.cc b/compiler/cpp/src/generate/t_java_generator.cc index 1b55172..f9ed5e2 100644 --- a/compiler/cpp/src/generate/t_java_generator.cc +++ b/compiler/cpp/src/generate/t_java_generator.cc
@@ -3329,7 +3329,13 @@ result += " = new " + type_name(ttype, false, true) + "()";; } } - return result + ";"; + result += "; // "; + if (tfield->get_xsd_optional()) { + result += "optional"; + } else { + result += "required"; + } + return result; } /**