-
Notifications
You must be signed in to change notification settings - Fork 15.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java: ErrorProne generates warnings for codegen #2718
Comments
Protobuf code base should now pass the default ErrorProne settings. Do you have a list of patterns that you'd like to also cover? I guess maven only reports Error patterns, and didn't output anything for Warning patterns. I'd have to manually enable them. |
Oh, sweet! We use |
It seems like SuppressWarnings doesn't work for those ErrorProne specific warnings -- I tested @SuppressWarnings("FunctionalInterfaceClash"). Could you blacklist those patterns in grpc instead? |
Huh. That's strange. Did you apply it to the class or the method? I think that one is necessary to suppress at the class level. I just tested and SuppressWarnings worked for me and it is documented. We are using |
Could you annotate the generated protobuf with the |
The idea of adding generated annotations is covered in this issue: #42 |
protoc 3.2.0 generates code that fails ErrorProne's MissingOverride, ReferenceEquality, and FunctionalInterfaceClash checks. It's not obvious that the protobuf project has any legitimate problems to fix based on those warnings, but their presence makes it hard to use ErrorProne to check non-generated code.
Maybe the best option is just to add
@SuppressWarnings
for each of those warnings at the top of the generated class.The text was updated successfully, but these errors were encountered: