diff --git a/jps/jps-builders/src/org/jetbrains/jps/indices/impl/ModuleExcludeIndexImpl.java b/jps/jps-builders/src/org/jetbrains/jps/indices/impl/ModuleExcludeIndexImpl.java index 7f117c2bfbfb5..d0a3ba0e5e374 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/indices/impl/ModuleExcludeIndexImpl.java +++ b/jps/jps-builders/src/org/jetbrains/jps/indices/impl/ModuleExcludeIndexImpl.java @@ -101,20 +101,18 @@ public ModuleExcludeIndexImpl(JpsModel model) { JpsJavaProjectExtension projectExtension = JpsJavaExtensionService.getInstance().getProjectExtension(model.getProject()); if (projectExtension != null) { String url = projectExtension.getOutputUrl(); - if (Strings.isEmpty(url)) { - return; - } - - Path excluded = Path.of(JpsPathUtil.urlToPath(url)); - Path parent = excluded; - while (parent != null) { - JpsModule module = contentToModule.get(parent); - if (module != null) { - myModuleToExcludesMap.get(module).add(excluded); + if (!Strings.isEmpty(url)) { + Path excluded = Path.of(JpsPathUtil.urlToPath(url)); + Path parent = excluded; + while (parent != null) { + JpsModule module = contentToModule.get(parent); + if (module != null) { + myModuleToExcludesMap.get(module).add(excluded); + } + parent = parent.getParent(); } - parent = parent.getParent(); + myExcludedRoots.add(excluded); } - myExcludedRoots.add(excluded); } List parents = new ArrayList<>();