Conversation
sbrannen
left a comment
There was a problem hiding this comment.
Thanks for the suggestions and the PR.
I've requested a small fix.
| for (int i = 0; i <= jdbcIndex - this.currentIndexedParams.size(); i++) { | ||
| this.currentIndexedParams.add(null); | ||
| } |
There was a problem hiding this comment.
Iterating based on the current size() and adding to the list within the loop will lead to errors.
Perhaps you can take inspiration from DefaultStatementSpec.param(int, Object)'s handling of indexedParams?
| return this; | ||
| } | ||
|
|
||
| private static void addIndexedParam(List<@Nullable Object> indexedParams, int jdbcIndex, @Nullable Object value) { |
There was a problem hiding this comment.
@sbrannen I make this util method as static to avoid misusing this.indexedParams, is it recommended?
There was a problem hiding this comment.
Yes, making it static is a good call, but please move addIndexedParam() and validateIndexedParamValue() below statementCreatorForIndexedParamsWithKeys().
| return this; | ||
| } | ||
|
|
||
| private static void addIndexedParam(List<@Nullable Object> indexedParams, int jdbcIndex, @Nullable Object value) { |
There was a problem hiding this comment.
Yes, making it static is a good call, but please move addIndexedParam() and validateIndexedParamValue() below statementCreatorForIndexedParamsWithKeys().
Add missing methods:
param(int jdbcIndex, @Nullable Object value)param(int jdbcIndex, @Nullable Object value, int sqlType)param(String name, @Nullable Object value, int sqlType)