Modernize for loop

This commit is contained in:
Tobi Schäfer 2024-05-25 15:08:17 +02:00
parent 26975a109a
commit 62630ae068
Signed by: tobi
GPG key ID: 91FAE6FE2EBAC4C8

View file

@ -102,12 +102,13 @@ public class JettyServer {
} }
private void openListeners() throws IOException { private void openListeners() throws IOException {
// opening the listener here allows us to run on priviledged port 80 under jsvc // opening the listener here allows us to run on privileged port 80 under jsvc
// even as non-root user, because init() is called with root privileges // even as non-root user, because init() is called with root privileges
// while start() will be called with the user we will actually run as // while start() will be called with the user we will actually run as
Connector[] connectors = http.getConnectors(); for (var connector : http.getConnectors()) {
for (int i = 0; i < connectors.length; i++) { if (connector instanceof ServerConnector) {
((ServerConnector) connectors[i]).open(); ((ServerConnector) connector).open();
}
} }
} }
} }