Thrift-1251: Generated java code should indicate which fields are required and which are optional
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
diff --git a/compiler/cpp/src/generate/t_java_generator.cc b/compiler/cpp/src/generate/t_java_generator.cc
index 7b995f3..2b54259 100644
--- a/compiler/cpp/src/generate/t_java_generator.cc
+++ b/compiler/cpp/src/generate/t_java_generator.cc
@@ -3266,7 +3266,7 @@
     }
   }
   result += "; // ";
-  if (tfield->get_xsd_optional()) {
+  if (tfield->get_req() == t_field::T_OPTIONAL) {
     result += "optional";
   } else {
     result += "required";