From f65cf260ce34c8ed01a66845d77c190c646160c1 Mon Sep 17 00:00:00 2001 From: Laurent Goujon Date: Fri, 29 Mar 2024 09:06:44 -0700 Subject: [PATCH] Remove ReflectiveOperationException from method declaration --- .../arrow/driver/jdbc/ITDriverJarValidation.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/java/flight/flight-sql-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ITDriverJarValidation.java b/java/flight/flight-sql-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ITDriverJarValidation.java index 1d3499f1007c0..97b147de1be36 100644 --- a/java/flight/flight-sql-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ITDriverJarValidation.java +++ b/java/flight/flight-sql-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/ITDriverJarValidation.java @@ -62,9 +62,12 @@ public class ITDriverJarValidation { "properties/flight.properties"); // This method is designed to work with Maven failsafe plugin and expects the - // JDBC driver - // jar to be present in the test classpath (instead of the individual classes) - private static JarFile getJdbcJarFile() throws ReflectiveOperationException, IOException { + // JDBC driver jar to be present in the test classpath (instead of the individual classes) + private static JarFile getJdbcJarFile() throws IOException { + // Check if an override has been set + if (JDBC_DRIVER_PATH_OVERRIDE != null) { + return new JarFile(new File(JDBC_DRIVER_PATH_OVERRIDE)); + } // URL driverClassURL = ITDriverJarValidation.class.getClassLoader() @@ -83,7 +86,7 @@ private static JarFile getJdbcJarFile() throws ReflectiveOperationException, IOE public ErrorCollector collector = new ErrorCollector(); @Test - public void validateShadedJar() throws ReflectiveOperationException, IOException { + public void validateShadedJar() throws IOException { // Validate the content of the jar to enforce all 3rd party dependencies have // been shaded try (JarFile jar = getJdbcJarFile()) {