Nymph2333
2023-04-10 af0e0a110e7187bf008655f7510199a0c0b25ec4
分支
用户 Nymph2333 <498092988@qq.com>
星期一, 四月 10, 2023 14:27 +0800
提交者 Gitee <noreply@gitee.com>
星期一, 四月 10, 2023 14:27 +0800
提交af0e0a110e7187bf008655f7510199a0c0b25ec4
目录 f7d23a49ebfa133500b92ac06fe23370c3a45da3 目录 | zip | gz
上一版本 a33090c90e71100a4337d274a5e58ea8e72e6d65 查看 | 对比
newInstance() 已弃用,使用clazz.getDeclaredConstructor().newInstance()
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: Nymph2333 <498092988@qq.com>
已修改1个文件
2 ■■■ 文件已修改
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java 2 ●●● 对比 | 查看 | 原始文档 | blame | 历史