Browse Source

Polishing

pull/31496/head
Juergen Hoeller 1 year ago
parent
commit
c0c4298048
  1. 4
      spring-jdbc/src/main/java/org/springframework/jdbc/core/PreparedStatementCreatorFactory.java
  2. 6
      spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlUpdateTests.java

4
spring-jdbc/src/main/java/org/springframework/jdbc/core/PreparedStatementCreatorFactory.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -180,7 +180,7 @@ public class PreparedStatementCreatorFactory { @@ -180,7 +180,7 @@ public class PreparedStatementCreatorFactory {
*/
public PreparedStatementCreator newPreparedStatementCreator(String sqlToUse, @Nullable Object[] params) {
return new PreparedStatementCreatorImpl(
sqlToUse, params != null ? Arrays.asList(params) : Collections.emptyList());
sqlToUse, (params != null ? Arrays.asList(params) : Collections.emptyList()));
}

6
spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlUpdateTests.java

@ -211,9 +211,8 @@ public class SqlUpdateTests { @@ -211,9 +211,8 @@ public class SqlUpdateTests {
given(resultSet.getObject(1)).willReturn(11);
given(preparedStatement.executeUpdate()).willReturn(1);
given(preparedStatement.getGeneratedKeys()).willReturn(resultSet);
given(connection.prepareStatement(INSERT_GENERATE_KEYS,
PreparedStatement.RETURN_GENERATED_KEYS)
).willReturn(preparedStatement);
given(connection.prepareStatement(INSERT_GENERATE_KEYS, PreparedStatement.RETURN_GENERATED_KEYS))
.willReturn(preparedStatement);
GeneratedKeysUpdater pc = new GeneratedKeysUpdater();
KeyHolder generatedKeyHolder = new GeneratedKeyHolder();
@ -294,6 +293,7 @@ public class SqlUpdateTests { @@ -294,6 +293,7 @@ public class SqlUpdateTests {
pc::run);
}
private class Updater extends SqlUpdate {
public Updater() {

Loading…
Cancel
Save