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

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

dcelasun closed pull request #1577: THRIFT-4614: Generate missing @Nullable 
annotations for Java iterator getters
URL: https://github.com/apache/thrift/pull/1577
 
 
   

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 2db3c3f4c0..67b41770a5 100644
--- a/compiler/cpp/src/thrift/generate/t_java_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_java_generator.cc
@@ -2359,6 +2359,7 @@ void 
t_java_generator::generate_java_bean_boilerplate(ostream& out, t_struct* ts
         if (is_deprecated) {
           indent(out) << "@Deprecated" << endl;
         }
+        indent(out) << java_nullable_annotation() << endl;
         indent(out) << "public java.util.Iterator<" << type_name(element_type, 
true, false)
                     << "> get" << cap_name;
         out << get_cap_name("iterator() {") << endl;


 

----------------------------------------------------------------
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:
[email protected]


> Generate missing @Nullable annotations for Java iterator getters
> ----------------------------------------------------------------
>
>                 Key: THRIFT-4614
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4614
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Java - Compiler
>            Reporter: Manu Sridharan
>            Priority: Major
>
> This is a brief follow-up to THRIFT-4530.  In that change, we neglected to 
> generate `@Nullable` annotations for iterator getters for sets and lists.  
> They can clearly return null; see 
> [here|[https://github.com/apache/thrift/blob/0a2d4587c8cc0a54e4fa8fee9247d088d05b0d65/compiler/cpp/src/thrift/generate/t_java_generator.cc#L2367].]
>   The code change is a one-liner.  Will open a GitHub PR with the change. 



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

Reply via email to