Skip to content

Commit

Permalink
Upgrade to Java 17 and use getPlatformClassLoader for jar parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Jul 26, 2023
1 parent 0c2b991 commit 7604fb8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ paradigm and AssertJ style assertion) or by providing query files with expected

## Prerequisites

To use Tempto you need a Java 1.8 runtime.
To use Tempto you need a Java 17 runtime.

Other dependencies will vary based on the set of features you are using.

Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<air.check.skip-modernizer>true</air.check.skip-modernizer>
<air.check.skip-spotbugs>true</air.check.skip-spotbugs>
<air.check.skip-pmd>true</air.check.skip-pmd>

<project.build.targetJdk>17</project.build.targetJdk>
</properties>

<modules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.sql.Driver;
import java.sql.SQLException;

import static java.lang.ClassLoader.getPlatformClassLoader;
import static java.sql.DriverManager.getConnection;

public final class JdbcUtils
Expand Down Expand Up @@ -89,12 +90,11 @@ private static Driver getDatabaseDriver(JdbcConnectivityParamsState jdbcParamsSt
private static ClassLoader getDriverClassLoader(JdbcConnectivityParamsState jdbcParamsState)
{
try {
ClassLoader myClassLoader = JdbcUtils.class.getClassLoader();
if (!jdbcParamsState.jar.isPresent()) {
return myClassLoader;
return JdbcUtils.class.getClassLoader();
}
URL jarURL = new File(jdbcParamsState.jar.get()).toURL();
return URLClassLoader.newInstance(new URL[] {jarURL}, myClassLoader);
return URLClassLoader.newInstance(new URL[] {jarURL}, getPlatformClassLoader());
}
catch (MalformedURLException e) {
throw new RuntimeException("could not create classloader for file" + jdbcParamsState.jar.get(), e);
Expand Down
2 changes: 1 addition & 1 deletion tempto-examples/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ services:
- 'trino-master'

runner:
image: 'ghcr.io/trinodb/testing/centos7-oj11:53'
image: 'ghcr.io/trinodb/testing/centos7-oj17:82'
ports:
- '5005:5005'
volumes:
Expand Down

0 comments on commit 7604fb8

Please sign in to comment.