diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlParameter.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlParameter.java index 30024ba36d..cc0bc49bdd 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlParameter.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlParameter.java @@ -185,15 +185,12 @@ public class SqlParameter { * to a List of SqlParameter objects as used in this package. */ public static List sqlTypesToAnonymousParameterList(@Nullable int... types) { - List result; - if (types != null) { - result = new ArrayList<>(types.length); - for (int type : types) { - result.add(new SqlParameter(type)); - } + if (types == null) { + return new LinkedList<>(); } - else { - result = new LinkedList<>(); + List result = new ArrayList<>(types.length); + for (int type : types) { + result.add(new SqlParameter(type)); } return result; }