Skip to content

Commit

Permalink
Fixes issue #2675 - Fix code smells (#2676)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem authored Aug 10, 2022
1 parent b1876ff commit 6d6fd5e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import java.io.IOException;
import java.lang.System.Logger.Level;
import static java.lang.System.Logger.Level.DEBUG;
import java.net.Socket;
import java.util.concurrent.TimeUnit;
import java.util.function.BooleanSupplier;
Expand All @@ -46,9 +47,7 @@ public class PiranhaStartup {
* @param port
*/
public static void waitUntilPiranhaReady(Process process, int port) {
waitUntilPiranhaReady(port, () -> {
return process.isAlive();
});
waitUntilPiranhaReady(port, process::isAlive);
}

/**
Expand Down Expand Up @@ -77,7 +76,8 @@ private static void waitUntilPiranhaReady(int port, BooleanSupplier customCheck)
pingPiranha("localhost", port);
started = true;
} catch (IOException ex) {
System.getLogger(PiranhaStartup.class.getName()).log(Level.DEBUG, "Not ready yet: {0}({1}", new Object[]{ex.getMessage(), ex.getClass()});
System.getLogger(PiranhaStartup.class.getName()).log(
DEBUG, "Not ready yet: {0}{1}", ex.getMessage(), ex.getClass());
} catch (InterruptedException ex) {
System.getLogger(PiranhaStartup.class.getName()).log(Level.WARNING, ex.getMessage(), ex);
Thread.currentThread().interrupt();
Expand Down

0 comments on commit 6d6fd5e

Please sign in to comment.