You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/08/01 15:15:04 UTC

[commons-dbutils] 03/03: Test no longer needs to run on old Java versions

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-dbutils.git

commit dd62c48c5278ca2c5dbb027668653c6705c15e85
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Aug 1 11:13:01 2023 -0400

    Test no longer needs to run on old Java versions
---
 src/main/java/org/apache/commons/dbutils/DbUtils.java | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/src/main/java/org/apache/commons/dbutils/DbUtils.java b/src/main/java/org/apache/commons/dbutils/DbUtils.java
index c39e4a5..60c1a09 100644
--- a/src/main/java/org/apache/commons/dbutils/DbUtils.java
+++ b/src/main/java/org/apache/commons/dbutils/DbUtils.java
@@ -20,8 +20,6 @@ import static java.sql.DriverManager.registerDriver;
 
 import java.io.PrintWriter;
 import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
 import java.sql.Connection;
 import java.sql.Driver;
 import java.sql.DriverPropertyInfo;
@@ -44,8 +42,6 @@ public final class DbUtils {
      */
     static final class DriverProxy implements Driver {
 
-        private boolean parentLoggerSupported = true;
-
         /**
          * The adapted JDBC Driver loaded dynamically.
          */
@@ -97,16 +93,7 @@ public final class DbUtils {
          */
         @Override
         public Logger getParentLogger() throws SQLFeatureNotSupportedException {
-            if (parentLoggerSupported) {
-                try {
-                    final Method method = adapted.getClass().getMethod("getParentLogger");
-                    return (Logger)method.invoke(adapted);
-                } catch (final NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
-                    parentLoggerSupported = false;
-                    throw new SQLFeatureNotSupportedException(e);
-                }
-            }
-            throw new SQLFeatureNotSupportedException();
+            return adapted.getParentLogger();
         }
 
         /**