You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by aaudiber <gi...@git.apache.org> on 2015/10/10 21:31:17 UTC
[GitHub] thrift pull request: THRIFT-2794 Suppress warnings in autogenerate...
GitHub user aaudiber opened a pull request:
https://github.com/apache/thrift/pull/649
THRIFT-2794 Suppress warnings in autogenerated Java files
Client: Java
Most importantly, this will ignore "unused" warnings.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/aaudiber/thrift THRIFT-2794
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/649.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #649
----
commit 48420e431f3cd8f001464c9ff837b929c67207e2
Author: Andrew Audibert <aa...@gmail.com>
Date: 2015-10-10T19:21:26Z
THRIFT-2794 Suppress warnings in autogenerated Java files
Client: Java
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] thrift pull request: THRIFT-2794 Suppress warnings in autogenerate...
Posted by bufferoverflow <gi...@git.apache.org>.
Github user bufferoverflow commented on a diff in the pull request:
https://github.com/apache/thrift/pull/649#discussion_r41702403
--- 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 --
Is there no other option to fix this?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] thrift pull request: THRIFT-2794 Suppress warnings in autogenerate...
Posted by aaudiber <gi...@git.apache.org>.
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.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] thrift pull request: THRIFT-2794 Suppress warnings in autogenerate...
Posted by aaudiber <gi...@git.apache.org>.
Github user aaudiber commented on a diff in the pull request:
https://github.com/apache/thrift/pull/649#discussion_r41718991
--- 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 --
Ok, I've changed the commit to just add "unused" warnings to the suppressions list.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] thrift pull request: THRIFT-2794 Suppress warnings in autogenerate...
Posted by bufferoverflow <gi...@git.apache.org>.
Github user bufferoverflow commented on a diff in the pull request:
https://github.com/apache/thrift/pull/649#discussion_r41715826
--- 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 --
We fixed the code generator for cpp to generate code without warnings.
Suppress some specific warnings instead of all is preferred as well.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] thrift pull request: THRIFT-2794 Suppress warnings in autogenerate...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/thrift/pull/649
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---