Skip to content

Commit fe549f7

Browse files
christophstroblmp911de
authored andcommitted
Add Nullable annotation to parameter of overridden equals method.
Closes: #4226 Original pull request: #4277
1 parent c069e09 commit fe549f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+85
-57
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ChangeStreamEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public String toString() {
219219
}
220220

221221
@Override
222-
public boolean equals(Object o) {
222+
public boolean equals(@Nullable Object o) {
223223

224224
if (this == o)
225225
return true;

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ChangeStreamOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ private static <T> Object doGetTimestamp(Object timestamp, Class<T> targetType)
164164
}
165165

166166
@Override
167-
public boolean equals(Object o) {
167+
public boolean equals(@Nullable Object o) {
168168
if (this == o)
169169
return true;
170170
if (o == null || getClass() != o.getClass())

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultBulkOperations.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ public EntityCallbacks getEntityCallbacks() {
550550
}
551551

552552
@Override
553-
public boolean equals(Object o) {
553+
public boolean equals(@Nullable Object o) {
554554
if (this == o)
555555
return true;
556556
if (o == null || getClass() != o.getClass())
@@ -619,7 +619,7 @@ public WriteModel<Document> getModel() {
619619
}
620620

621621
@Override
622-
public boolean equals(Object o) {
622+
public boolean equals(@Nullable Object o) {
623623
if (this == o)
624624
return true;
625625
if (o == null || getClass() != o.getClass())

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoDatabaseFactorySupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public MongoDatabaseFactory getDelegate() {
225225
}
226226

227227
@Override
228-
public boolean equals(Object o) {
228+
public boolean equals(@Nullable Object o) {
229229
if (this == o)
230230
return true;
231231
if (o == null || getClass() != o.getClass())

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/SimpleReactiveMongoDatabaseFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public ReactiveMongoDatabaseFactory getDelegate() {
231231
}
232232

233233
@Override
234-
public boolean equals(Object o) {
234+
public boolean equals(@Nullable Object o) {
235235
if (this == o)
236236
return true;
237237
if (o == null || getClass() != o.getClass())

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ExposedFields.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public String toString() {
294294
}
295295

296296
@Override
297-
public boolean equals(Object obj) {
297+
public boolean equals(@Nullable Object obj) {
298298

299299
if (this == obj) {
300300
return true;
@@ -387,7 +387,7 @@ public String toString() {
387387
}
388388

389389
@Override
390-
public boolean equals(Object obj) {
390+
public boolean equals(@Nullable Object obj) {
391391

392392
if (this == obj) {
393393
return true;
@@ -454,7 +454,7 @@ public String toString() {
454454
}
455455

456456
@Override
457-
public boolean equals(Object obj) {
457+
public boolean equals(@Nullable Object obj) {
458458

459459
if (this == obj) {
460460
return true;

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/Fields.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ public String toString() {
302302
}
303303

304304
@Override
305-
public boolean equals(Object obj) {
305+
public boolean equals(@Nullable Object obj) {
306306

307307
if (this == obj) {
308308
return true;

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonGeometryCollection.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.util.Collections;
2020
import java.util.List;
2121

22+
import org.springframework.lang.Nullable;
2223
import org.springframework.util.Assert;
2324
import org.springframework.util.ObjectUtils;
2425

@@ -63,7 +64,7 @@ public int hashCode() {
6364
}
6465

6566
@Override
66-
public boolean equals(Object obj) {
67+
public boolean equals(@Nullable Object obj) {
6768

6869
if (this == obj) {
6970
return true;

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonMultiLineString.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.util.List;
2121

2222
import org.springframework.data.geo.Point;
23+
import org.springframework.lang.Nullable;
2324
import org.springframework.util.Assert;
2425
import org.springframework.util.ObjectUtils;
2526

@@ -78,7 +79,7 @@ public int hashCode() {
7879
}
7980

8081
@Override
81-
public boolean equals(Object obj) {
82+
public boolean equals(@Nullable Object obj) {
8283

8384
if (this == obj) {
8485
return true;

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/GeoJsonMultiPoint.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.List;
2222

2323
import org.springframework.data.geo.Point;
24+
import org.springframework.lang.Nullable;
2425
import org.springframework.util.Assert;
2526
import org.springframework.util.ObjectUtils;
2627

@@ -100,7 +101,7 @@ public int hashCode() {
100101
}
101102

102103
@Override
103-
public boolean equals(Object obj) {
104+
public boolean equals(@Nullable Object obj) {
104105

105106
if (this == obj) {
106107
return true;

0 commit comments

Comments
 (0)