[java] allows one module-info file in either source or test root - actions (IDEA-171221)

This commit is contained in:
Roman Shevchenko
2017-04-12 11:53:31 +02:00
parent 7bc5c83779
commit c087c3692f
@@ -61,7 +61,7 @@ public class CreateModuleInfoAction extends CreateFromTemplateActionBase {
.map(view -> getTargetDirectory(ctx, view))
.filter(PsiUtil::isLanguageLevel9OrHigher)
.map(ModuleUtilCore::findModuleForPsiElement)
.map(module -> FilenameIndex.getVirtualFilesByName(module.getProject(), MODULE_INFO_FILE, module.getModuleScope(false)).isEmpty())
.map(module -> FilenameIndex.getVirtualFilesByName(module.getProject(), MODULE_INFO_FILE, module.getModuleScope()).isEmpty())
.orElse(false);
e.getPresentation().setEnabledAndVisible(available);
}