mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-12 16:15:23 +00:00
Adjust checkstyle rules. Make checkstyle fail the build when violations are found. Correct all current checkstyle violations.
This commit is contained in:
1 parent
9fbb085985
commit
cec9a99410
167 files changed
+1242
-969
No files matched your search
@@ -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