Adjust checkstyle rules. Make checkstyle fail the build when violations are found. Correct all current checkstyle violations.

This commit is contained in:
Ilkka Seppala
2015-12-25 23:49:28 +02:00
parent 9fbb085985
commit cec9a99410
167 changed files with 1242 additions and 969 deletions

View File

@@ -2,33 +2,33 @@ package com.iluwatar.front.controller;
/**
*
* FrontController is the handler class that takes in all the requests and
* renders the correct response.
* FrontController is the handler class that takes in all the requests and renders the correct
* response.
*
*/
public class FrontController {
public void handleRequest(String request) {
Command command = getCommand(request);
command.process();
}
private Command getCommand(String request) {
Class commandClass = getCommandClass(request);
try {
return (Command) commandClass.newInstance();
} catch (Exception e) {
throw new ApplicationException(e);
}
}
private Class getCommandClass(String request) {
Class result;
try {
result = Class.forName("com.iluwatar.front.controller." + request + "Command");
} catch (ClassNotFoundException e) {
result = UnknownCommand.class;
}
return result;
}
public void handleRequest(String request) {
Command command = getCommand(request);
command.process();
}
private Command getCommand(String request) {
Class commandClass = getCommandClass(request);
try {
return (Command) commandClass.newInstance();
} catch (Exception e) {
throw new ApplicationException(e);
}
}
private Class getCommandClass(String request) {
Class result;
try {
result = Class.forName("com.iluwatar.front.controller." + request + "Command");
} catch (ClassNotFoundException e) {
result = UnknownCommand.class;
}
return result;
}
}