mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -173,7 +173,7 @@ public class BoundedTaskExecutorTest extends TestCase {
|
||||
Future[] futures = new Future[N];
|
||||
for (int i = 0; i < N; i++) {
|
||||
final int finalI = i;
|
||||
futures[i] = executor.submit(() -> log.append(finalI).append(" "));
|
||||
futures[i] = executor.submit(() -> log.append(finalI+" "));
|
||||
}
|
||||
for (int i = 0; i < N; i++) {
|
||||
expected.append(i).append(" ");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,6 +19,7 @@ import com.intellij.diagnostic.ThreadDumper;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import com.intellij.util.ReflectionUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -71,10 +72,10 @@ public class BoundedTaskExecutor extends AbstractExecutorService {
|
||||
// for diagnostics
|
||||
static Object info(Object task) {
|
||||
if (task instanceof FutureTask) {
|
||||
task = ReflectionUtil.getField(task.getClass(), task, Callable.class, "callable");
|
||||
task = ObjectUtils.chooseNotNull(ReflectionUtil.getField(task.getClass(), task, Callable.class, "callable"), task.getClass());
|
||||
}
|
||||
if (task instanceof Callable && task.getClass().getName().equals("java.util.concurrent.Executors$RunnableAdapter")) {
|
||||
task = ReflectionUtil.getField(task.getClass(), task, Runnable.class, "task");
|
||||
task = ObjectUtils.chooseNotNull(ReflectionUtil.getField(task.getClass(), task, Runnable.class, "task"), task.getClass());
|
||||
}
|
||||
return task;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user