Skip to content

Commit 66d44b1

Browse files
christophstroblmp911de
authored andcommitted
Add Nullable annotation to parameter of overridden equals method.
Closes: #2450 Original pull request: #2451
1 parent 3cd6182 commit 66d44b1

Some content is hidden

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

50 files changed

+332
-55
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[[observability-conventions]]
2+
=== Observability - Conventions
3+
4+
Below you can find a list of all `GlobalObservabilityConventions` and `ObservabilityConventions` declared by this project.
5+
6+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[[observability-metrics]]
2+
=== Observability - Metrics
3+
4+
Below you can find a list of all metrics declared by this project.
5+
6+
[[observability-metrics-redis-command-observation]]
7+
==== Redis Command Observation
8+
9+
____
10+
Timer created around a Redis command execution.
11+
____
12+
13+
**Metric name** `spring.data.redis`. **Type** `timer` and **base unit** `seconds`.
14+
15+
Fully qualified name of the enclosing class `org.springframework.data.redis.connection.lettuce.observability.RedisObservation`.
16+
17+
18+
19+
.Low cardinality Keys
20+
[cols="a,a"]
21+
|===
22+
|Name | Description
23+
|`db.operation`|Redis command value.
24+
|`db.redis.database_index`|Redis database index.
25+
|`db.system`|Database system.
26+
|`db.user`|Redis user.
27+
|`net.peer.name`|Name of the database host.
28+
|`net.peer.port`|Logical remote port number.
29+
|`net.sock.peer.addr`|Mongo peer address.
30+
|`net.sock.peer.port`|Mongo peer port.
31+
|`net.transport`|Network transport.
32+
|===
33+
34+
.High cardinality Keys
35+
[cols="a,a"]
36+
|===
37+
|Name | Description
38+
|`db.statement`|Redis statement.
39+
|`spring.data.redis.command.error`|Redis error response.
40+
|===
41+
42+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[[observability-spans]]
2+
=== Observability - Spans
3+
4+
Below you can find a list of all spans declared by this project.
5+
6+
[[observability-spans-redis-command-observation]]
7+
==== Redis Command Observation Span
8+
9+
> Timer created around a Redis command execution.
10+
11+
**Span name** `spring.data.redis`.
12+
13+
Fully qualified name of the enclosing class `org.springframework.data.redis.connection.lettuce.observability.RedisObservation`.
14+
15+
16+
17+
.Tag Keys
18+
|===
19+
|Name | Description
20+
|`db.operation`|Redis command value.
21+
|`db.redis.database_index`|Redis database index.
22+
|`db.statement`|Redis statement.
23+
|`db.system`|Database system.
24+
|`db.user`|Redis user.
25+
|`net.peer.name`|Name of the database host.
26+
|`net.peer.port`|Logical remote port number.
27+
|`net.sock.peer.addr`|Mongo peer address.
28+
|`net.sock.peer.port`|Mongo peer port.
29+
|`net.transport`|Network transport.
30+
|`spring.data.redis.command.error`|Redis error response.
31+
|===
32+
33+
34+
35+

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
/**
@@ -184,7 +185,7 @@ public Instant getLastReset() {
184185
* @see java.lang.Object#equals(java.lang.Object)
185186
*/
186187
@Override
187-
public boolean equals(Object o) {
188+
public boolean equals(@Nullable Object o) {
188189

189190
if (this == o) {
190191
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
@@ -155,7 +155,7 @@ public Iterator<BitFieldSubCommand> iterator() {
155155
* @see java.lang.Object#equals(java.lang.Object)
156156
*/
157157
@Override
158-
public boolean equals(Object o) {
158+
public boolean equals(@Nullable Object o) {
159159
if (this == o) {
160160
return true;
161161
}
@@ -456,7 +456,7 @@ public String toString() {
456456
* @see java.lang.Object#equals(java.lang.Object)
457457
*/
458458
@Override
459-
public boolean equals(Object o) {
459+
public boolean equals(@Nullable Object o) {
460460

461461
if (this == o) {
462462
return true;
@@ -576,7 +576,7 @@ public String asString() {
576576
* @see java.lang.Object#equals(java.lang.Object)
577577
*/
578578
@Override
579-
public boolean equals(Object o) {
579+
public boolean equals(@Nullable Object o) {
580580

581581
if (this == o) {
582582
return true;
@@ -644,7 +644,7 @@ public Offset getOffset() {
644644
* @see java.lang.Object#equals(java.lang.Object)
645645
*/
646646
@Override
647-
public boolean equals(Object o) {
647+
public boolean equals(@Nullable Object o) {
648648

649649
if (this == o) {
650650
return true;
@@ -744,7 +744,7 @@ public long getValue() {
744744
* @see java.lang.Object#equals(java.lang.Object)
745745
*/
746746
@Override
747-
public boolean equals(Object o) {
747+
public boolean equals(@Nullable Object o) {
748748
if (this == o) {
749749
return true;
750750
}
@@ -915,7 +915,7 @@ public enum Overflow {
915915
* @see java.lang.Object#equals(java.lang.Object)
916916
*/
917917
@Override
918-
public boolean equals(Object o) {
918+
public boolean equals(@Nullable Object o) {
919919

920920
if (this == o) {
921921
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
@@ -682,7 +682,7 @@ public int getPosition() {
682682
}
683683

684684
@Override
685-
public boolean equals(Object o) {
685+
public boolean equals(@Nullable Object o) {
686686
if (this == o)
687687
return true;
688688
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
@@ -19,6 +19,7 @@
1919

2020
import org.springframework.data.redis.connection.RedisZSetCommands.Tuple;
2121
import org.springframework.data.redis.connection.StringRedisConnection.StringTuple;
22+
import org.springframework.lang.Nullable;
2223
import org.springframework.util.ObjectUtils;
2324

2425
/**
@@ -77,7 +78,7 @@ public String toString() {
7778
}
7879

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

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

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

2020
import org.springframework.data.redis.connection.RedisZSetCommands.Tuple;
2121

22+
import org.springframework.lang.Nullable;
23+
2224
/**
2325
* Default implementation for {@link Tuple} interface.
2426
*
@@ -58,7 +60,7 @@ public byte[] getValue() {
5860
return value;
5961
}
6062

61-
public boolean equals(Object obj) {
63+
public boolean equals(@Nullable Object obj) {
6264
if (this == obj)
6365
return true;
6466
if (obj == null)

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

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

376376
@Override
377-
public boolean equals(Object o) {
377+
public boolean equals(@Nullable Object o) {
378378
if (this == o)
379379
return true;
380380
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

@@ -194,7 +195,7 @@ public M getMessage() {
194195
}
195196

196197
@Override
197-
public boolean equals(Object o) {
198+
public boolean equals(@Nullable Object o) {
198199
if (this == o)
199200
return true;
200201
if (o == null || getClass() != o.getClass())
@@ -260,7 +261,7 @@ public P getPattern() {
260261
}
261262

262263
@Override
263-
public boolean equals(Object o) {
264+
public boolean equals(@Nullable Object o) {
264265
if (this == o)
265266
return true;
266267
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
@@ -227,7 +227,7 @@ public void setPassword(RedisPassword password) {
227227
* @see java.lang.Object#equals(java.lang.Object)
228228
*/
229229
@Override
230-
public boolean equals(Object o) {
230+
public boolean equals(@Nullable Object o) {
231231
if (this == o) {
232232
return true;
233233
}

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

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

279279
@Override
280-
public boolean equals(Object obj) {
280+
public boolean equals(@Nullable Object obj) {
281281

282282
if (this == obj) {
283283
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
@@ -148,7 +148,7 @@ public String toString() {
148148
}
149149

150150
@Override
151-
public boolean equals(Object o) {
151+
public boolean equals(@Nullable Object o) {
152152

153153
if (this == o)
154154
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
@@ -320,7 +320,7 @@ public RedisPassword getSentinelPassword() {
320320
* @see java.lang.Object#equals(java.lang.Object)
321321
*/
322322
@Override
323-
public boolean equals(Object o) {
323+
public boolean equals(@Nullable Object o) {
324324
if (this == o) {
325325
return true;
326326
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public void setPassword(RedisPassword password) {
140140
* @see java.lang.Object#equals(java.lang.Object)
141141
*/
142142
@Override
143-
public boolean equals(Object o) {
143+
public boolean equals(@Nullable Object o) {
144144
if (this == o) {
145145
return true;
146146
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public void setPassword(RedisPassword password) {
173173
* @see java.lang.Object#equals(java.lang.Object)
174174
*/
175175
@Override
176-
public boolean equals(Object o) {
176+
public boolean equals(@Nullable Object o) {
177177
if (this == o) {
178178
return true;
179179
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public List<RedisStandaloneConfiguration> getNodes() {
188188
* @see java.lang.Object#equals(java.lang.Object)
189189
*/
190190
@Override
191-
public boolean equals(Object o) {
191+
public boolean equals(@Nullable Object o) {
192192
if (this == o) {
193193
return true;
194194
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public boolean hasMinId() {
243243
}
244244

245245
@Override
246-
public boolean equals(Object o) {
246+
public boolean equals(@Nullable Object o) {
247247
if (this == o) {
248248
return true;
249249
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ public boolean isEmpty() {
508508
}
509509

510510
@Override
511-
public boolean equals(Object o) {
511+
public boolean equals(@Nullable Object o) {
512512

513513
if (this == o) {
514514
return true;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package org.springframework.data.redis.connection;
1717

1818
import org.springframework.lang.NonNull;
19+
import org.springframework.lang.Nullable;
1920
import org.springframework.util.Assert;
2021
import org.springframework.util.ObjectUtils;
2122

@@ -58,7 +59,7 @@ public String toString() {
5859
* @see java.lang.Object#equals(java.lang.Object)
5960
*/
6061
@Override
61-
public boolean equals(Object o) {
62+
public boolean equals(@Nullable Object o) {
6263
if (this == o) {
6364
return true;
6465
}

src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,7 @@ public String name() {
16151615
}
16161616

16171617
@Override
1618-
public boolean equals(Object o) {
1618+
public boolean equals(@Nullable Object o) {
16191619

16201620
if (this == o) {
16211621
return true;

src/main/java/org/springframework/data/redis/connection/stream/Consumer.java

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

18+
import org.springframework.lang.Nullable;
1819
import org.springframework.util.Assert;
1920
import org.springframework.util.ObjectUtils;
2021

@@ -64,7 +65,7 @@ public String getName() {
6465
}
6566

6667
@Override
67-
public boolean equals(Object o) {
68+
public boolean equals(@Nullable Object o) {
6869
if (this == o)
6970
return true;
7071
if (o == null || getClass() != o.getClass())

src/main/java/org/springframework/data/redis/connection/stream/ReadOffset.java

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

18+
import org.springframework.lang.Nullable;
1819
import org.springframework.util.Assert;
1920
import org.springframework.util.ObjectUtils;
2021

@@ -81,7 +82,7 @@ public String getOffset() {
8182
}
8283

8384
@Override
84-
public boolean equals(Object o) {
85+
public boolean equals(@Nullable Object o) {
8586

8687
if (this == o)
8788
return true;

src/main/java/org/springframework/data/redis/connection/stream/RecordId.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private Long value(int index) {
154154
}
155155

156156
@Override
157-
public boolean equals(Object o) {
157+
public boolean equals(@Nullable Object o) {
158158
if (this == o)
159159
return true;
160160
if (o == null || getClass() != o.getClass())

0 commit comments

Comments
 (0)