-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Remove disable Xlint warning from gradle files. #40366
Comments
The generics in AbstractStringProcessor is not needed (IngestDocument#setFieldValue(...) accepts Object) and therefor it was removed. Otherwise the corresponding factory implementations would need typing too. Relates to elastic#40366
Fix the generics in processors extending AbstractStringProcessor and its factory. Relates to elastic#40366
Fix the generics in processors extending AbstractStringProcessor and its factory. Relates to #40366
The xlint exclusions of the following plugins were removed: * ingest-attachment. * mapper-size. * transport-nio. Removing the -try exclusion required some work, because the NettyAdaptor implements AutoCloseable and NettyAdaptor#close() method could throw an InterruptedException (ChannelFuture#await() and a generic Exception is re-thrown, which maybe an ChannelFuture). The easiest way around this to me seemed that NettyAdaptor should not implement AutoCloseable, because it is not directly used in a try-with-resources statement. Relates to elastic#40366
There are many snippets in the code base that look like this:
If I personally think that this coding style is not bad and that we should allow this. So should we add Alternatively we can rewrite these try-with-resources statements to try-finally statements where the resource gets closed explicitly. |
I think that using |
I agree that |
The xlint exclusions of the following plugins were removed: * ingest-attachment. * mapper-size. * transport-nio. Removing the -try exclusion required some work, because the NettyAdaptor implements AutoCloseable and NettyAdaptor#close() method could throw an InterruptedException (ChannelFuture#await() and a generic Exception is re-thrown, which maybe an ChannelFuture). The easiest way around this to me seemed that NettyAdaptor should not implement AutoCloseable, because it is not directly used in a try-with-resources statement. Relates to #40366
The xlint exclusions of the following plugins were removed: * ingest-attachment. * mapper-size. * transport-nio. Removing the -try exclusion required some work, because the NettyAdaptor implements AutoCloseable and NettyAdaptor#close() method could throw an InterruptedException (ChannelFuture#await() and a generic Exception is re-thrown, which maybe an ChannelFuture). The easiest way around this to me seemed that NettyAdaptor should not implement AutoCloseable, because it is not directly used in a try-with-resources statement. Relates to #40366
Many gradle projects specifically use the -try exclude flag, because there are many cases where auto-closeable resource ignore is never referenced in body of corresponding try statement. Suppressing this warning specifically in each case that it happens using `@SuppressWarnings("try")` would be very verbose. This change removes `-try` from any gradle project and adds it to the build plugin. Also this change removes exclude flags from gradle projects that is already specified in build plugin (for example -deprecation). Relates to elastic#40366
Many gradle projects specifically use the -try exclude flag, because there are many cases where auto-closeable resource ignore is never referenced in body of corresponding try statement. Suppressing this warning specifically in each case that it happens using `@SuppressWarnings("try")` would be very verbose. This change removes `-try` from any gradle project and adds it to the build plugin. Also this change removes exclude flags from gradle projects that is already specified in build plugin (for example -deprecation). Relates to #40366
Many gradle projects specifically use the -try exclude flag, because there are many cases where auto-closeable resource ignore is never referenced in body of corresponding try statement. Suppressing this warning specifically in each case that it happens using `@SuppressWarnings("try")` would be very verbose. This change removes `-try` from any gradle project and adds it to the build plugin. Also this change removes exclude flags from gradle projects that is already specified in build plugin (for example -deprecation). Relates to #40366
The xlint exclusions of the following plugins were removed: * ingest-attachment. * mapper-size. * transport-nio. Removing the -try exclusion required some work, because the NettyAdaptor implements AutoCloseable and NettyAdaptor#close() method could throw an InterruptedException (ChannelFuture#await() and a generic Exception is re-thrown, which maybe an ChannelFuture). The easiest way around this to me seemed that NettyAdaptor should not implement AutoCloseable, because it is not directly used in a try-with-resources statement. Relates to elastic#40366
Many gradle projects specifically use the -try exclude flag, because there are many cases where auto-closeable resource ignore is never referenced in body of corresponding try statement. Suppressing this warning specifically in each case that it happens using `@SuppressWarnings("try")` would be very verbose. This change removes `-try` from any gradle project and adds it to the build plugin. Also this change removes exclude flags from gradle projects that is already specified in build plugin (for example -deprecation). Relates to elastic#40366
Part of #40366. Fix a number of javac issues when linting is enforced in `server/`.
Part of #40366. Fix a number of javac issues when linting is enforced in `server/`.
Part of elastic#40366. Fix a number of javac issues when linting is enforced in `server/`.
Part of #40366. Fix a number of javac issues when linting is enforced in `server/`.
Part of #40366. Fix a number of javac issues when linting is enforced in `server/`.
Part of #40366. Fix a number of javac issues when linting is enforced in `server/`.
Part of #40366. Fix a number of javac issues when linting is enforced in `server/`.
Closes #40366. Fix the last remaining javac issues when linting is enforced in `server/`.
Closes elastic#40366. Fix the last remaining javac issues when linting is enforced in `server/`.
There are a number of
build.gradle
files that specifically disable -Xlint warnings for both production and test code. This should be avoided, because that can mask real bugs.The following
build.gradle
files should be checked:./benchmarks/build.gradle
./client/client-benchmark-noop-api-plugin/build.gradle
./modules/ingest-common/build.gradle
Remove -Xlint exclusions in the ingest-common module. #40505./modules/ingest-geoip/build.gradle
Remove -Xlint exclusions in the ingest-geoip module #40629./modules/percolator/build.gradle
Remove -Xlint exclusions in the percolator module. #40372./modules/transport-netty4/build.gradle
./plugins/ingest-attachment/build.gradle
Remove -Xlint exclusions in all plugins. #40721./plugins/mapper-size/build.gradle
Remove -Xlint exclusions in all plugins. #40721./plugins/transport-nio/build.gradle
Remove -Xlint exclusions in all plugins. #40721./server/build.gradle
./test/framework/build.gradle
Re-enable compiler warnings in :test:framework #75449./x-pack/plugin/ccr/build.gradle
Make -try xlint warning disabled by default. #40833./x-pack/plugin/core/build.gradle
Enable compiler warnings in xpack core plugin project #66899./x-pack/plugin/data-frame/build.gradle
[ML] Data Frame minor tidy ups #40548./x-pack/plugin/ml/build.gradle
Enable XLint warnings for ML #44285./x-pack/plugin/monitoring/build.gradle
./x-pack/plugin/rollup/build.gradle
./x-pack/plugin/security/build.gradle
Enable compiler warnings in x-pack security #75473./x-pack/plugin/watcher/build.gradle
Enable compiler warnings for watcher #75516./x-pack/qa/rolling-upgrade-basic/build.gradle
./x-pack/qa/rolling-upgrade/build.gradle
./x-pack/qa/third-party/active-directory/build.gradle
If possible both
compileJava.options.compilerArgs
andcompileTestJava.options.compilerArgs
should be removed. RemovingcompileTestJava.options.compilerArgs
can be difficult, for example because of many tests having raw types or unchecked checks. So at least we should try to removecompileJava.options.compilerArgs
in each of the above mentioned files.By default the build disables the following warning:
-path
,-serial
,-options
,-deprecation
. So if one of those warnings are also mentioned in abuild.gradle
file then that can be removed.If you like to fix one of the above gradle files then post a comment which file you like to fix.
The text was updated successfully, but these errors were encountered: