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

David Reiss commented on THRIFT-178:
------------------------------------

For the Java and C# ones, I'd prefer to see 
'''(tstruct->annotations_.find("csharp.final") != tstruct->annotations_.end() ? 
"sealed " : "")''' captured as a separate variable first, rather than in the 
middle of the print.

Also, it is not necessary for the annotations to be prefixed with languages.  I 
thought it would be a nice convention, but if certain annotations are 
universally (or nearly universally) applicable, we can drop it for those.

Personally, I think I prefer, cpp.nonvirtual, java.final, and csharp.sealed, 
but I don't feel very strongly about it.

Thoughts?

> Final Keyword
> -------------
>
>                 Key: THRIFT-178
>                 URL: https://issues.apache.org/jira/browse/THRIFT-178
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (C++), Compiler (General), Compiler (Java)
>            Reporter: Erik Frey
>            Priority: Minor
>         Attachments: final_annotation_cpp_java_csharp.patch, 
> final_csharp.patch, keyword_final_cpp_java.patch
>
>
> This introduces support for the final keyword in the thrift IDL.  A C++ 
> thrift struct that is declared final loses it's virtual dtor, which saves the 
> memory overhead of one vtable per instance.  This (along with the required 
> keyword) can be very helpful if you're passing around big lists of small 
> thrift structs.
> This patch also includes modifications for the java generator to recognize 
> and apply final.  I'm not familiar enough with the other languages to know if 
> this notion applies to them.
> (A patch for this was submitted in thrift's pre-apache days and was met with 
> approval, but then fell off the radar, so I'm trying again.)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to