From 22a44962bb3a641051cf449d9598477dd7dc820d Mon Sep 17 00:00:00 2001 From: Vibhatha Lakmal Abeykoon Date: Tue, 10 Sep 2024 21:06:50 +0530 Subject: [PATCH] GH-44016: [Java] Consider warnings as errors for Format Module (#44017) ### Rationale for this change This PR configs the build such that warnings are considered errors in the Format module. And corresponding code changes have also been made. ### What changes are included in this PR? Adding flags to consider warnings as errors in javac and fixing the corresponding errors. ### Are these changes tested? Tested by existing test cases. ### Are there any user-facing changes? N/A * GitHub Issue: #44016 Lead-authored-by: Vibhatha Lakmal Abeykoon Co-authored-by: Vibhatha Lakmal Abeykoon Co-authored-by: David Li Signed-off-by: Dane Pitkin --- java/format/pom.xml | 9 +++++++++ java/format/src/main/java/module-info.java | 2 ++ 2 files changed, 11 insertions(+) diff --git a/java/format/pom.xml b/java/format/pom.xml index 1121930da42d2..f767215b12807 100644 --- a/java/format/pom.xml +++ b/java/format/pom.xml @@ -61,6 +61,15 @@ under the License. + + org.apache.maven.plugins + maven-compiler-plugin + + + -Werror + + + diff --git a/java/format/src/main/java/module-info.java b/java/format/src/main/java/module-info.java index bda779c91afbc..f8d740b726fde 100644 --- a/java/format/src/main/java/module-info.java +++ b/java/format/src/main/java/module-info.java @@ -15,6 +15,8 @@ * limitations under the License. */ +// TODO(https://github.com/apache/arrow/issues/44037): Google hasn't reviewed Flatbuffers fix +@SuppressWarnings({ "requires-automatic", "requires-transitive-automatic" }) module org.apache.arrow.format { exports org.apache.arrow.flatbuf; requires transitive flatbuffers.java;