Skip to content

Commit

Permalink
Merge pull request #126 from egovframe-contribution/modify_ObjectUtil
Browse files Browse the repository at this point in the history
modify newInstance() from the type Class<> is deprecated since version 9
  • Loading branch information
jei007 authored Nov 3, 2023
2 parents 6fd1286 + ac37564 commit 96ce4ba
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,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 96ce4ba

Please sign in to comment.