Source:
<code>public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException { checkOpen(); <START> if ((x == null) || (targetSqlType == Types.NULL)) { <END> setNull(parameterIndex, targetSqlType); return; } switch (targetSqlType) { case Types.TINYINT: setByte(parameterIndex, castToByte(x, targetSqlType)); return; case Types.SMALLINT: setShort(parameterIndex, castToShort(x, targetSqlType)); return; case Types.INTEGER: setInt(parameterIndex, castToInt(x, targetSqlType)); return; case Types.BIGINT: setLong(parameterIndex, castToLong(x, targetSqlType)); return; case Types.FLOAT: case Types.REAL: setFloat(parameterIndex, castToFloat(x, targetSqlType)); return; case Types.DOUBLE: setDouble(parameterIndex, castToDouble(x, targetSqlType)); return; case Types.DECIMAL: case Types.NUMERIC: setBigDecimal(parameterIndex, castToBigDecimal(x, targetSqlType)); return; case Types.CHAR: case Types.NCHAR: case Types.VARCHAR: case Types.NVARCHAR: case Types.LONGVARCHAR: case Types.LONGNVARCHAR: setString(parameterIndex, x.toString()); return; case Types.BINARY: case Types.VARBINARY: case Types.LONGVARBINARY: setBytes(parameterIndex, castToBinary(x, targetSqlType)); return; case Types.DATE: setDate(parameterIndex, castToDate(x, targetSqlType)); return; case Types.TIME: setTime(parameterIndex, castToTime(x, targetSqlType)); return; case Types.TIMESTAMP: setTimestamp(parameterIndex, castToTimestamp(x, targetSqlType)); return; } throw new SQLException("Unsupported target SQL type: " + targetSqlType); }</code><technical_language>Is x != null && targetSqlType == Types.NULL valid</technical_language>

Target:
public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException { checkOpen(); if (x == null) { setNull(parameterIndex, targetSqlType); return; } switch (targetSqlType) { case Types.BOOLEAN: case Types.BIT: setBoolean(parameterIndex, castToBoolean(x, targetSqlType)); return; case Types.TINYINT: setByte(parameterIndex, castToByte(x, targetSqlType)); return; case Types.SMALLINT: setShort(parameterIndex, castToShort(x, targetSqlType)); return; case Types.INTEGER: setInt(parameterIndex, castToInt(x, targetSqlType)); return; case Types.BIGINT: setLong(parameterIndex, castToLong(x, targetSqlType)); return; case Types.FLOAT: case Types.REAL: setFloat(parameterIndex, castToFloat(x, targetSqlType)); return; case Types.DOUBLE: setDouble(parameterIndex, castToDouble(x, targetSqlType)); return; case Types.DECIMAL: case Types.NUMERIC: setBigDecimal(parameterIndex, castToBigDecimal(x, targetSqlType)); return; case Types.CHAR: case Types.NCHAR: case Types.VARCHAR: case Types.NVARCHAR: case Types.LONGVARCHAR: case Types.LONGNVARCHAR: setString(parameterIndex, x.toString()); return; case Types.BINARY: case Types.VARBINARY: case Types.LONGVARBINARY: setBytes(parameterIndex, castToBinary(x, targetSqlType)); return; case Types.DATE: setDate(parameterIndex, castToDate(x, targetSqlType)); return; case Types.TIME: setTime(parameterIndex, castToTime(x, targetSqlType)); return; case Types.TIMESTAMP: setTimestamp(parameterIndex, castToTimestamp(x, targetSqlType)); return; } throw new SQLException("Unsupported target SQL type: " + targetSqlType); }