Thrift-1251: Generated java code should indicate which fields are required and which...
authorJake Farrell <jfarrell@apache.org>
Sun, 6 Nov 2011 15:02:30 +0000 (15:02 +0000)
committerJake Farrell <jfarrell@apache.org>
Sun, 6 Nov 2011 15:02:30 +0000 (15:02 +0000)
Client: java
Patch: Jake Farrell

Fixes optional/required comments on fields.

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1198386 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/generate/t_java_generator.cc

index 7b995f3..2b54259 100644 (file)
@@ -3266,7 +3266,7 @@ string t_java_generator::declare_field(t_field* tfield, bool init) {
     }
   }
   result += "; // ";
-  if (tfield->get_xsd_optional()) {
+  if (tfield->get_req() == t_field::T_OPTIONAL) {
     result += "optional";
   } else {
     result += "required";