diff --git a/server/src/main/java/server/PortChecker.java b/server/src/main/java/server/PortChecker.java index 5a0a29a..c097237 100644 --- a/server/src/main/java/server/PortChecker.java +++ b/server/src/main/java/server/PortChecker.java @@ -4,11 +4,11 @@ import java.io.IOException; import java.net.ServerSocket; public class PortChecker { - private int defaultPort = 8080; - private int lastPort = 8090; // To limit the amount of ports to look for availability + private static final int defaultPort = 8080; + private static final int lastPort = 8090; // To limit the amount of ports to look for availability /** - * Finds a free port to launch the program on + * Finds a free port to launch the program on. * made with the help of https://medium.com/@rrlinus5/find-available-port-in-your-system-java-f532ee48c5b3 * @return the port that will be used to launch the program * @throws IOException when no available port is found @@ -23,7 +23,7 @@ public class PortChecker { } /** - * Checks whether a port is actually available + * Checks whether a port is actually available. * @param port the number of the port that's being checker * @return whether the port was available */ diff --git a/server/src/main/java/server/ServerPortCustomizer.java b/server/src/main/java/server/ServerPortCustomizer.java index ada203a..0994a8e 100644 --- a/server/src/main/java/server/ServerPortCustomizer.java +++ b/server/src/main/java/server/ServerPortCustomizer.java @@ -8,7 +8,7 @@ import org.springframework.stereotype.Component; @Component public class ServerPortCustomizer implements WebServerFactoryCustomizer{ /** - * Changes the port that will be used to launch the program + * Changes the port that will be used to launch the program. * made with the help of: https://www.baeldung.com/spring-boot-change-port * @param factory */