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

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

Github user aaudiber commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/649#discussion_r41702916
  
    --- Diff: compiler/cpp/src/generate/t_java_generator.cc ---
    @@ -441,7 +441,7 @@ string t_java_generator::java_type_imports() {
     }
     
     string t_java_generator::java_suppressions() {
    -  return "@SuppressWarnings({\"cast\", \"rawtypes\", \"serial\", 
\"unchecked\"})\n";
    +  return "@SuppressWarnings(\"all\")\n";
    --- End diff --
    
    It makes sense for people writing the code generator to see the warnings 
for the code, but for external users who have no control over the generator 
anyway, the autogen code warnings hide actually useful warnings.
    
    Other options could be changing the code generator to avoid doing things 
which generate warnings or adding more types of warnings to this list until it 
only covers expected warnings. The first is really high-difficulty and 
low-reward, and the second is harder to maintain.
    
    It's hard to imagine users being helped by the warnings in their 
autogenerated code, so we should just suppress them.


> generated Java code full of warnings
> ------------------------------------
>
>                 Key: THRIFT-2794
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2794
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Compiler
>    Affects Versions: 0.9.1, 1.0
>         Environment: Ubuntu 14.04
>            Reporter: Kevin
>            Priority: Minor
>
> The java code generated by thrift is full of warnings about unused imports 
> and fields. With a lot of thrift generated classes, we're getting warnings we 
> care about drowned out in the noise of generated code warnings (approx. 600).
> This small example generates about a half dozen unused imports:
> struct Publisher
> {
>       1: optional string id,
>       2: optional string name,
>       3: optional list<string> cat,
>       4: optional string domain
> }
> thrift --gen java -out . publisher.thrift 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to