Skip to content

Commit ab19499

Browse files
committed
#220 - Polishing.
Reverted removal of null check that is marked as superfluous and adjusted nullability annotations instead.
1 parent 8a5fe30 commit ab19499

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Diff for: src/main/java/org/springframework/data/r2dbc/core/DefaultStatementMapper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ private PreparedOperation<Update> getMappedObject(UpdateSpec updateSpec,
188188
BindMarkers bindMarkers = this.dialect.getBindMarkersFactory().create();
189189
Table table = Table.create(toSql(updateSpec.getTable()));
190190

191-
if (updateSpec.getUpdate().getAssignments().isEmpty()) {
191+
if (updateSpec.getUpdate() == null || updateSpec.getUpdate().getAssignments().isEmpty()) {
192192
throw new IllegalArgumentException("UPDATE contains no assignments");
193193
}
194194

Diff for: src/main/java/org/springframework/data/r2dbc/core/StatementMapper.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -460,11 +460,12 @@ public Map<SqlIdentifier, SettableValue> getAssignments() {
460460
class UpdateSpec {
461461

462462
private final SqlIdentifier table;
463+
@Nullable
463464
private final Update update;
464465

465466
private final @Nullable Criteria criteria;
466467

467-
protected UpdateSpec(SqlIdentifier table, Update update, @Nullable Criteria criteria) {
468+
protected UpdateSpec(SqlIdentifier table, @Nullable Update update, @Nullable Criteria criteria) {
468469

469470
this.table = table;
470471
this.update = update;
@@ -506,6 +507,7 @@ public SqlIdentifier getTable() {
506507
return this.table;
507508
}
508509

510+
@Nullable
509511
public Update getUpdate() {
510512
return this.update;
511513
}

0 commit comments

Comments
 (0)