mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-11-07 22:57:20 +08:00
style: 适配 Java 16 新特性
1.instanceof 模式匹配(Java 14 预览特性 => Java 16 标准特性) 详情请参阅:https://docs.oracle.com/en/java/javase/16/language/pattern-matching-instanceof-operator.html
This commit is contained in:
@@ -44,9 +44,8 @@ public class ExceptionUtils {
|
||||
* 异常
|
||||
*/
|
||||
public static void printException(Runnable runnable, Throwable throwable) {
|
||||
if (throwable == null && runnable instanceof Future<?>) {
|
||||
if (throwable == null && runnable instanceof Future<?> future) {
|
||||
try {
|
||||
Future<?> future = (Future<?>)runnable;
|
||||
if (future.isDone()) {
|
||||
future.get();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user