Can I ignore Java compiler warnings in generated code?

Viewed 123

I'm using Data Binding on Android, which automatically generates code classes in order to bind views to data. Unfortunately, the compiler flags a warning inside the generated code:

/app/build/generated/source/kapt/debug/com/test/databinding/TestFragmentBindingImpl.java:56: warning: [cast] redundant cast to boolean
                vm.setEnabled(((boolean) (callbackArg_0)));
                                        ^
error: warnings found and -Werror specified
1 error

I'm required to have 0 warnings in my project, so I'm using -Werror. I can't just add @SuppressWarnings to the generated class, and I don't want to -Xlint:-cast for the entire project.

How can I ignore warnings in generated classes?

0 Answers
Related