mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-56301 - assert: ProjectViewModuleNode.getChildren
This commit is contained in:
+7
-7
@@ -57,22 +57,22 @@ public class ProjectViewModuleNode extends AbstractModuleNode {
|
||||
|
||||
final VirtualFile[] contentRoots = rootManager.getContentRoots();
|
||||
final List<AbstractTreeNode> children = new ArrayList<AbstractTreeNode>(contentRoots.length + 1);
|
||||
final PsiManager psiManager = PsiManager.getInstance(getProject());
|
||||
final PsiManager psiManager = PsiManager.getInstance(module.getProject());
|
||||
for (final VirtualFile contentRoot : contentRoots) {
|
||||
if (!moduleFileIndex.isInContent(contentRoot)) continue;
|
||||
|
||||
AbstractTreeNode child;
|
||||
if (contentRoot.isDirectory()) {
|
||||
PsiDirectory directory = psiManager.findDirectory(contentRoot);
|
||||
LOG.assertTrue(directory != null);
|
||||
child = new PsiDirectoryNode(getProject(), directory, getSettings());
|
||||
if (directory != null) {
|
||||
children.add(new PsiDirectoryNode(getProject(), directory, getSettings()));
|
||||
}
|
||||
}
|
||||
else {
|
||||
PsiFile file = psiManager.findFile(contentRoot);
|
||||
LOG.assertTrue(file != null);
|
||||
child = new PsiFileNode(getProject(), file, getSettings());
|
||||
if (file != null) {
|
||||
children.add(new PsiFileNode(getProject(), file, getSettings()));
|
||||
}
|
||||
}
|
||||
children.add(child);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user