You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JdbcOperations.queryForList(sql: String, args: Array<out Any>) Kotlin extension function incorrectly passes the args array as the first, non-spread, argument to this Java method:
The effect is that the array args in the extension function ends up getting passed as the first and only rest parameter of the Java method, so in the Java code, args is an array of an array of values.
Example
In Kotlin code:
// jdbc is a JdbcTemplateval results = jdbc.queryForList<String>(
"SELECT id FROM users WHERE email = ?",
arrayOf("somebody@domain.com"),
)
The JdbcTemplate ends up getting called with
queryForList(
"SELECT id FROM users WHERE email = ?",
String.class,
newObject[] {
newString[] {"somebody@domain.com" }
}
);
and finally, the DB (in my case, postgresql) throws an error, e.g.:
org.postgresql.util.PSQLException: ERROR: operator does not exist: text = character varying[]
changed the title [-]Kotlin JdbcOperations.queryForList extension fails to spread array of query args[/-][+]Fix `RestOperations` Kotlin extensions[/+]on Nov 19, 2025
Activity
[-]Kotlin JdbcOperations.queryForList extension fails to spread array of query args[/-][+]Fix `RestOperations` Kotlin extensions[/+][-]Fix `RestOperations` Kotlin extensions[/-][+]Fix `JdbcOperations ` Kotlin extensions[/+]Fix JdbcOperations Kotlin extensions
Refine RestOperations Kotlin extensions nullability
sdeleuze commentedon Nov 19, 2025
@agrounds Thanks for catching this, I did a more comprehensive update as various things were broken or inconsistent.