Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
maobaolong committed Aug 20, 2024
1 parent 8729ec5 commit 5d57bb1
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import com.google.common.annotations.VisibleForTesting;

/**
* Registry for reserving ports during tests.
*
Expand All @@ -45,7 +43,7 @@
public final class PortRegistry {
private static final String PORT_COORDINATION_DIR_PROPERTY = "UNIFFLE_PORT_COORDINATION_DIR";

@VisibleForTesting static final Registry INSTANCE = new Registry();
private static final Registry INSTANCE = new Registry();

private PortRegistry() {} // Class should not be instantiated.

Expand Down Expand Up @@ -84,13 +82,12 @@ public static int getFreePort() {
return port;
}

@VisibleForTesting
static class Registry {
private static class Registry {
// Map from port number to the reservation for that port.
private final Map<Integer, Reservation> reserved = new ConcurrentHashMap<>();
private final File coordinationDir;

public Registry() {
private Registry() {
String dir = System.getenv(PORT_COORDINATION_DIR_PROPERTY);
if (dir == null) {
dir = System.getProperty("user.dir");
Expand Down

0 comments on commit 5d57bb1

Please sign in to comment.