From ed2966b271a85bc0cd172f0ef88c071eb9d8049a Mon Sep 17 00:00:00 2001 From: Laurent Goujon Date: Mon, 22 Jul 2024 21:17:22 -0700 Subject: [PATCH] GH-43396: [Java] Remove/replace jsr305 jsr305 is not maintained anymore and is unlikely to support JPMS. The classes are also in the javax. namespace which is known to cause issues as well. Replace most uses of jsr305 with the equivalent checker framework annotations, and remove usage of @ThreadSafe. --- java/flight/flight-core/src/main/java/module-info.java | 1 - java/flight/flight-sql-jdbc-core/pom.xml | 6 ++---- .../driver/jdbc/client/ArrowFlightSqlClientHandler.java | 2 +- java/memory/memory-core/pom.xml | 4 ---- java/memory/memory-core/src/main/java/module-info.java | 1 - .../src/main/java/org/apache/arrow/memory/Accountant.java | 2 -- java/pom.xml | 5 ----- 7 files changed, 3 insertions(+), 18 deletions(-) diff --git a/java/flight/flight-core/src/main/java/module-info.java b/java/flight/flight-core/src/main/java/module-info.java index ff0d7427b59cc..e668fe6149fb9 100644 --- a/java/flight/flight-core/src/main/java/module-info.java +++ b/java/flight/flight-core/src/main/java/module-info.java @@ -35,7 +35,6 @@ requires io.netty.common; requires io.netty.handler; requires io.netty.transport; - requires jsr305; requires org.apache.arrow.format; requires org.apache.arrow.memory.core; requires org.apache.arrow.vector; diff --git a/java/flight/flight-sql-jdbc-core/pom.xml b/java/flight/flight-sql-jdbc-core/pom.xml index 4833d30dbc33f..502d866fcc0bd 100644 --- a/java/flight/flight-sql-jdbc-core/pom.xml +++ b/java/flight/flight-sql-jdbc-core/pom.xml @@ -132,10 +132,8 @@ under the License. - com.google.code.findbugs - jsr305 - 3.0.2 - compile + org.checkerframework + checker-qual diff --git a/java/flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/client/ArrowFlightSqlClientHandler.java b/java/flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/client/ArrowFlightSqlClientHandler.java index 845f5372d3f74..0e9c79a0907a5 100644 --- a/java/flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/client/ArrowFlightSqlClientHandler.java +++ b/java/flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/client/ArrowFlightSqlClientHandler.java @@ -29,7 +29,6 @@ import java.util.Map; import java.util.Optional; import java.util.Set; -import javax.annotation.Nullable; import org.apache.arrow.driver.jdbc.client.utils.ClientAuthenticationUtils; import org.apache.arrow.flight.CallOption; import org.apache.arrow.flight.CallStatus; @@ -61,6 +60,7 @@ import org.apache.arrow.vector.VectorSchemaRoot; import org.apache.arrow.vector.types.pojo.Schema; import org.apache.calcite.avatica.Meta.StatementType; +import org.checkerframework.checker.nullness.qual.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/java/memory/memory-core/pom.xml b/java/memory/memory-core/pom.xml index ce78fc479232a..7e8d21acd3f35 100644 --- a/java/memory/memory-core/pom.xml +++ b/java/memory/memory-core/pom.xml @@ -31,10 +31,6 @@ under the License. Core off-heap memory management libraries for Arrow ValueVectors. - - com.google.code.findbugs - jsr305 - org.slf4j slf4j-api diff --git a/java/memory/memory-core/src/main/java/module-info.java b/java/memory/memory-core/src/main/java/module-info.java index e2a07626c386f..bf8d523f26764 100644 --- a/java/memory/memory-core/src/main/java/module-info.java +++ b/java/memory/memory-core/src/main/java/module-info.java @@ -24,7 +24,6 @@ requires java.compiler; requires transitive jdk.unsupported; - requires jsr305; requires static org.checkerframework.checker.qual; requires static org.immutables.value.annotations; requires org.slf4j; diff --git a/java/memory/memory-core/src/main/java/org/apache/arrow/memory/Accountant.java b/java/memory/memory-core/src/main/java/org/apache/arrow/memory/Accountant.java index 5a31f4cd1914a..5d052c2cdeeec 100644 --- a/java/memory/memory-core/src/main/java/org/apache/arrow/memory/Accountant.java +++ b/java/memory/memory-core/src/main/java/org/apache/arrow/memory/Accountant.java @@ -17,7 +17,6 @@ package org.apache.arrow.memory; import java.util.concurrent.atomic.AtomicLong; -import javax.annotation.concurrent.ThreadSafe; import org.apache.arrow.util.Preconditions; import org.checkerframework.checker.nullness.qual.Nullable; @@ -25,7 +24,6 @@ * Provides a concurrent way to manage account for memory usage without locking. Used as basis for * Allocators. All operations are threadsafe (except for close). */ -@ThreadSafe class Accountant implements AutoCloseable { /** The parent allocator. */ diff --git a/java/pom.xml b/java/pom.xml index 45acf9dd0c732..7ebc0daba6470 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -155,11 +155,6 @@ under the License. flatbuffers-java ${dep.fbs.version} - - com.google.code.findbugs - jsr305 - 3.0.2 - org.slf4j slf4j-api