Skip to content

Commit d76c843

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

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
@@ -199,7 +199,7 @@ public String toString() {
199199
}
200200

201201
@Override
202-
public boolean equals(Object o) {
202+
public boolean equals(@Nullable Object o) {
203203

204204
if (this == o)
205205
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
@@ -153,7 +153,7 @@ private static <T> Object doGetTimestamp(Object timestamp, Class<T> targetType)
153153
}
154154

155155
@Override
156-
public boolean equals(Object o) {
156+
public boolean equals(@Nullable Object o) {
157157
if (this == o)
158158
return true;
159159
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
@@ -598,7 +598,7 @@ public EntityCallbacks getEntityCallbacks() {
598598
}
599599

600600
@Override
601-
public boolean equals(Object o) {
601+
public boolean equals(@Nullable Object o) {
602602
if (this == o)
603603
return true;
604604
if (o == null || getClass() != o.getClass())
@@ -667,7 +667,7 @@ public WriteModel<Document> getModel() {
667667
}
668668

669669
@Override
670-
public boolean equals(Object o) {
670+
public boolean equals(@Nullable Object o) {
671671
if (this == o)
672672
return true;
673673
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
@@ -269,7 +269,7 @@ public MongoDatabaseFactory getDelegate() {
269269
}
270270

271271
@Override
272-
public boolean equals(Object o) {
272+
public boolean equals(@Nullable Object o) {
273273
if (this == o)
274274
return true;
275275
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
@@ -283,7 +283,7 @@ public ReactiveMongoDatabaseFactory getDelegate() {
283283
}
284284

285285
@Override
286-
public boolean equals(Object o) {
286+
public boolean equals(@Nullable Object o) {
287287
if (this == o)
288288
return true;
289289
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
@@ -318,7 +318,7 @@ public String toString() {
318318
* @see java.lang.Object#equals(java.lang.Object)
319319
*/
320320
@Override
321-
public boolean equals(Object obj) {
321+
public boolean equals(@Nullable Object obj) {
322322

323323
if (this == obj) {
324324
return true;
@@ -431,7 +431,7 @@ public String toString() {
431431
* @see java.lang.Object#equals(java.lang.Object)
432432
*/
433433
@Override
434-
public boolean equals(Object obj) {
434+
public boolean equals(@Nullable Object obj) {
435435

436436
if (this == obj) {
437437
return true;
@@ -510,7 +510,7 @@ public String toString() {
510510
}
511511

512512
@Override
513-
public boolean equals(Object obj) {
513+
public boolean equals(@Nullable Object obj) {
514514

515515
if (this == obj) {
516516
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
@@ -326,7 +326,7 @@ public String toString() {
326326
* @see java.lang.Object#equals(java.lang.Object)
327327
*/
328328
@Override
329-
public boolean equals(Object obj) {
329+
public boolean equals(@Nullable Object obj) {
330330

331331
if (this == obj) {
332332
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

@@ -79,7 +80,7 @@ public int hashCode() {
7980
* @see java.lang.Object#equals(java.lang.Object)
8081
*/
8182
@Override
82-
public boolean equals(Object obj) {
83+
public boolean equals(@Nullable Object obj) {
8384

8485
if (this == obj) {
8586
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

@@ -94,7 +95,7 @@ public int hashCode() {
9495
* @see java.lang.Object#equals(java.lang.Object)
9596
*/
9697
@Override
97-
public boolean equals(Object obj) {
98+
public boolean equals(@Nullable Object obj) {
9899

99100
if (this == obj) {
100101
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

@@ -116,7 +117,7 @@ public int hashCode() {
116117
* @see java.lang.Object#equals(java.lang.Object)
117118
*/
118119
@Override
119-
public boolean equals(Object obj) {
120+
public boolean equals(@Nullable Object obj) {
120121

121122
if (this == obj) {
122123
return true;

0 commit comments

Comments
 (0)