Skip to content

Commit 5fbc68e

Browse files
christophstroblschauder
authored andcommitted
Add Nullable annotation to parameter of overridden equals method.
Closes #1374 Original pull request #1375
1 parent ae1bb6a commit 5fbc68e

File tree

17 files changed

+29
-20
lines changed

17 files changed

+29
-20
lines changed

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/Identifier.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public Class<?> getTargetType() {
208208
}
209209

210210
@Override
211-
public boolean equals(Object o) {
211+
public boolean equals(@Nullable Object o) {
212212

213213
if (this == o)
214214
return true;
@@ -272,7 +272,7 @@ public V get(Object key) {
272272
}
273273

274274
@Override
275-
public boolean equals(Object o) {
275+
public boolean equals(@Nullable Object o) {
276276

277277
if (this == o) return true;
278278
if (o == null || getClass() != o.getClass()) return false;

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/InsertSubject.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
import java.util.Objects;
1919

20+
import org.springframework.lang.Nullable;
21+
2022
/**
2123
* The subject of an insert, described by the entity instance and its {@link Identifier}, where identifier contains
2224
* information about data that needs to be considered for the insert but which is not part of the entity. Namely
@@ -50,7 +52,7 @@ public Identifier getIdentifier() {
5052
}
5153

5254
@Override
53-
public boolean equals(Object o) {
55+
public boolean equals(@Nullable Object o) {
5456

5557
if (this == o)
5658
return true;

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/SqlGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ Column getParentId() {
10011001
}
10021002

10031003
@Override
1004-
public boolean equals(Object o) {
1004+
public boolean equals(@Nullable Object o) {
10051005

10061006
if (this == o) {
10071007
return true;

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/mapping/AggregateReference.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public ID getId() {
6565
}
6666

6767
@Override
68-
public boolean equals(Object o) {
68+
public boolean equals(@Nullable Object o) {
6969

7070
if (this == o)
7171
return true;

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/mapping/JdbcValue.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public SQLType getJdbcType() {
5555
}
5656

5757
@Override
58-
public boolean equals(Object o) {
58+
public boolean equals(@Nullable Object o) {
5959

6060
if (this == o)
6161
return true;

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/JdbcQueryCreator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ static private final class Join {
352352
}
353353

354354
@Override
355-
public boolean equals(Object o) {
355+
public boolean equals(@Nullable Object o) {
356356

357357
if (this == o)
358358
return true;

spring-data-r2dbc/src/main/java/org/springframework/data/r2dbc/core/NamedParameterUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ int getEndIndex() {
382382
}
383383

384384
@Override
385-
public boolean equals(Object o) {
385+
public boolean equals(@Nullable Object o) {
386386
if (this == o)
387387
return true;
388388
if (!(o instanceof ParameterHolder))

spring-data-r2dbc/src/main/java/org/springframework/data/r2dbc/mapping/OutboundRow.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.function.BiConsumer;
2525

2626
import org.springframework.data.relational.core.sql.SqlIdentifier;
27+
import org.springframework.lang.Nullable;
2728
import org.springframework.r2dbc.core.Parameter;
2829
import org.springframework.util.Assert;
2930

@@ -195,7 +196,7 @@ public Set<Entry<SqlIdentifier, Parameter>> entrySet() {
195196
}
196197

197198
@Override
198-
public boolean equals(final Object o) {
199+
public boolean equals(@Nullable final Object o) {
199200

200201
if (this == o) {
201202
return true;

spring-data-r2dbc/src/test/java/org/springframework/data/r2dbc/repository/AbstractR2dbcRepositoryWithMixedCaseNamesIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public static class LegoSet {
142142
}
143143

144144
@Override
145-
public boolean equals(Object o) {
145+
public boolean equals(@Nullable Object o) {
146146
if (this == o)
147147
return true;
148148
if (o == null || getClass() != o.getClass())

spring-data-relational/src/main/java/org/springframework/data/relational/core/mapping/DerivedSqlIdentifier.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import org.springframework.data.relational.core.sql.IdentifierProcessing;
2323
import org.springframework.data.relational.core.sql.SqlIdentifier;
24+
import org.springframework.lang.Nullable;
2425
import org.springframework.util.Assert;
2526

2627
/**
@@ -69,7 +70,7 @@ public String getReference(IdentifierProcessing processing) {
6970
}
7071

7172
@Override
72-
public boolean equals(Object o) {
73+
public boolean equals(@Nullable Object o) {
7374

7475
if (this == o) {
7576
return true;

0 commit comments

Comments
 (0)