diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/PreparedStatementCreatorFactory.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/PreparedStatementCreatorFactory.java index e01abfaeb16..f3b3d495da4 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/PreparedStatementCreatorFactory.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/PreparedStatementCreatorFactory.java @@ -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 { */ 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())); } diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlUpdateTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlUpdateTests.java index 8f29e657cd8..2904dec4139 100644 --- a/spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlUpdateTests.java +++ b/spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlUpdateTests.java @@ -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 { pc::run); } + private class Updater extends SqlUpdate { public Updater() {