mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-30 14:30:49 +07:00
- Added support for forEach() and similar methods, and ContainerUtil.process() GitOrigin-RevId: fc9b66f3584cf94d603d9a84825f4142de92544d
27 lines
682 B
Java
27 lines
682 B
Java
package inspections.cancellationCheckInLoops;
|
|
|
|
import com.intellij.openapi.progress.ProgressManager;
|
|
import com.intellij.util.concurrency.annotations.RequiresReadLock;
|
|
import com.intellij.util.containers.ContainerUtil;
|
|
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.stream.Stream;
|
|
|
|
import static inspections.cancellationCheckInLoops.Foo.doSomething;
|
|
|
|
class Clazz {
|
|
|
|
@RequiresReadLock
|
|
public static void foo(Iterable<String> iterable, List<String> list) {
|
|
ContainerUtil.process(list, a -> {
|
|
iterable.forEach(b -> {
|
|
ProgressManager.checkCanceled();
|
|
doSomething();
|
|
});
|
|
return true;
|
|
});
|
|
}
|
|
}
|