[ 
https://issues.apache.org/jira/browse/THRIFT-4660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16676253#comment-16676253
 ] 

ASF GitHub Bot commented on THRIFT-4660:
----------------------------------------

dcelasun closed pull request #1621: THRIFT-4660: Include 
@javax.annotation.Generated and Nullable as needed for enums
URL: https://github.com/apache/thrift/pull/1621
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/compiler/cpp/src/thrift/generate/t_java_generator.cc 
b/compiler/cpp/src/thrift/generate/t_java_generator.cc
index 4780dc76cd..2c845512cc 100644
--- a/compiler/cpp/src/thrift/generate/t_java_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_java_generator.cc
@@ -498,6 +498,11 @@ void t_java_generator::generate_enum(t_enum* tenum) {
   f_enum << autogen_comment() << java_package() << endl;
 
   generate_java_doc(f_enum, tenum);
+
+  if (!suppress_generated_annotations_) {
+    generate_javax_generated_annotation(f_enum);
+  }
+
   if (is_deprecated) {
     indent(f_enum) << "@Deprecated" << endl;
   }
@@ -544,6 +549,7 @@ void t_java_generator::generate_enum(t_enum* tenum) {
                  << endl;
   indent(f_enum) << " * @return null if the value is not found." << endl;
   indent(f_enum) << " */" << endl;
+  indent(f_enum) << java_nullable_annotation() << endl;
   indent(f_enum) << "public static " + tenum->get_name() + " findByValue(int 
value) { " << endl;
 
   indent_up();


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Include @javax.annotation.Generated and Nullable as needed for enums
> --------------------------------------------------------------------
>
>                 Key: THRIFT-4660
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4660
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Java - Compiler
>            Reporter: Lazaro Clapp
>            Priority: Minor
>             Fix For: 0.12.0
>
>
> This is a follow up to THRIFT-4530 and THRIFT-4614. In that patch, we 
> neglected to add Nullable and Generated annotations to enums, in addition to 
> classes. Will open PR with small change immediately after creating this task.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to