From 8875af54a2c0c4fab1dbfad53d1568f9d33be71a Mon Sep 17 00:00:00 2001 From: Alexander Bubenchikov Date: Wed, 4 Dec 2024 16:23:45 +0100 Subject: [PATCH] [IDEA-363401] revert logic of ModuleExcludeIndexImpl as it should be Avoiding deleting the project dir in case if module output is empty (true for all maven projects) (cherry picked from commit b385d3b408f9378f5bd2c9c553712cd1ad03a4a1) IJ-CR-150866 GitOrigin-RevId: 4863b729d96f1e4785771af94e77e7961a1b67af --- .../indices/impl/ModuleExcludeIndexImpl.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) 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<>();