refactor: Remove deprecated method of newInstance (#2594)

This commit is contained in:
kongleong86
2023-10-14 11:58:15 +01:00
committed by GitHub
parent 38d28870f2
commit 1bea90ed9c
2 changed files with 4 additions and 3 deletions
@@ -38,7 +38,7 @@ public class FrontController {
private Command getCommand(String request) {
var commandClass = getCommandClass(request);
try {
return (Command) commandClass.newInstance();
return (Command) commandClass.getDeclaredConstructor().newInstance();
} catch (Exception e) {
throw new ApplicationException(e);
}