mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-14 12:58:37 +00:00
refactor: Remove deprecated method of newInstance (#2594)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user