• Nymph2333's avatar
    newInstance() 已弃用,使用clazz.getDeclaredConstructor().newInstance() · af0e0a11
    Nymph2333 authored
    This method propagates any exception thrown by the nullary constructor, including a checked exception. Use of this method effectively bypasses the compile-time exception checking that would otherwise be performed by the compiler. The Constructor.newInstance method avoids this problem by wrapping any exception thrown by the constructor in a (checked) InvocationTargetException.
    The call
     clazz.newInstance()
    can be replaced by
     clazz.getDeclaredConstructor().newInstance()
    The latter sequence of calls is inferred to be able to throw the additional exception types InvocationTargetException and NoSuchMethodException. Both of these exception types are subclasses of ReflectiveOperationException.
    Signed-off-by: 's avatarNymph2333 <498092988@qq.com>
    af0e0a11
Name
Last commit
Last update
.github Loading commit data...
bin Loading commit data...
doc Loading commit data...
ruoyi-admin Loading commit data...
ruoyi-common Loading commit data...
ruoyi-framework Loading commit data...
ruoyi-generator Loading commit data...
ruoyi-quartz Loading commit data...
ruoyi-system Loading commit data...
ruoyi-ui Loading commit data...
sql Loading commit data...
.gitignore Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
pom.xml Loading commit data...
ry.bat Loading commit data...
ry.sh Loading commit data...