aws / amazon-redshift-jdbc-driver

Redshift JDBC Driver. It supports JDBC 4.2 specification.
Apache License 2.0
63 stars 31 forks source link

Compilation in src/main/java/com/amazon/redshift/util/StreamWrapper.java with latest versions of Java #86

Open cushon opened 1 year ago

cushon commented 1 year ago

The following code doesn't compile with JDK 21 and newer: https://github.com/aws/amazon-redshift-jdbc-driver/blob/5fd2db671a187c6f9e39dc9831798000e1166fe9/src/main/java/com/amazon/redshift/util/StreamWrapper.java#L116

It overrides finalize() in FileInputStream, which throws IOException. That override was removed in JDK 12: https://bugs.openjdk.org/browse/JDK-8192939

The compilation error with newer versions is:

com/amazon/redshift/util/StreamWrapper.java:120: error: unreported exception Throwable; must be caught or declared to be thrown
            super.finalize();
                          ^
bhvkshah commented 1 year ago

Thanks for submitting this issue @cushon . I'll take a look and get back to you when I have an update