Skip to content

Commit

Permalink
Fix build for Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed Dec 10, 2023
1 parent 810f931 commit 07364b2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies {

java {
toolchain {
languageVersion = JavaLanguageVersion.of(getPropertyWithDefault('javaVersion', '17'))
languageVersion = JavaLanguageVersion.of(getPropertyWithDefault('javaVersion', '21'))
}
withJavadocJar()
withSourcesJar()
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/itsallcode/jdbc/resultset/RowMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public static <T> RowMapper<T> create(final SimpleRowMapper<T> mapper) {
/**
* Converts a single row from a {@link ResultSet} to a generic row type.
* <p>
* Use this interface if you don't need the {@link Context}.
* Use this interface with method {@link RowMapper#create(SimpleRowMapper)} if
* you don't need the {@link Context}.
*
* @param <T> generic row type
*/
Expand All @@ -83,6 +84,8 @@ public interface SimpleRowMapper<T> {

/**
* A simplified row mapper that gets a list of column values as input.
*
* @param <T> generic row type
*/
@FunctionalInterface
public interface ColumnValuesConverter<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

import java.io.*;
import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.*;
import java.sql.*;
import java.sql.Date;
import java.util.*;
Expand Down Expand Up @@ -869,15 +868,15 @@ void getTimestampLabelCal() throws SQLException {
}

@Test
void getURLIndex() throws SQLException, MalformedURLException {
final URL url = new URL("https://example.com");
void getURLIndex() throws SQLException, MalformedURLException, URISyntaxException {
final URL url = new URI("https://example.com").toURL();
when(resultSetMock.getURL(COL_INDEX)).thenReturn(url);
assertSame(url, testee().getURL(COL_INDEX));
}

@Test
void getURLLabel() throws SQLException, MalformedURLException {
final URL url = new URL("https://example.com");
void getURLLabel() throws SQLException, MalformedURLException, URISyntaxException {
final URL url = new URI("https://example.com").toURL();
when(resultSetMock.getURL(COL_LABEL)).thenReturn(url);
assertSame(url, testee().getURL(COL_LABEL));
}
Expand Down

0 comments on commit 07364b2

Please sign in to comment.