Java 11 migrate 7 remaining f (#1115)

* Moves facade to Java 11

* Moves factory-kit to Java 11

* Moves factory-method to Java 11

* Moves feature-toggle to Java 11

* Moves fluentinterface to Java 11

* Moves flux to Java 11

* Moves flyweight to Java 11

* Moves front-controller to Java 11

* Uses stream properly

* Resolves issues with ci
This commit is contained in:
Anurag Agarwal
2019-12-22 18:11:19 +05:30
committed by Ilkka Seppälä
parent f835d3d516
commit 670c4e43f3
55 changed files with 377 additions and 429 deletions

View File

@@ -30,12 +30,12 @@ package com.iluwatar.front.controller;
public class FrontController {
public void handleRequest(String request) {
Command command = getCommand(request);
var command = getCommand(request);
command.process();
}
private Command getCommand(String request) {
Class<?> commandClass = getCommandClass(request);
var commandClass = getCommandClass(request);
try {
return (Command) commandClass.newInstance();
} catch (Exception e) {
@@ -44,12 +44,10 @@ public class FrontController {
}
private static Class<?> getCommandClass(String request) {
Class<?> result;
try {
result = Class.forName("com.iluwatar.front.controller." + request + "Command");
return Class.forName("com.iluwatar.front.controller." + request + "Command");
} catch (ClassNotFoundException e) {
result = UnknownCommand.class;
return UnknownCommand.class;
}
return result;
}
}