From a8293892547076dcee40fe7c06803a2a5868cb2f Mon Sep 17 00:00:00 2001 From: Sergey Evdokimov Date: Mon, 25 Jul 2011 16:47:39 +0400 Subject: [PATCH] IDEA-54251 (IDEA incorrectly altering grailsPlugins.iml file on Cache Invalidation) --- .../plugins/groovy/mvc/MvcWatchedRootProvider.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcWatchedRootProvider.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcWatchedRootProvider.java index 0da63368e7c8..d8e5dd45b76e 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcWatchedRootProvider.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcWatchedRootProvider.java @@ -27,16 +27,16 @@ public class MvcWatchedRootProvider implements WatchedRootsProvider { @NotNull public Set getRootsToWatch() { - if (!myProject.isInitialized()) { - return Collections.emptySet(); - } + if (!myProject.isInitialized()) return Collections.emptySet(); - final Set result = new HashSet(); + Set result = null; for (Module module : ModuleManager.getInstance(myProject).getModules()) { final MvcFramework framework = MvcModuleStructureSynchronizer.getFramework(module); if (framework == null) continue; + if (result == null) result = new HashSet(); + final File sdkWorkDir = framework.getCommonPluginsDir(module); if (sdkWorkDir != null) { result.add(sdkWorkDir.getAbsolutePath()); @@ -48,7 +48,7 @@ public class MvcWatchedRootProvider implements WatchedRootsProvider { } } - return result; + return result == null ? Collections.emptySet() : result; } }