Skip to content

Commit e5a1011

Browse files
christophstroblmp911de
authored andcommitted
Add Nullable annotation to parameter of overridden equals method.
Closes: #2450 Original pull request: #2451
1 parent 505009b commit e5a1011

Some content is hidden

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

47 files changed

+85
-56
lines changed

src/main/java/org/springframework/data/redis/cache/NoOpCacheStatisticsCollector.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.time.Instant;
1919
import java.util.concurrent.TimeUnit;
2020

21+
import org.springframework.lang.Nullable;
2122
import org.springframework.util.ObjectUtils;
2223

2324
/**
@@ -112,7 +113,7 @@ public Instant getLastReset() {
112113
}
113114

114115
@Override
115-
public boolean equals(Object o) {
116+
public boolean equals(@Nullable Object o) {
116117

117118
if (this == o) {
118119
return true;

src/main/java/org/springframework/data/redis/connection/BitFieldSubCommands.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public Iterator<BitFieldSubCommand> iterator() {
147147
}
148148

149149
@Override
150-
public boolean equals(Object o) {
150+
public boolean equals(@Nullable Object o) {
151151
if (this == o) {
152152
return true;
153153
}
@@ -432,7 +432,7 @@ public String toString() {
432432
}
433433

434434
@Override
435-
public boolean equals(Object o) {
435+
public boolean equals(@Nullable Object o) {
436436

437437
if (this == o) {
438438
return true;
@@ -544,7 +544,7 @@ public String asString() {
544544
}
545545

546546
@Override
547-
public boolean equals(Object o) {
547+
public boolean equals(@Nullable Object o) {
548548

549549
if (this == o) {
550550
return true;
@@ -592,7 +592,7 @@ public Offset getOffset() {
592592
}
593593

594594
@Override
595-
public boolean equals(Object o) {
595+
public boolean equals(@Nullable Object o) {
596596

597597
if (this == o) {
598598
return true;
@@ -676,7 +676,7 @@ public long getValue() {
676676
}
677677

678678
@Override
679-
public boolean equals(Object o) {
679+
public boolean equals(@Nullable Object o) {
680680
if (this == o) {
681681
return true;
682682
}
@@ -827,7 +827,7 @@ public enum Overflow {
827827
}
828828

829829
@Override
830-
public boolean equals(Object o) {
830+
public boolean equals(@Nullable Object o) {
831831

832832
if (this == o) {
833833
return true;

src/main/java/org/springframework/data/redis/connection/ClusterCommandExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ public int getPosition() {
678678
}
679679

680680
@Override
681-
public boolean equals(Object o) {
681+
public boolean equals(@Nullable Object o) {
682682
if (this == o)
683683
return true;
684684
if (o == null || getClass() != o.getClass())

src/main/java/org/springframework/data/redis/connection/DefaultStringTuple.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.springframework.data.redis.connection.StringRedisConnection.StringTuple;
2121
import org.springframework.data.redis.connection.zset.DefaultTuple;
2222
import org.springframework.data.redis.connection.zset.Tuple;
23+
import org.springframework.lang.Nullable;
2324
import org.springframework.util.ObjectUtils;
2425

2526
/**
@@ -78,7 +79,7 @@ public String toString() {
7879
}
7980

8081
@Override
81-
public boolean equals(Object o) {
82+
public boolean equals(@Nullable Object o) {
8283
if (this == o)
8384
return true;
8485
if (o == null || getClass() != o.getClass())

src/main/java/org/springframework/data/redis/connection/ReactiveRedisConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ public O getOutput() {
366366
}
367367

368368
@Override
369-
public boolean equals(Object o) {
369+
public boolean equals(@Nullable Object o) {
370370
if (this == o)
371371
return true;
372372
if (o == null || getClass() != o.getClass())

src/main/java/org/springframework/data/redis/connection/ReactiveSubscription.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package org.springframework.data.redis.connection;
1717

18+
import org.springframework.lang.Nullable;
1819
import reactor.core.publisher.Flux;
1920
import reactor.core.publisher.Mono;
2021

@@ -186,7 +187,7 @@ public M getMessage() {
186187
}
187188

188189
@Override
189-
public boolean equals(Object o) {
190+
public boolean equals(@Nullable Object o) {
190191
if (this == o)
191192
return true;
192193
if (o == null || getClass() != o.getClass())
@@ -252,7 +253,7 @@ public P getPattern() {
252253
}
253254

254255
@Override
255-
public boolean equals(Object o) {
256+
public boolean equals(@Nullable Object o) {
256257
if (this == o)
257258
return true;
258259
if (o == null || getClass() != o.getClass())

src/main/java/org/springframework/data/redis/connection/RedisClusterConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public void setPassword(RedisPassword password) {
199199
}
200200

201201
@Override
202-
public boolean equals(Object o) {
202+
public boolean equals(@Nullable Object o) {
203203
if (this == o) {
204204
return true;
205205
}

src/main/java/org/springframework/data/redis/connection/RedisNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public int hashCode() {
269269
}
270270

271271
@Override
272-
public boolean equals(Object obj) {
272+
public boolean equals(@Nullable Object obj) {
273273

274274
if (this == obj) {
275275
return true;

src/main/java/org/springframework/data/redis/connection/RedisPassword.java

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

146146
@Override
147-
public boolean equals(Object o) {
147+
public boolean equals(@Nullable Object o) {
148148

149149
if (this == o)
150150
return true;

src/main/java/org/springframework/data/redis/connection/RedisSentinelConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ public RedisPassword getSentinelPassword() {
265265
}
266266

267267
@Override
268-
public boolean equals(Object o) {
268+
public boolean equals(@Nullable Object o) {
269269
if (this == o) {
270270
return true;
271271
}

0 commit comments

Comments
 (0)