Files
Karol Lewandowskiandintellij-monorepo-bot bf33f56ded IDEA-330739: Devkit: extend "Cancellation check in loops" inspection
- Added support for forEach() and similar methods, and ContainerUtil.process()

GitOrigin-RevId: fc9b66f3584cf94d603d9a84825f4142de92544d
2024-02-08 19:53:11 +00:00

16 lines
449 B
Java

package inspections.cancellationCheckInLoops;
import com.intellij.util.concurrency.annotations.RequiresReadLock;
import java.util.List;
class Clazz {
@RequiresReadLock
public static void foo(List<String> iterable) {
iterable.<warning descr="Cancellation check 'com.intellij.openapi.progress.ProgressManager.checkCanceled' should be the first statement in a loop body">for<caret>Each</warning>(e -> {
// empty block
});
}
}