diff --git a/java/flight/flight-core/pom.xml b/java/flight/flight-core/pom.xml
index 0346172f610a6..b8cf6e3000c58 100644
--- a/java/flight/flight-core/pom.xml
+++ b/java/flight/flight-core/pom.xml
@@ -89,6 +89,7 @@
com.google.protobuf
protobuf-java-util
+ 3.23.1
io.grpc
diff --git a/java/flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/AddWritableBuffer.java b/java/flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/AddWritableBuffer.java
index a4cacc713270e..4a99ab22842e2 100644
--- a/java/flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/AddWritableBuffer.java
+++ b/java/flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/AddWritableBuffer.java
@@ -72,7 +72,7 @@ public class AddWritableBuffer {
tmpBufChainOut = tmpBufChainOut2;
} catch (Exception ex) {
- throw new RuntimeException("Failed to initialize AddWritableBuffer, falling back to slow path", ex);
+ new RuntimeException("Failed to initialize AddWritableBuffer, falling back to slow path", ex).printStackTrace();
}
bufConstruct = tmpConstruct;
diff --git a/java/flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/GetReadableBuffer.java b/java/flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/GetReadableBuffer.java
index bd2e780a0cef1..82cfd7f39c91c 100644
--- a/java/flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/GetReadableBuffer.java
+++ b/java/flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/GetReadableBuffer.java
@@ -51,7 +51,7 @@ public class GetReadableBuffer {
tmpField = f;
tmpClazz = clazz;
} catch (Exception e) {
- throw new RuntimeException("Failed to initialize GetReadableBuffer, falling back to slow path", e);
+ new RuntimeException("Failed to initialize GetReadableBuffer, falling back to slow path", e).printStackTrace();
}
READABLE_BUFFER = tmpField;
BUFFER_INPUT_STREAM = tmpClazz;
diff --git a/java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestServerMiddleware.java b/java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestServerMiddleware.java
index e209f62402c41..3bc8f2f90a612 100644
--- a/java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestServerMiddleware.java
+++ b/java/flight/flight-core/src/test/java/org/apache/arrow/flight/TestServerMiddleware.java
@@ -104,7 +104,7 @@ public void doPutUncaught() {
Assertions.assertEquals(FlightStatusCode.OK, status.code());
Assertions.assertNull(status.cause());
Assertions.assertNotNull(err);
- Assertions.assertEquals(new RuntimeException("test").getMessage(), err.getMessage());
+ Assertions.assertEquals("test", err.getMessage());
});
}
@@ -119,7 +119,7 @@ public void listFlightsUncaught() {
Assertions.assertEquals(FlightStatusCode.OK, status.code());
Assertions.assertNull(status.cause());
Assertions.assertNotNull(err);
- Assertions.assertEquals(new RuntimeException("test").getMessage(), err.getMessage());
+ Assertions.assertEquals("test", err.getMessage());
});
}
@@ -134,7 +134,7 @@ public void doActionUncaught() {
Assertions.assertEquals(FlightStatusCode.OK, status.code());
Assertions.assertNull(status.cause());
Assertions.assertNotNull(err);
- Assertions.assertEquals(new RuntimeException("test").getMessage(), err.getMessage());
+ Assertions.assertEquals("test", err.getMessage());
});
}
@@ -149,7 +149,7 @@ public void listActionsUncaught() {
Assertions.assertEquals(FlightStatusCode.OK, status.code());
Assertions.assertNull(status.cause());
Assertions.assertNotNull(err);
- Assertions.assertEquals(new RuntimeException("test").getMessage(), err.getMessage());
+ Assertions.assertEquals("test", err.getMessage());
});
}
@@ -184,7 +184,7 @@ public void doGetUncaught() {
Assertions.assertEquals(FlightStatusCode.OK, status.code());
Assertions.assertNull(status.cause());
Assertions.assertNotNull(err);
- Assertions.assertEquals(new RuntimeException("test").getMessage(), err.getMessage());
+ Assertions.assertEquals("test", err.getMessage());
});
}
diff --git a/java/flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcDriver.java b/java/flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcDriver.java
index 9ec560085c786..183e3d5c7b055 100644
--- a/java/flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcDriver.java
+++ b/java/flight/flight-sql-jdbc-core/src/main/java/org/apache/arrow/driver/jdbc/ArrowFlightJdbcDriver.java
@@ -27,7 +27,6 @@
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.sql.SQLException;
-import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
@@ -44,8 +43,6 @@
import org.apache.calcite.avatica.Meta;
import org.apache.calcite.avatica.UnregisteredDriver;
-import com.google.common.base.Ascii;
-import com.google.common.base.Splitter;
/**
* JDBC driver for querying data from an Apache Arrow Flight server.
@@ -103,6 +100,7 @@ protected String getFactoryClassName(final JdbcVersion jdbcVersion) {
}
@Override
+ @SuppressWarnings("StringSplitter")
protected DriverVersion createDriverVersion() {
if (version == null) {
final InputStream flightProperties = this.getClass().getResourceAsStream("/properties/flight.properties");
@@ -115,17 +113,17 @@ protected DriverVersion createDriverVersion() {
final String parentName = properties.getProperty("org.apache.arrow.flight.name");
final String parentVersion = properties.getProperty("org.apache.arrow.flight.version");
- final List pVersion = Splitter.on('.').splitToList(parentVersion);
+ final String[] pVersion = parentVersion.split("\\.");
- final int parentMajorVersion = Integer.parseInt(pVersion.get(0));
- final int parentMinorVersion = Integer.parseInt(pVersion.get(1));
+ final int parentMajorVersion = Integer.parseInt(pVersion[0]);
+ final int parentMinorVersion = Integer.parseInt(pVersion[1]);
final String childName = properties.getProperty("org.apache.arrow.flight.jdbc-driver.name");
final String childVersion = properties.getProperty("org.apache.arrow.flight.jdbc-driver.version");
- final List cVersion = Splitter.on('.').splitToList(childVersion);
+ final String[] cVersion = childVersion.split("\\.");
- final int childMajorVersion = Integer.parseInt(cVersion.get(0));
- final int childMinorVersion = Integer.parseInt(cVersion.get(1));
+ final int childMajorVersion = Integer.parseInt(cVersion[0]);
+ final int childMinorVersion = Integer.parseInt(cVersion[1]);
version = new DriverVersion(
childName,
@@ -271,7 +269,7 @@ Optional