mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-30 04:45:20 +07:00
GitOrigin-RevId: 225c1c524a555a59b33a210df66ff4c8ae233369
27 lines
875 B
Java
27 lines
875 B
Java
import com.intellij.openapi.vfs.VirtualFile;
|
|
import com.example.CustomVirtualFile;
|
|
|
|
class UnsafeVfsRecursion {
|
|
|
|
void processDirectoryRecursive(VirtualFile dir) {
|
|
for (VirtualFile file : <warning descr="'VirtualFile.getChildren()' called from a recursive method">dir.getChildren()</warning>) {
|
|
if (!file.isDirectory()) {
|
|
// process file
|
|
} else {
|
|
processDirectoryRecursive(file); // recursive call
|
|
}
|
|
}
|
|
}
|
|
|
|
void processDirectoryRecursiveSubclassUsed(CustomVirtualFile dir) {
|
|
for (VirtualFile file : <warning descr="'VirtualFile.getChildren()' called from a recursive method">dir.getChildren()</warning>) {
|
|
if (!file.isDirectory()) {
|
|
// process file
|
|
} else if (dir instanceof CustomVirtualFile) {
|
|
processDirectoryRecursiveSubclassUsed((CustomVirtualFile)file); // recursive call
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|