Skip to content

Commit 25e2914

Browse files
cpovirkGoogle Java Core Libraries
authored andcommitted
Replace calls to Runnables.doNothing() with a do-nothing lambda, () -> {}.
`Runnables.doNothing()` exists only because Java lambdas didn't exist in 2013. `() -> {}` is shorter and more standard. PiperOrigin-RevId: 974801764
1 parent 0678c0c commit 25e2914

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

android/guava-tests/benchmark/com/google/common/util/concurrent/AbstractFutureFootprintBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void run() {
8383
blockedThreads.add(thread);
8484
}
8585
for (int i = 0; i < numListeners; i++) {
86-
f.addListener(Runnables.doNothing(), directExecutor());
86+
f.addListener(() -> {}, directExecutor());
8787
}
8888
for (Thread thread : blockedThreads) {
8989
AbstractFutureBenchmarks.awaitWaiting(thread);

guava-tests/benchmark/com/google/common/util/concurrent/AbstractFutureFootprintBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void run() {
8383
blockedThreads.add(thread);
8484
}
8585
for (int i = 0; i < numListeners; i++) {
86-
f.addListener(Runnables.doNothing(), directExecutor());
86+
f.addListener(() -> {}, directExecutor());
8787
}
8888
for (Thread thread : blockedThreads) {
8989
AbstractFutureBenchmarks.awaitWaiting(thread);

0 commit comments

Comments
 (0)