}
@Nullable
protected ModuleImpl loadAllModulesUnder(VirtualFile rootDir) throws Exception {
ModuleImpl module = null;
final VirtualFile[] children = rootDir.getChildren();
for (VirtualFile child : children) {
if (child.isDirectory()) {
final ModuleImpl childModule = loadAllModulesUnder(child);
if (module == null) module = childModule;
}
else if (child.getName().endsWith(".iml")) {
String modulePath = child.getPath();
module = (ModuleImpl)loadModule(new File(modulePath));