Skip to content

Commit c16b863

Browse files
committed
Polishing.
Add missing Nullable annotations. Reorder methods. See: #2996 Original pull request: #2997
1 parent 5d7adf0 commit c16b863

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/main/java/org/springframework/data/redis/core/BoundListOperations.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ public interface BoundListOperations<K, V> extends BoundKeyOperations<K> {
231231
* @since 2.4
232232
* @see <a href="https://redis.io/commands/lpos">Redis Documentation: LPOS</a>
233233
*/
234+
@Nullable
234235
Long indexOf(V value);
235236

236237
/**
@@ -242,6 +243,7 @@ public interface BoundListOperations<K, V> extends BoundKeyOperations<K> {
242243
* @since 2.4
243244
* @see <a href="https://redis.io/commands/lpos">Redis Documentation: LPOS</a>
244245
*/
246+
@Nullable
245247
Long lastIndexOf(V value);
246248

247249
/**

src/main/java/org/springframework/data/redis/support/collections/AbstractRedisCollection.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,6 @@ public void rename(final String newKey) {
131131
key = newKey;
132132
}
133133

134-
protected void checkResult(@Nullable Object obj) {
135-
136-
if (obj == null) {
137-
throw new IllegalStateException("Cannot read collection with Redis connection in pipeline/multi-exec mode");
138-
}
139-
}
140-
141134
@Override
142135
public boolean equals(@Nullable Object o) {
143136

@@ -175,4 +168,10 @@ public String toString() {
175168
return sb.toString();
176169
}
177170

171+
protected void checkResult(@Nullable Object obj) {
172+
173+
if (obj == null) {
174+
throw new IllegalStateException("Cannot read collection with Redis connection in pipeline/multi-exec mode");
175+
}
176+
}
178177
}

src/main/java/org/springframework/data/redis/support/collections/DefaultRedisMap.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ public int hashCode() {
187187

188188
@Override
189189
public String toString() {
190-
191190
return "RedisStore for key:" + getKey();
192191
}
193192

@@ -317,17 +316,17 @@ public DataType getType() {
317316
return hashOps.getType();
318317
}
319318

319+
@Override
320+
public Cursor<java.util.Map.Entry<K, V>> scan() {
321+
return scan(ScanOptions.NONE);
322+
}
323+
320324
private void checkResult(@Nullable Object obj) {
321325
if (obj == null) {
322326
throw new IllegalStateException("Cannot read collection with Redis connection in pipeline/multi-exec mode");
323327
}
324328
}
325329

326-
@Override
327-
public Cursor<java.util.Map.Entry<K, V>> scan() {
328-
return scan(ScanOptions.NONE);
329-
}
330-
331330
/**
332331
* @since 1.4
333332
* @param options

0 commit comments

Comments
 (0)