Runnable: replace anonymous class with lambda
In Java 8 Runnable is functional interface and can be replaced with lambda expressions or method references. Change-Id: I2896b39c27b2e5a91a60149155a8c00a8eb48e39
This commit is contained in:
committed by
Shawn Pearce
parent
8f0528f3b5
commit
8785d73fa5
@@ -133,17 +133,14 @@ public class GerritServer {
|
||||
static GerritServer start(Description desc, Config baseConfig) throws Exception {
|
||||
Config cfg = desc.buildConfig(baseConfig);
|
||||
Logger.getLogger("com.google.gerrit").setLevel(Level.DEBUG);
|
||||
final CyclicBarrier serverStarted = new CyclicBarrier(2);
|
||||
final Daemon daemon =
|
||||
CyclicBarrier serverStarted = new CyclicBarrier(2);
|
||||
Daemon daemon =
|
||||
new Daemon(
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
serverStarted.await();
|
||||
} catch (InterruptedException | BrokenBarrierException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
() -> {
|
||||
try {
|
||||
serverStarted.await();
|
||||
} catch (InterruptedException | BrokenBarrierException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
},
|
||||
Paths.get(baseConfig.getString("gerrit", null, "tempSiteDir")));
|
||||
|
||||
Reference in New Issue
Block a user