Skip to content

Commit

Permalink
Add @nullable in doSetValue() in Argument[Type]PreparedStatementSetter
Browse files Browse the repository at this point in the history
This commit adds @nullable to the argValue parameters in the
doSetValue() methods in ArgumentPreparedStatementSetter and
ArgumentTypePreparedStatementSetter.

Closes gh-31086
  • Loading branch information
sbrannen committed Aug 21, 2023
1 parent ad1554a commit 229b478
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -62,7 +62,9 @@ public void setValues(PreparedStatement ps) throws SQLException {
* @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());
}
Expand Down
Expand Up @@ -94,7 +94,7 @@ public void setValues(PreparedStatement ps) throws SQLException {
* @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);
Expand Down

0 comments on commit 229b478

Please sign in to comment.