chore: apply spotless formatting

This commit is contained in:
kimminseok
2025-10-27 00:31:49 +09:00
parent 24181ad307
commit 2b456ec7e4
2 changed files with 41 additions and 38 deletions

View File

@@ -236,14 +236,15 @@ public final class JDBC4ResultSet implements ResultSet, ResultSetMetaData {
if (result == null) {
return null;
}
return wrapTypeConversion(() -> {
if (result instanceof String) {
return new ByteArrayInputStream(((String) result).getBytes("US-ASCII"));
} else if (result instanceof byte[]) {
return new ByteArrayInputStream((byte[]) result);
}
throw new SQLException("Cannot convert to ASCII stream: " + result.getClass());
});
return wrapTypeConversion(
() -> {
if (result instanceof String) {
return new ByteArrayInputStream(((String) result).getBytes("US-ASCII"));
} else if (result instanceof byte[]) {
return new ByteArrayInputStream((byte[]) result);
}
throw new SQLException("Cannot convert to ASCII stream: " + result.getClass());
});
}
@Override
@@ -254,14 +255,15 @@ public final class JDBC4ResultSet implements ResultSet, ResultSetMetaData {
if (result == null) {
return null;
}
return wrapTypeConversion(() -> {
if (result instanceof String) {
return new ByteArrayInputStream(((String) result).getBytes("UTF-8"));
} else if (result instanceof byte[]) {
return new ByteArrayInputStream((byte[]) result);
}
throw new SQLException("Cannot convert to Unicode stream: " + result.getClass());
});
return wrapTypeConversion(
() -> {
if (result instanceof String) {
return new ByteArrayInputStream(((String) result).getBytes("UTF-8"));
} else if (result instanceof byte[]) {
return new ByteArrayInputStream((byte[]) result);
}
throw new SQLException("Cannot convert to Unicode stream: " + result.getClass());
});
}
@Override
@@ -272,12 +274,13 @@ public final class JDBC4ResultSet implements ResultSet, ResultSetMetaData {
if (result == null) {
return null;
}
return wrapTypeConversion(() -> {
if (result instanceof byte[]) {
return new ByteArrayInputStream((byte[]) result);
}
throw new SQLException("Cannot convert to binary stream: " + result.getClass());
});
return wrapTypeConversion(
() -> {
if (result instanceof byte[]) {
return new ByteArrayInputStream((byte[]) result);
}
throw new SQLException("Cannot convert to binary stream: " + result.getClass());
});
}
@Override

View File

@@ -899,19 +899,19 @@ class JDBC4ResultSetTest {
@Test
void test_columnLabel_getters() throws Exception {
stmt.executeUpdate(
"CREATE TABLE test_column_label (" +
"bool_col INTEGER, " +
"byte_col INTEGER, " +
"short_col INTEGER, " +
"int_col INTEGER, " +
"long_col BIGINT, " +
"float_col REAL, " +
"double_col REAL, " +
"bytes_col BLOB);");
"CREATE TABLE test_column_label ("
+ "bool_col INTEGER, "
+ "byte_col INTEGER, "
+ "short_col INTEGER, "
+ "int_col INTEGER, "
+ "long_col BIGINT, "
+ "float_col REAL, "
+ "double_col REAL, "
+ "bytes_col BLOB);");
stmt.executeUpdate(
"INSERT INTO test_column_label VALUES (" +
"1, 127, 32767, 2147483647, 9223372036854775807, 3.14, 2.718281828, X'48656C6C6F');");
"INSERT INTO test_column_label VALUES ("
+ "1, 127, 32767, 2147483647, 9223372036854775807, 3.14, 2.718281828, X'48656C6C6F');");
ResultSet resultSet = stmt.executeQuery("SELECT * FROM test_column_label");
assertTrue(resultSet.next());
@@ -1122,11 +1122,11 @@ class JDBC4ResultSetTest {
@Test
void test_wasNull_consistency_across_types() throws Exception {
stmt.executeUpdate(
"CREATE TABLE test_null_types (" +
"int_col INTEGER, " +
"text_col TEXT, " +
"real_col REAL, " +
"blob_col BLOB);");
"CREATE TABLE test_null_types ("
+ "int_col INTEGER, "
+ "text_col TEXT, "
+ "real_col REAL, "
+ "blob_col BLOB);");
stmt.executeUpdate("INSERT INTO test_null_types VALUES (NULL, NULL, NULL, NULL);");
ResultSet resultSet = stmt.executeQuery("SELECT * FROM test_null_types");