Skip to content

Commit

Permalink
modify newInstance() from the type Class<> is deprecated since version 9
Browse files Browse the repository at this point in the history
  • Loading branch information
hckhead committed Aug 28, 2023
1 parent 3d012cd commit ac37564
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static Object instantiate(String className) throws ClassNotFoundException
Class<?> clazz;
try {
clazz = loadClass(className);
return clazz.newInstance();
return clazz.getDeclaredConstructor().newInstance();
} catch (ClassNotFoundException e) {
LOGGER.error("{} : Class is can not instantialized.", className);
throw new ClassNotFoundException();
Expand Down

0 comments on commit ac37564

Please sign in to comment.