[
https://issues.apache.org/jira/browse/THRIFT-4074?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18112785#comment-18112785
]
Sylwester Lachiewicz edited comment on THRIFT-4074 at 9/8/26 1:45 PM:
----------------------------------------------------------------------
Still emitted:
[t_java_generator.cc:512|https://github.com/apache/thrift/blob/master/compiler/cpp/src/thrift/generate/t_java_generator.cc#L512]
returns {{@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked",
"unused"})}}, applied at six call sites. Neither step this ticket asks for has
been taken — the unnecessary generated members are still generated, and the
suppression that remains necessary still sits on the class rather than on the
declaration that needs it. Reopening.
was (Author: slachiewicz):
Still emitted:
[t_java_generator.cc:512|https://github.com/apache/thrift/blob/master/compiler/cpp/src/thrift/generate/t_java_generator.cc#L512]
returns {{@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked",
"unused"})}}, applied at six call sites. Neither step this ticket asks for has
been taken — the unnecessary generated members are still generated, and the
suppression that remains necessary still sits on the class rather than on the
declaration that needs it. Reopening.
> Unnecessary suppress warnings (unused)
> --------------------------------------
>
> Key: THRIFT-4074
> URL: https://issues.apache.org/jira/browse/THRIFT-4074
> Project: Thrift
> Issue Type: Bug
> Components: Java - Compiler
> Affects Versions: 0.10.0
> Reporter: Christopher Tubbs
> Priority: Major
>
> Some generated Java files do not have unused variables. This results an a
> warning in some compilers (Eclipse, for one), that the warnings suppression
> for unused elements itself is unnecessary.
> Some unused variables appear to simply be unnecessary code generation. These
> should be removed.
> Others may affect serialization if changed, and are intentionally unused for
> backwards compatibility because they are class fields.
> If this is the case, the warnings suppression about them being unused should
> appear on the unused item itself when it is declared, rather than on the
> class as a whole.
> If these two steps are done, then there is no need to continue to suppress
> the unused types for all files, globally at the top of the file.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)