Skip to content

Commit 92af606

Browse files
committed
Polishing #2773
Reformat code. Resolve warnings. Original pull request: #2774
1 parent fa3938c commit 92af606

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/java/io/lettuce/core/protocol/CommandExpiryWriter.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.util.Collection;
2222
import java.util.concurrent.CompletableFuture;
2323
import java.util.concurrent.ScheduledExecutorService;
24-
import java.util.concurrent.ScheduledFuture;
2524
import java.util.concurrent.TimeUnit;
2625

2726
import io.lettuce.core.ClientOptions;
@@ -166,15 +165,14 @@ private ScheduledExecutorService getExecutorService() {
166165
return this.executorService;
167166
}
168167

169-
@SuppressWarnings("unchecked")
170168
private void potentiallyExpire(RedisCommand<?, ?, ?> command, ScheduledExecutorService executors) {
171169

172170
long timeout = applyConnectionTimeout ? this.timeout : source.getTimeout(command);
173171

174172
if (timeout <= 0) {
175173
return;
176174
}
177-
175+
178176
Timeout commandTimeout = timer.newTimeout(t -> {
179177
if (!command.isDone()) {
180178
executors.submit(() -> command.completeExceptionally(
@@ -184,7 +182,7 @@ private void potentiallyExpire(RedisCommand<?, ?, ?> command, ScheduledExecutorS
184182
}, timeout, timeUnit);
185183

186184
if (command instanceof CompleteableCommand) {
187-
((CompleteableCommand) command).onComplete((o, o2) -> commandTimeout.cancel());
185+
((CompleteableCommand<?>) command).onComplete((o, o2) -> commandTimeout.cancel());
188186
}
189187

190188
}

0 commit comments

Comments
 (0)