Adjust checkstyle rules. Make checkstyle fail the build when violations are found. Correct all current checkstyle violations.
This commit is contained in:
@ -24,6 +24,9 @@ public class LoadBalancer {
|
||||
servers.add(new Server("localhost", 8084, ++id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add new server
|
||||
*/
|
||||
public final void addServer(Server server) {
|
||||
synchronized (servers) {
|
||||
servers.add(server);
|
||||
@ -39,6 +42,9 @@ public class LoadBalancer {
|
||||
return lastServedId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle request
|
||||
*/
|
||||
public void serverequest(Request request) {
|
||||
if (lastServedId >= servers.size()) {
|
||||
lastServedId = 0;
|
||||
|
@ -11,6 +11,9 @@ public class Server {
|
||||
public final int port;
|
||||
public final int id;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public Server(String host, int port, int id) {
|
||||
this.host = host;
|
||||
this.port = port;
|
||||
|
Reference in New Issue
Block a user