Add @Nullable in doSetValue() in Argument[Type]PreparedStatementSetter

This commit adds @Nullable to the argValue parameters in the
doSetValue() methods in ArgumentPreparedStatementSetter and
ArgumentTypePreparedStatementSetter.

Closes gh-31086
This commit is contained in:
Sam Brannen 2023-08-21 16:01:38 +02:00
parent ad1554a631
commit 229b4782ee
2 changed files with 4 additions and 2 deletions

View File

@ -62,7 +62,9 @@ public class ArgumentPreparedStatementSetter implements PreparedStatementSetter,
* @param argValue the value to set
* @throws SQLException if thrown by PreparedStatement methods
*/
protected void doSetValue(PreparedStatement ps, int parameterPosition, Object argValue) throws SQLException {
protected void doSetValue(PreparedStatement ps, int parameterPosition, @Nullable Object argValue)
throws SQLException {
if (argValue instanceof SqlParameterValue paramValue) {
StatementCreatorUtils.setParameterValue(ps, parameterPosition, paramValue, paramValue.getValue());
}

View File

@ -94,7 +94,7 @@ public class ArgumentTypePreparedStatementSetter implements PreparedStatementSet
* @param argValue the argument value
* @throws SQLException if thrown by PreparedStatement methods
*/
protected void doSetValue(PreparedStatement ps, int parameterPosition, int argType, Object argValue)
protected void doSetValue(PreparedStatement ps, int parameterPosition, int argType, @Nullable Object argValue)
throws SQLException {
StatementCreatorUtils.setParameterValue(ps, parameterPosition, argType, argValue);