[java] filters invalid directories before checking a language level (EA-88041)
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>
Tue, 6 Sep 2016 13:51:16 +0000 (16:51 +0300)
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>
Tue, 6 Sep 2016 13:51:52 +0000 (16:51 +0300)
java/java-impl/src/com/intellij/ide/actions/CreateModuleInfoAction.java

index a72c5993e476231c7b9c99af803eb3f1bea1981f..e887bb83e4837fdbc3b0fd229d0b9b097aebe28d 100644 (file)
@@ -53,7 +53,7 @@ public class CreateModuleInfoAction extends CreateFromTemplateActionBase {
     DataContext ctx = e.getDataContext();
     boolean available = Optional.ofNullable(LangDataKeys.IDE_VIEW.getData(ctx))
       .map(view -> getTargetDirectory(ctx, view))
-      .filter(dir -> PsiUtil.isLanguageLevel9OrHigher(dir) && JavaDirectoryService.getInstance().isSourceRoot(dir))
+      .filter(dir -> JavaDirectoryService.getInstance().isSourceRoot(dir) && PsiUtil.isLanguageLevel9OrHigher(dir))
       .map(ModuleUtilCore::findModuleForPsiElement)
       .map(module -> FilenameIndex.getVirtualFilesByName(module.getProject(), MODULE_INFO_FILE, new ModulesScope(module)).isEmpty())
       .orElse(false);