Java ErrorProne static analysis was recently enabled in the Gradle build process, but only as warnings. ErrorProne errors are generally useful and easy to fix. Some work was done to make sdks-java-core ErrorProne-clean and add enforcement. This task is clean ErrorProne warnings and add enforcement in beam-sdks-java-io-elasticsearch and related project. Additional context discussed on the dev list.
Fixing this issue will involve:
- Follow instructions in the Contribution Guide to set up a beam development environment.
- Run the following command to compile and run ErrorProne analysis on the project: ./gradlew :beam-sdks-java-io-elasticsearch:assemble :beam-sdks-java-io-elasticsearch-tests-2:assemble :beam-sdks-java-io-elasticsearch-tests-5:assemble :beam-sdks-java-io-elasticsearch-tests-common:assemble
- Fix each ErrorProne warning from the sdks/java/io/elasticsearch* projects.
- In sdks/java/io/elasticsearch/build.gradle, sdks/java/io/elasticsearch-tests/elasticsearch-tests-2/build.gradle, and sdks/java/io/elasticsearch-tests/elasticsearch-tests-5/build.gradle, and sdks/java/io/elasticsearch-tests/elasticsearch-tests-common/build.gradle, add failOnWarning: true to the call the applyJavaNature() (example).