Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Java 17 and use getPlatformClassLoader for jar parameter #118

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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